Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Swagger doc: "required" in properties should be array of strings #159

Open
biltongza opened this issue May 7, 2021 · 0 comments

Comments

@biltongza
Copy link

I am trying to use NSwag to build a C# client for the Lightroom API off of the swagger doc in this repository. It is unhappy with the path paths['/v2/catalogs/{catalog_id}/assets/{asset_id}'].put.parameters[4].schema.properties.payload.properties.captureDate.required:

According to the OpenAPI 2.0 spec, this required field should actually be an array of strings. The schema object is defined here: https://swagger.io/specification/v2/#schemaObject which references the Json Schema Validation spec here: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#page-12 which says:

5.4.3. required

5.4.3.1. Valid values

The value of this keyword MUST be an array. This array MUST have at
least one element. Elements of this array MUST be strings, and MUST
be unique.

I'm not sure how an array of strings for a "required" field is useful to anybody, but technically, the document is invalid according to the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant