In the schema, omitting lines not relevant to the issue,
properties:
authTemplate:
description: "Optional authentication information template. This is used to avoid duplication in the auth list. \
Entries defined in the template will be applied to all elements in the auth list that do not specify them."
allOf:
- $ref: "#/$defs/AuthenticationInfo"
- type: object
# ...
AuthenticationInfo:
type: object
properties:
name:
type: string
required: ["name"]
To me, this suggests the authTemplate must be an AuthenticationInfo, which requires a name field.
However, in the Dataset repo, we find the blogapi example:
auth:
- name: admin
loginEndpointAuth:
payloadRaw: "{\"usernameOrEmail\": \"admin\", \"password\": \"bar123\"}"
- name: user
loginEndpointAuth:
payloadRaw: "{\"usernameOrEmail\": \"user\", \"password\": \"bar123\"}"
authTemplate:
loginEndpointAuth:
endpoint: /api/auth/signin
verb: POST
contentType: application/json
token:
extractFrom: body
extractSelector: /accessToken
sendName: Authorization
sendIn: header
sendTemplate: "Bearer {token}"
Incidentally, the same holds for LoginEndpointAuth, which requires the verb, but no verbs are specified in the auth array in the example.
The comments suggest that each AuthenticationInfo and its sub-objects may omit required fields at will, as long as the merged variant satisfies the required constraints. However, I don't think that's what the specification actually specifies. Or am I misunderstanding how this kind of specification works?
In the schema, omitting lines not relevant to the issue,
To me, this suggests the
authTemplatemust be anAuthenticationInfo, which requires anamefield.However, in the Dataset repo, we find the blogapi example:
Incidentally, the same holds for LoginEndpointAuth, which requires the
verb, but noverbs are specified in theautharray in the example.The comments suggest that each AuthenticationInfo and its sub-objects may omit required fields at will, as long as the merged variant satisfies the
requiredconstraints. However, I don't think that's what the specification actually specifies. Or am I misunderstanding how this kind of specification works?