Skip to content

Commit

Permalink
feat(ls): provide OpenAPI 3.1.0 completion rules for OAuth Flow (#2173)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-lai authored Oct 21, 2022
1 parent 081e8aa commit 7e74e6a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions packages/apidom-ls/src/config/openapi/oauth-flow/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ const completion: ApidomCompletionItem[] = [
{ namespace: 'openapi', version: '3.0.3' },
],
},
{
label: 'authorizationUrl',
insertText: 'authorizationUrl',
kind: 14,
format: CompletionFormat.QUOTED,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value:
'Applies to `oauth2` (`"implicit"`, `"authorizationCode"`). **REQUIRED**. The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.',
},
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
label: 'tokenUrl',
insertText: 'tokenUrl',
Expand All @@ -43,6 +57,20 @@ const completion: ApidomCompletionItem[] = [
{ namespace: 'openapi', version: '3.0.3' },
],
},
{
label: 'tokenUrl',
insertText: 'tokenUrl',
kind: 14,
format: CompletionFormat.QUOTED,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value:
'Applies to `oauth2` (`"password"`, `"clientCredentials"`, `"authorizationCode"`). **REQUIRED**. The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.',
},
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
label: 'refreshUrl',
insertText: 'refreshUrl ',
Expand All @@ -61,6 +89,20 @@ const completion: ApidomCompletionItem[] = [
{ namespace: 'openapi', version: '3.0.3' },
],
},
{
label: 'refreshUrl',
insertText: 'refreshUrl ',
kind: 14,
format: CompletionFormat.QUOTED,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value:
'Applies to `oauth2`. The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.',
},
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
label: 'scopes',
insertText: 'scopes ',
Expand Down

1 comment on commit 7e74e6a

@char0n
Copy link
Member

@char0n char0n commented on 7e74e6a Oct 24, 2022

Choose a reason for hiding this comment

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

Issues a PR to make OpenAPI 3.0.x completion rules consistent with OpenAPI 3.1.0 by adding Applies to * sentence in documentation.value prop: #2179

Please sign in to comment.