Skip to content
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

Use SecurityDefinitions type for _componentsSecuritySchemes #32

Merged
merged 3 commits into from
Dec 12, 2021
Merged

Use SecurityDefinitions type for _componentsSecuritySchemes #32

merged 3 commits into from
Dec 12, 2021

Conversation

gromakovsky
Copy link
Contributor

Problem: there is SecurityDefinitions newtype which is unused.
Long ago it was used to store security schemas, but then in 821654c
the corresponding field changed to Definitions SecurityScheme.
There is one essential difference caused by this change: now if we
mappend two Components (or other types that hold Components
inside) and both sides have SecuritySchemeOAuth2, they won't be
merged.

Solution: change _componentsSecuritySchemes to SecurityDefinitions.

Resolves #30

Problem: there is `SecurityDefinitions` newtype which is unused.
Long ago it was used to store security schemas, but then in 821654c
the corresponding field changed to `Definitions SecurityScheme`.
There is one essential difference caused by this change: now if we
mappend two `Components` (or other types that hold `Components`
inside) and both sides have `SecuritySchemeOAuth2`, they won't be
merged.

Solution: change `_componentsSecuritySchemes` to `SecurityDefinitions`.
When we concatenate OpenApi objects, we want security schemes
to be merged deeply, so that if there are 2 `OAuth2Flows` in
`SecuritySchemeOAuth2`, they are concatenated.
Previously it wasn't tested and was failing without the previous
fix. The new test concatenates two `OpenApi` objects with
`SecuritySchemeOAuth2`.
@gromakovsky gromakovsky marked this pull request as ready for review November 24, 2021 16:46
@gromakovsky
Copy link
Contributor Author

@maksbotan I think it's ready for review. I've added a test that fails without my change and doesn't fail with my change. Please note that it's a breaking change.

@maksbotan maksbotan merged commit b71892d into biocad:master Dec 12, 2021
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.

What's the point of SecurityDefinitions?
2 participants