File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/react-openapi/src Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,11 @@ export function OpenAPISecurities(props: {
4343 body : (
4444 < div className = "openapi-schema" >
4545 { schemes . map ( ( security , index ) => {
46- const description = resolveDescription ( security ) ;
46+ // OAuth2 description is already rendered in OpenAPISchemaOAuth2Item
47+ const description =
48+ security . type !== 'oauth2'
49+ ? resolveDescription ( security )
50+ : undefined ;
4751 return (
4852 < div
4953 key = { `${ key } -${ index } ` }
@@ -174,6 +178,8 @@ function OpenAPISchemaOAuth2Item(props: {
174178
175179 const scopes = ! security . scopes ?. length && flow . scopes ? Object . entries ( flow . scopes ) : [ ] ;
176180
181+ const description = resolveDescription ( security ) ;
182+
177183 return (
178184 < div >
179185 < OpenAPISchemaName
@@ -183,7 +189,9 @@ function OpenAPISchemaOAuth2Item(props: {
183189 required = { security . required }
184190 />
185191 < div className = "openapi-securities-oauth-content openapi-markdown" >
186- { security . description ? < Markdown source = { security . description } /> : null }
192+ { description ? (
193+ < Markdown source = { description } className = "openapi-securities-description" />
194+ ) : null }
187195 { 'authorizationUrl' in flow && flow . authorizationUrl ? (
188196 < span >
189197 Authorization URL:{ ' ' }
You can’t perform that action at this time.
0 commit comments