-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Alternative Schema and Custom Security Schemes #1736
Conversation
Added Alternative Schema and Alternative Schema Object.
Good stuff. @darrelmiller there is an implication in |
From TSC meeting,
Action:
|
|
||
##### Alternative Schema Registry | ||
|
||
It is important that there is a common understanding of the values which can be used to populate the alterative schema "type" property. An registry of alternative schema types is hosted at [https://spec.openapis.org/registries/alternative-schema](https://spec.openapis.org/registries/alternative-schema). This register serves as a controlled vocabulary which should be used to populate the "type" property. The Inital contents of the registry include: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is important that there is a common understanding of the values which can be used to populate the alterative schema "type" property. An registry of alternative schema types is hosted at [https://spec.openapis.org/registries/alternative-schema](https://spec.openapis.org/registries/alternative-schema). This register serves as a controlled vocabulary which should be used to populate the "type" property. The Inital contents of the registry include: | |
It is important that there is a common understanding of the values which can be used to populate the alternative schema "type" property. A registry of alternative schema types is hosted at [https://spec.openapis.org/registries/alternative-schema](https://spec.openapis.org/registries/alternative-schema). This register serves as a controlled vocabulary which should be used to populate the "type" property. The Initial contents of the registry include: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also "This register serves" -> "This registry serves"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: link is dead for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fenollp yeah, I think the expectation is that that registry will exist by the time OAS 3.1 is published, but it has not been set up yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fenollp you can substitute spec.mermade.org.uk
for spec.openapis.org
in those urls to get an idea for how the registry might look (framework is an approved proof-of-concept, but the content is purely illustrative).
@darrelmiller |
OK, regarding For those not inclined to dive into the spec:
You generally want to evaluate assertions first, because if you fail an assertion you don't need to process the applicators or annotations.
So:
If The behavior of I would say that this is correct. If an API designer wants to allow not recognizing any of them, either because a no-op is fine or because there are also OAS-native schema keywords to evaluate, then they can just have one more branch of the |
|
||
```yaml | ||
schema: | ||
allOf: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a allOf
that has firstOf
semantics? Should this be a blocker for shipping alternative-schema
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x-oas-draft-firstOfPleaseDontBugJSONSchemaAboutThis
😜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted on today's call (for the benefit of those not present), I think (pending the resolution of other procedural concerns), we should move ahead with alternativeSchema
for the many use cases that do not require firstOf
semantics, and consider x-oas-draft-firstOf
to get more feedback on that use case. Particularly how prevalent it is in practice.
The Web Feature Service (ISO 19142:2010) is a Web Service which allows clients to discover and access spatial/temporal objects (Features). Version 3.0 of the WFS is based on OpenAPI. I have received some feedback from the implementors of this standard relating to alternative schema: 1) Peter Vretanos, Cubewerx, "Our WFS 3.0 supports numerous output formats. Some of these have associated schema descriptions that are not easily mapped into the JSON-Schema that OpenApi uses. Actually, in some cases the schema is not expressed in JSON or XML at all (e.g. DTD or SQL DDL) making it impossible to describe resources using OpenAPI's existing mechanisms. Having the ability to reference an external schema to describe such resources would be a big plus for us!" 2) Andre Aime, GeoSolutions, "for INSPIRE compliant WFSs the ability to refer to an external standard schema is pretty much a requirement" NOTE: INSPIRE is the European Union directive to create a European Union spatial data infrastructure based on Web standards. See https://inspire.ec.europa.eu/ |
Added support for additional security schemes by adding a "custom" value to the security scheme type enumeration and a customType field to distinguish between custom schemes.
Added Custom Security Schemes per our discussion at the last meeting. |
@cmheazel It may be better to add that as a separate PR, thus they can be merged independantly, and we can guarantee easy reversion if any problem is later found. |
@MikeRalphson Will do. Can't get it done for Thursday though. |
No problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split as per comments.
@webron Needs to comment on this during his long holiday break. |
@cmheazel Hi! And thanks for this great PR. Did you had the chance to split your PR? #1736 (comment) If you want I can help ;) |
Hi @ioggstream if you have the time I would appreciate the help. I'm a bit swamped at the moment. |
allOf: | ||
- alternativeSchema: | ||
type: xmlSchema | ||
location: ./xmlSchema.xsd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a fragment
to better clarify https://github.com/OAI/OpenAPI-Specification/pull/1736/files#diff-b83206d953b4be5d312b068f82ba0217R3174
anyOf:
- alternativeSchema:
type: xmlSchema
location: schema.xsd#/person
|
||
Name | Link | Description | ||
---|:---:|--- | ||
<a name="jsonSchemaType"></a>jsonSchema | `https://spec.openapis.org/registries/alternative-schema#jsonSchema` | JSON schema documents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If next OAS will use jsonSchema this could be removed, right?
We aren’t updating alternative schema until #1977 is in, and it may well stay because in the future JSON Schema v1.0 will be different from the OpenAPI JSON Schema vocab pegged to 2019-09.
…On Thu, Nov 7, 2019 at 11:47, Roberto Polli ***@***.***> wrote:
@ioggstream commented on this pull request.
---------------------------------------------------------------
In [versions/3.1.0.md](#1736 (comment)):
> +```yaml
+schema:
+ type: array
+ items:
+ alternativeSchema:
+ type: jsonSchema
+ location: ./real-jsonschema.json
+```
+
+##### Alternative Schema Registry
+
+It is important that there is a common understanding of the values which can be used to populate the alterative schema "type" property. An registry of alternative schema types is hosted at [https://spec.openapis.org/registries/alternative-schema](https://spec.openapis.org/registries/alternative-schema). This register serves as a controlled vocabulary which should be used to populate the "type" property. The Inital contents of the registry include:
+
+Name | Link | Description
+---|:---:|---
+<a name="jsonSchemaType"></a>jsonSchema | `https://spec.openapis.org/registries/alternative-schema#jsonSchema` | JSON schema documents
If next OAS will use jsonSchema this could be removed, right?
—
You are receiving this because you commented.
Reply to this email directly, [view it on GitHub](#1736?email_source=notifications&email_token=AAAQONLOQCUMWR6O5FNANW3QSP54FA5CNFSM4GARED3KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCKWFGQY#pullrequestreview-313283395), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAAQONMOC3CMCEQHGAFW7YTQSP54FANCNFSM4GARED3A).
|
Added Alternative Schema and Alternative Schema Object.