After parsing the openadr3.yaml using taffy I serialize it to JSON and then feed it to an OpenAPI decoder.
It fails because of required and properties keywords are found in the items section of an array. To my understanding those are reserved for the object type. The parser is for OpenAPI ver. 3.1 but I think this case is valid for 3.0 as well.
One correction is to make the item an
object type:
programDescriptions:
type: array
description: A list of programDescriptions
items:
object:
required:
- URL
properties:
URL:
type: string
format: uri
minLength: 2 # see https://www.rfc-editor.org/rfc/rfc3986#appendix-A
maxLength: 8000
# see https://www.rfc-editor.org/rfc/rfc7230#section-3.1.1
# see https://www.rfc-editor.org/rfc/rfc9110#section-4.1-5
# see also: https://stackoverflow.com/a/417184/6571327
description: A human or machine readable program description
example: https://www.myCorporation.com/myProgramDescription
nullable: true
default: null
But since it is just one property I guess one could just keep the string part:
programDescriptions:
type: array
description: A list of programDescriptions
items:
type: string
format: uri
minLength: 2 # see https://www.rfc-editor.org/rfc/rfc3986#appendix-A
maxLength: 8000
# see https://www.rfc-editor.org/rfc/rfc7230#section-3.1.1
# see https://www.rfc-editor.org/rfc/rfc9110#section-4.1-5
# see also: https://stackoverflow.com/a/417184/6571327
description: A human or machine readable program description
example: https://www.myCorporation.com/myProgramDescription
nullable: true
default: null
The OpenAPI decoder passes when I make either of these changes.
The issue is valid for version 3.1.1 of OpenADR 3 as well.
After parsing the
openadr3.yamlusingtaffyI serialize it to JSON and then feed it to an OpenAPI decoder.It fails because of
requiredandpropertieskeywords are found in theitemssection of an array. To my understanding those are reserved for theobjecttype. The parser is for OpenAPI ver. 3.1 but I think this case is valid for 3.0 as well.openadr3-specification/3.1.0/openadr3.yaml
Line 1745 in e47c6da
One correction is to make the item an
objecttype:But since it is just one property I guess one could just keep the string part:
The OpenAPI decoder passes when I make either of these changes.
The issue is valid for version 3.1.1 of OpenADR 3 as well.