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
Supporting Message Based APIs (Ask for demo from Fran and Uri)
Reacted by Eugen Konkov, Jared Scheib, Guillermo Ignacio Enriquez Gutierrez, Arthur Bodera, Sirio Marchi, Dzmitry Bekish, sree, Jon Ursenbach, Grant Carthew, Jared Dillard and 8 more
In particular, is there an ETA on having an OAS JSON Schema? My Modern project is an OpenAPI3-first web framework for Ruby and the closest things I have to validation of my output schema are openapi3_parser (which, while ambitious, is not comprehensive nor is it canonical) or putting the thing into swagger-js and seeing what errors I get out of it.
@MikeRalphson is there a concise summary somewhere of why we have two stalled PRs for this? If y'all want help writing a schema I'm happy to take a crack at it but I'm kind of afraid to dig through those PRs. I'd be more likely to just eyeball the spec and make a new proposal, but I don't want to do that if either of the existing ones is likely to move forwards, and if I do make an attempt, I definitely want to avoid whatever we already know that's caused these to get stuck.
@handrews thanks! The opening comment of #1270 sums up the reason for there being two schemas. #1236 was generated from the spec. markdown itself and only deals with objects defined therein (thus has some limitations in its ability to thoroughly validate an OAS document). #1270 has some extended abstractions so as to enforce dependencies between properties etc.
Please see #1270 (comment) (on maintainability) and @webron's reply #1270 (comment) - is there a better way of modelling allOf with additionalProperties: false situations?
@webron is closest to how this is most likely to move forward (as #1236 is auto-generated, I suspect help on #1270 would be the more productive route).
@darrelmiller, do we want to consider Conformance Test Suite for OAS3 consumers as a possible addition to this list? Or should we treat that as something separate, because it's not a new capability in OAS itself?
@tedepstein It's a worthy goal and it takes time, so it should be considered along with the other efforts. Whether we have the capacity to make it happen in the timeframe is a different question.
Two votes for Alternative Schema:
"For most of our customers schema documents are an important part of the management and the publication of their datasets (today mostly XML Schema, but there is growing interest in JSON Schema). Such an extension would greatly help to link those schemas from our OpenAPI definitions in a clear and unambiguous way. We would also implement the alternative schema Object in our software later this year, if it will be included in 3.1." Clemens Portele - Interactive Instruments Gmbh
"the proposal looks good to me and I support it." Peter Vretanos - CubeWerx
Both companies produce COTS products for the discovery and access of geospatial data.
JSON Schema for OAS
ESA, NASA, NOAA, and others are looking for a common way for clients to access remote sensing data. A JSON Schema for OAS would help document this interface. Think in terms of an API template which will behave the same no matter who implements it.
Use case: The EU is federating member nation clouds for processing Earth Observation data. Data and analytics will be able to move freely between the clouds. Any analytic must be able to access any data from anywhere in the federation.
I would like to request/propose upgrading the JSON Schema compatible version to draft-07 / draft- @handrews -json-schema*-01. But I don't know if this is already being considered somewhere else.
But I see the included schemas declare being compatible with draft-04 (or am I misunderstanding something?).
Also, I don't know if a new issue would be the correct place to request it, before knowing if it applies or is already considered. And I don't want to add clutter to the issues...
I could submit a PR, but I'm not sure that would actually help you guys, or if it would be better to just add the comment here and let you guys do it yourselves.
@tiangolo I was referring to the JSON Schema that describes an OpenAPI description document.
I don't expect the OAS to update to a newer version of JSON Schema until it comes out of draft. Alternative Schemas will be an interim solution for people who want to rely on draft versions of JSON Schema. We are waiting for implementations of Alternative Schemas to appear before incorporating it into the specification.
@xiaoxiangmoe OAS 3.1 will support full JSON Schema compatibility, and while JSON Schema does not have a direct analogue of discriminator (for a whole bunch of reasons), it has several features that could be used to build a much better and more flexible discriminator-ish feature. Hopefully with that available, folks will experiment and then we can codify something that fits with JSON Schema more cleanly than the current discriminatorand is more flexible.
Reacted by Sebastián Ramírez, Kevin Swiber and Roberto Polli
OAS 3.0 supports formats int32 and int64.
Will OAS 3.1 support formats int8, int16, int32 and int64 or formats for integers will not be defined by OAS 3.1?
I think adding support for int8 and int16 would be very helpful because these types are often used for bytes/shorts in many dictionaries and configuration.
In JSON Schema draft 2019-09 and therefore in OAS 3.1, format is an annotation, not by default, a constraint so the utility of a list or registry of approved formats is somewhat diminished.
It may be better to use minimum and maximum constraints instead of (u)intXX formats going forward.
I know this is a very old, long and tedious discussion, but the conditional validation, in my personal opinion, is a community demand (looking to all the comments, Stack Overflow questions, etc.). I did a small snippet proposal using the 'when' keyword (instead of if/else/then) and it cover basically all my problems for conditional parameters validation. I hope it inspire anyone:
JobExecution:
type: objectproperties:
async:
type: integerenum: [0, 1]example: 1inputType:
type: stringenum: [text, audio]example: audioaudioOptimization:
type: stringenum:
when:# check the inputType parameterinputType: # if audio type...audio:# checks for async parameterwhen:async:# define the enum according to the async option# null is not present in enum because the audioOptimization can't be null when inputType is audio# in this case, dolby optimization only is allowed in async mode0: [disabled, internal] 1: [disabled, internal, dolby]# if the inputType is text, instead, the only enum item is nulltext: [null]# audioOptimization may be null if inputType is textnullable:
when:inputType: - text# audioOptimization may be not present if inputType is text, but is required if inputType is audiorequired:
when:
inputType:
- audioexample: internal
Please, I'am not expert in openapi, standards or specifications. I'am sure the syntax I did used was not right, but I hope to be enough to delivery my idea
Activity
eropple commentedon Feb 27, 2018
In particular, is there an ETA on having an OAS JSON Schema? My Modern project is an OpenAPI3-first web framework for Ruby and the closest things I have to validation of my output schema are openapi3_parser (which, while ambitious, is not comprehensive nor is it canonical) or putting the thing into swagger-js and seeing what errors I get out of it.
MikeRalphson commentedon Feb 27, 2018
@eropple although there is no ETA yet, have you seen the two draft schema proposals in PRs #1236 and #1270 ?
handrews commentedon Feb 27, 2018
@MikeRalphson is there a concise summary somewhere of why we have two stalled PRs for this? If y'all want help writing a schema I'm happy to take a crack at it but I'm kind of afraid to dig through those PRs. I'd be more likely to just eyeball the spec and make a new proposal, but I don't want to do that if either of the existing ones is likely to move forwards, and if I do make an attempt, I definitely want to avoid whatever we already know that's caused these to get stuck.
MikeRalphson commentedon Feb 27, 2018
@handrews thanks! The opening comment of #1270 sums up the reason for there being two schemas. #1236 was generated from the spec. markdown itself and only deals with objects defined therein (thus has some limitations in its ability to thoroughly validate an OAS document). #1270 has some extended abstractions so as to enforce dependencies between properties etc.
Please see #1270 (comment) (on maintainability) and @webron's reply #1270 (comment) - is there a better way of modelling
allOfwithadditionalProperties: falsesituations?@webron is closest to how this is most likely to move forward (as #1236 is auto-generated, I suspect help on #1270 would be the more productive route).
tedepstein commentedon Jul 13, 2018
@darrelmiller, do we want to consider Conformance Test Suite for OAS3 consumers as a possible addition to this list? Or should we treat that as something separate, because it's not a new capability in OAS itself?
darrelmiller commentedon Jul 13, 2018
@tedepstein It's a worthy goal and it takes time, so it should be considered along with the other efforts. Whether we have the capacity to make it happen in the timeframe is a different question.
cmheazel commentedon Jul 26, 2018
Two votes for Alternative Schema:
"For most of our customers schema documents are an important part of the management and the publication of their datasets (today mostly XML Schema, but there is growing interest in JSON Schema). Such an extension would greatly help to link those schemas from our OpenAPI definitions in a clear and unambiguous way. We would also implement the alternative schema Object in our software later this year, if it will be included in 3.1." Clemens Portele - Interactive Instruments Gmbh
"the proposal looks good to me and I support it." Peter Vretanos - CubeWerx
Both companies produce COTS products for the discovery and access of geospatial data.
cmheazel commentedon Jul 26, 2018
JSON Schema for OAS
ESA, NASA, NOAA, and others are looking for a common way for clients to access remote sensing data. A JSON Schema for OAS would help document this interface. Think in terms of an API template which will behave the same no matter who implements it.
Use case: The EU is federating member nation clouds for processing Earth Observation data. Data and analytics will be able to move freely between the clouds. Any analytic must be able to access any data from anywhere in the federation.
MikeRalphson commentedon Jan 3, 2019
@cmheazel Great to hear, although this does completely go against the idea of draft-features.
ahl commentedon May 17, 2019
@darrelmiller would it be worth updating the checklist? Do I understand correctly that the JSON schema and alternative schema items are complete?
tiangolo commentedon May 20, 2019
May I ask, what this item refers to?
I would like to request/propose upgrading the JSON Schema compatible version to draft-07 / draft- @handrews -json-schema*-01. But I don't know if this is already being considered somewhere else.
The current version says it's compatible with "JSON Schema Specification Wright Draft 00".
But I see the included schemas declare being compatible with draft-04 (or am I misunderstanding something?).
Also, I don't know if a new issue would be the correct place to request it, before knowing if it applies or is already considered. And I don't want to add clutter to the issues...
I could submit a PR, but I'm not sure that would actually help you guys, or if it would be better to just add the comment here and let you guys do it yourselves.
darrelmiller commentedon May 20, 2019
@tiangolo I was referring to the JSON Schema that describes an OpenAPI description document.
I don't expect the OAS to update to a newer version of JSON Schema until it comes out of draft. Alternative Schemas will be an interim solution for people who want to rely on draft versions of JSON Schema. We are waiting for implementations of Alternative Schemas to appear before incorporating it into the specification.
darrelmiller commentedon May 20, 2019
@ahl JSON Schema for OAS is complete. Alternative schema is still in pilot phase.
tiangolo commentedon May 20, 2019
Thanks for answering @darrelmiller ! I'll subscribe and comment on the issue about Alternative Schemas.
4 remaining items
ioggstream commentedon Sep 27, 2019
Is there a PR for that or you are referencing #1864 ?
MikeRalphson commentedon Sep 27, 2019
I'm referring to OAI/Overlay-Specification#36 - when I say implemented, I mean wrote a PoC implementation in code.
xiaoxiangmoe commentedon Jun 27, 2020
Is #681 possible to be supported in oas 3.1
MikeRalphson commentedon Jun 27, 2020
OAS 3.1 will support #681 (comment)
xiaoxiangmoe commentedon Jun 27, 2020
If we support integer enum with named items, can we also support named int enum as discriminator in mapping?
philsturgeon commentedon Jul 7, 2020
Can we close this and punt some issues over to 3.2 possibilities?
handrews commentedon Jul 7, 2020
@xiaoxiangmoe OAS 3.1 will support full JSON Schema compatibility, and while JSON Schema does not have a direct analogue of
discriminator(for a whole bunch of reasons), it has several features that could be used to build a much better and more flexible discriminator-ish feature. Hopefully with that available, folks will experiment and then we can codify something that fits with JSON Schema more cleanly than the currentdiscriminatorand is more flexible.kdebski85 commentedon Jul 31, 2020
I have a question regarding support for
formatforintegertype.In
Defined Formatssection ofJSON SchemaI haven't found anything about integers - https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.7.3OAS 3.0 supports formats int32 and int64.
Will OAS 3.1 support formats int8, int16, int32 and int64 or formats for integers will not be defined by OAS 3.1?
I think adding support for int8 and int16 would be very helpful because these types are often used for bytes/shorts in many dictionaries and configuration.
MikeRalphson commentedon Jul 31, 2020
In JSON Schema draft 2019-09 and therefore in OAS 3.1,
formatis an annotation, not by default, a constraint so the utility of a list or registry of approved formats is somewhat diminished.It may be better to use
minimumandmaximumconstraints instead of (u)intXX formats going forward.grossb1 commentedon Apr 22, 2021
Was curious about the status of OAI/Overlay-Specification#34
MikeRalphson commentedon May 13, 2021
Closing in favour of #2572 - thanks @earth2marsh!
juninhodeluca commentedon Oct 6, 2023
I know this is a very old, long and tedious discussion, but the conditional validation, in my personal opinion, is a community demand (looking to all the comments, Stack Overflow questions, etc.). I did a small snippet proposal using the 'when' keyword (instead of if/else/then) and it cover basically all my problems for conditional parameters validation. I hope it inspire anyone:
Please, I'am not expert in openapi, standards or specifications. I'am sure the syntax I did used was not right, but I hope to be enough to delivery my idea