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

Swagger-editor: Using items without type: array still validated ok #1344

Closed
mohsen1 opened this issue Oct 6, 2015 · 5 comments
Closed

Swagger-editor: Using items without type: array still validated ok #1344

mohsen1 opened this issue Oct 6, 2015 · 5 comments
Milestone

Comments

@mohsen1
Copy link

mohsen1 commented Oct 6, 2015

From @hpoints on October 6, 2015 19:42

My yaml validated ok, but then I could not generate any client/server artifacts. Had to manually find the error. My error was using items in some places where schema should have been used.

Copied from original issue: swagger-api/swagger-editor#681

@mohsen1
Copy link
Author

mohsen1 commented Oct 6, 2015

A JSON Schema like this: {"type": "array"} is describing an array with any element. It is valid JSON Schema. This is a problem in swagger-codegen where it doesn't like arrays without items schema.

@wing328
Copy link
Contributor

wing328 commented Oct 7, 2015

@mohsen1 according to the spec, if type is array, then items must be provided.

items   Items Object    Required if type is "array". Describes the type of items in the array.

@mohsen1
Copy link
Author

mohsen1 commented Oct 7, 2015

Then the swagger json schema should catch it. @webron

@webron
Copy link
Contributor

webron commented Oct 7, 2015

@fehguy
Copy link
Contributor

fehguy commented Oct 26, 2015

I believe we fall back to string in the codegen if the inner type is not specified.

@fehguy fehguy closed this as completed Oct 26, 2015
@fehguy fehguy modified the milestone: v2.1.4 Oct 26, 2015
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

4 participants