You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the spec, a reference is allowed anywhere a Schema Object can appear, but _schemaAllOf :: Maybe [Schema] means that only an inline schema is accepted for the allOf property.
As far as I can tell, all other Schema properties are typed as Referenced Schema.
The motivating case is a schema which has several UTCTime properties, each with a different description, example, min, etc. our workaround for the time being is to inline the UTCTime schema each time it is used, but I believe allOf is a better way of representing this situation, and experimenting with hand-written swagger.json suggests that SwaggerUI handles it.
Note: I’d be happy to submit a PR changing the type, but it will break any code that uses allOf. Is there any guidance about how to introduce a change like this without too much disruption?
The text was updated successfully, but these errors were encountered:
Interestring, I did not think allOf could actually be useful!
Can you share more about the workflow you have (or would like to have) with allOf?
I know about the problem with different descriptions for different fields, but I do not have any good solutions. Except making newtypes with adjusted ToSchema instances (which is unfortunate if you only need to change the description). I think the problem is actually that Swagger does not allow descriptions for fields (not schemas), but that does not make our lives easier :)
I'm happy to accept a PR. I don't think many people use allOf, but it's not a huge change anyway.
People would just have to wrap their schemas in Inline for things to work as before.
According to the spec, a reference is allowed anywhere a Schema Object can appear, but
_schemaAllOf :: Maybe [Schema]
means that only an inline schema is accepted for theallOf
property.As far as I can tell, all other
Schema
properties are typed asReferenced Schema
.The motivating case is a schema which has several
UTCTime
properties, each with a different description, example, min, etc. our workaround for the time being is to inline the UTCTime schema each time it is used, but I believeallOf
is a better way of representing this situation, and experimenting with hand-written swagger.json suggests that SwaggerUI handles it.Note: I’d be happy to submit a PR changing the type, but it will break any code that uses
allOf
. Is there any guidance about how to introduce a change like this without too much disruption?The text was updated successfully, but these errors were encountered: