Skip to content

Move the existing Security Scheme and OAuth Flow(s) Objects and their schema $defs from the OpenAPI Specification - #51

Open
handrews wants to merge 3 commits into
OAI:v1.0-devfrom
handrews:legacy
Open

handrews wants to merge 3 commits into
OAI:v1.0-devfrom
handrews:legacy

Conversation

@handrews

Copy link
Copy Markdown
Member

This just moves things over so we can iterate on any necessary changes.

The schema approach in particular should not be taken too seriously, as noted in the README. I just want the schema to stay in the same repository rather than be separated while we figure out how to structure it.

This commit is an exact copy of the Security Scheme Object,
OAuth Flows Object, and OAuth FLow Object sections of the OAS
as they appear on the v3.3 branch in the OpenAPI-Specification
repository (commit 22026f5a876674d0fbe5f5d1f9d9a1380587a4be).
Comment on lines +27 to +31
- $ref: '#/$defs/security-scheme/$defs/type-apikey'
- $ref: '#/$defs/security-scheme/$defs/type-http'
- $ref: '#/$defs/security-scheme/$defs/type-http-bearer'
- $ref: '#/$defs/security-scheme/$defs/type-oauth2'
- $ref: '#/$defs/security-scheme/$defs/type-oidc'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think of the security scheme object as a "discriminated union", with the type field being the "discriminator". I think the natural way to think of discriminated unions is as a "oneOf". Is there some advantage or benefit to expressing it as an "allOf" here? Not that I think the current description is "wrong" -- it just doesn't match my intuition. And I think an "allOf" description might be less verbose -- avoiding the "if / then / else" construction in the subschemas.

@mkistler mkistler left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me, but please look at my comments as I think there may be some small corrections needed before merging.

Comment thread src/security.md
@@ -10,6 +10,126 @@

TODO: Define the Security Specification.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this line be deleted now that the Specification section has been added?

Comment on lines +219 to +225
specification-extensions:
$comment: https://spec.openapis.org/oas/v3.3#specification-extensions
patternProperties:
'^x-': true

additionalProperties:
$ref: '#/$defs/example-or-reference'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something looks not quite right here. Looking a the 3.2 schema, I think the "additionalProperties" came from the "examples" def, so it probably shouldn't be here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants