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

[OpenApi] [Oauth] Fix render oauth when using OpenApi v3 #3333

Merged

Conversation

Jibbarth
Copy link
Contributor

@Jibbarth Jibbarth commented Jan 1, 2020

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets fixes #...
License MIT
Doc PR api-platform/docs#...

Following the documentation for Oauth in OAS3 (https://swagger.io/docs/specification/authentication/oauth2/), flows now need to be an array.

This fix turn this
image
in this
image

I kept the current behaviour for swagger v2.

@Jibbarth Jibbarth force-pushed the fix/oauth-security-definition-openapi branch from 49d7c32 to 5727a1c Compare January 1, 2020 13:33
'type' => $this->oauthType,
'description' => sprintf(
'OAuth 2.0 %s Grant',
strtolower(preg_replace('/[A-Z]/', ' \\0', lcfirst($this->oauthFlow)))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heavily inspired by CamelCaseToSnakeCaseNameConverter

@soyuka soyuka force-pushed the fix/oauth-security-definition-openapi branch from d05fad2 to 8dccfa3 Compare January 20, 2020 09:49
@soyuka soyuka merged commit 24fa80c into api-platform:2.5 Jan 20, 2020
@soyuka
Copy link
Member

soyuka commented Jan 20, 2020

Thanks @Jibbarth !

@Jibbarth Jibbarth deleted the fix/oauth-security-definition-openapi branch January 20, 2020 10:42
turegjorup added a commit to danskernesdigitalebibliotek/ddb-cover-service-upload that referenced this pull request Jun 2, 2020
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.

4 participants