-
Notifications
You must be signed in to change notification settings - Fork 59
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
What part of Swagger spec describes SwaggerItemsArray? #107
Comments
It looks like jso-schema spec allows arrays though - https://tools.ietf.org/html/draft-fge-json-schema-validation-00#page-9 |
And in the next spec https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.md#properties it is even said explicitly
|
@qrilka For homogeneous lists Note though that you can limit the size for homogeneous lists using instance ToSchema QuartileCounts where
declareNamedSchema _ = declareNamedSchema (Proxy @ [Sum Integer])
& name ?~ "QuartileCounts"
& schema.minItems ?~ 4
& schema.maxItems ?~ 4 It is possible that I misread the specification (which was and is incredibly hard to read, TBH). It is also possible that at the time when I introduced Note that without |
@fizruk actually I've written almost the same code as you've pasted above :) |
To be clear, I'm happy with the way things are right now. I don't think any of my APIs rely on Nonetheless, someone should read Swagger specification thoroughly and decide whether |
I pasted my swagger JSON into https://editor.swagger.io/ and saw this: All of my instances are derived. |
In our code I've tried using
SwaggerItemsArray
with the followingToSchema
instance:which should cover as I understand values like e.g.
[21, 6, 4, 1]
.But with a
swagger.json
for that Python client (which usesbravado
to access Swagger endpoints) on unmarshaling line:And it looks like according to the spec (as shown at http://swagger.io/specification/#itemsObject or https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#itemsObject )
items
property should be a "Items Object" and not an array.For our case I'll go with
SwaggerItemsObject
as this "tuple" is homogeneous but what about other tuples - at the moment it looks to me that swagger file generated withswagger2
will be incorrect.The text was updated successfully, but these errors were encountered: