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

feat(ls): provide OpenAPI 3.1.0 completion rules for OAuth Flow #2173

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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