Open ArthurWD opened 8 years ago
@gwshaw @jreece1567 this seems pretty reasonable. Any reservations about supporting this?
If we're in agreement about supporting this, there is an outstanding PR that we should review and get moving. https://github.com/westfieldlabs/apivore/pull/89
I'm fine with supporting this. We must not use this capability in our internal westfield swagger, but Apivore should support it as it is part of the public swagger-specification.
cc: @ashoda @gwshaw
looks like it's more json-schema
gem limitation than apivore
. when using fragments, json-schema
seems not being able to understand the $ref
:
https://github.com/ruby-json-schema/json-schema/blob/master/lib/json-schema/validator.rb#L85
anyways, https://github.com/westfieldlabs/apivore/pull/89 should fix it.
@ashoda Any update about this issue ?
I would like to be able to reuse responses by setting references, like this:
Currently, it ignores the reference, letting any value pass. My current attempt is to fix this is by altering Apivore::Swagger.each_response:
But this raises "NoMethodError: undefined method `validate' for {"$ref"=>"#/definitions/Error"}:Hash"
Any plans for supporting this?