-
Notifications
You must be signed in to change notification settings - Fork 12
Supporting x-nullable #112
Comments
Updated description because I was crossing things over. |
I think it makes sense to support this, let me clear this with our product team and see if we can get this implemented soon. Thanks for the detailed report @philsturgeon. |
Any news on this? |
Bump, @kylef could you update us on the state of this issue? |
I'd expect most of you are asking about this to use with Dredd. Right now Dredd is receiving the Swagger specific schema so to implement this feature we would need to craft JSON Schema's so that Dredd can use a JSON schema. JSON Schema supports multiple Alternatively, we could add support to Dredd for validating Swagger schemas which could include |
@kylef, Yes I think that is what is being described in this issue. Since your first option is probably a lot of work and because this repository is specifically focused on swagger and not JSON schema I don't think it is wise to change that. What is being said is this new feature is being added in v3.0 of swagger only. Since upgrading this to swagger 3.0 is probably a lot of work we might implement what other tools are doing and that is allowing the vendor specific |
Hey @kylef. Yeah It's a pain in the butt I know, but OpenAPI is not really JSON Schema as you probably know. OpenAPI v2 is 90% JSON Schema, and v3 is 99% JSON Schema, but this type issue is the largest remaining difference. If a one-line hack could be added to dredd somehow, that says Sure OAI3 has been out for a while now, but support is still really low. All of our stuff at WeWork is OAI2 whilst we wait on various tools to support OAI3 (like ReDoc, which has a 2.0.0-alpha1 supporting OAI3 yaaaay!) so this x-nullable support is still relevant. Thanks for taking the time to look into this @kylef! |
This is still very needed, guys. |
Re-opened until we bump fury version in dependencies. |
@honzajavorek This issue is on the swagger adapter where it is fixed though. This isn't an issue tracker for Dredd. |
@kylef 🙀 I'm sorry! I thought I'm on a different repo 🙈 |
Swagger/OpenAPI are in a weird state between v2.0 and v3.0. There have been a few keywords added to v3.0 that probably should have been backported into a v2.1 or something. Instead the authors have quite adamantly shouted "No, this is coming in v3!" and everyone has been kinda stuck waiting, or using
x-
vendor prefixes which some things support and some don't.You folks have done an awesome job supporting some of these
x-
vendor prefixes (likex-example
), but there is another one:x-nullable
.Currently you don't support
x-nullable
, which leads to Dredd pronouncing things as invalid when they are not. A workaround has been suggested in apiaryio/dredd#283, suggesting thattype: ['string', 'null']
will work. It doesn't.(Maybe their renderer or parser-of-choice is lax enough to support it, but ReDoc and any strict parser will error.)
More on this here swagger-api/swagger-editor#1302
Instead, OpenAPI 3.0 will add
nullable: true
on the schema object. In the mean time, renderers and parsers are supportingx-nullable: true
.Example: Redocly/redoc#95
Supporting this field during this odd v2.0 / v3.0 gap would be amazing, and I can't get Dredd running at work until this is done.
The text was updated successfully, but these errors were encountered: