Skip to content

Commit 081e8aa

Browse files
authored
feat(ls): provide OpenAPI 3.1.0 completion rules for OAuth Flows (#2172)
1 parent 8dda533 commit 081e8aa

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

packages/apidom-ls/src/config/openapi/oauth-flows/completion.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ const completion: ApidomCompletionItem[] = [
2424
{ namespace: 'openapi', version: '3.0.3' },
2525
],
2626
},
27+
{
28+
label: 'implicit',
29+
insertText: 'implicit',
30+
kind: 14,
31+
format: CompletionFormat.OBJECT,
32+
type: CompletionType.PROPERTY,
33+
insertTextFormat: 2,
34+
documentation: {
35+
kind: 'markdown',
36+
value:
37+
'[OAuth Flow Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oauthFlowObject)\n\\\n\\\nConfiguration for the OAuth Implicit flow.',
38+
},
39+
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
40+
},
2741
{
2842
label: 'password',
2943
insertText: 'password',
@@ -43,6 +57,20 @@ const completion: ApidomCompletionItem[] = [
4357
{ namespace: 'openapi', version: '3.0.3' },
4458
],
4559
},
60+
{
61+
label: 'password',
62+
insertText: 'password',
63+
kind: 14,
64+
format: CompletionFormat.OBJECT,
65+
type: CompletionType.PROPERTY,
66+
insertTextFormat: 2,
67+
documentation: {
68+
kind: 'markdown',
69+
value:
70+
'[OAuth Flow Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oauthFlowObject)\n\\\n\\\nConfiguration for the OAuth Resource Owner Password flow.',
71+
},
72+
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
73+
},
4674
{
4775
label: 'clientCredentials',
4876
insertText: 'clientCredentials',
@@ -62,6 +90,20 @@ const completion: ApidomCompletionItem[] = [
6290
{ namespace: 'openapi', version: '3.0.3' },
6391
],
6492
},
93+
{
94+
label: 'clientCredentials',
95+
insertText: 'clientCredentials',
96+
kind: 14,
97+
format: CompletionFormat.OBJECT,
98+
type: CompletionType.PROPERTY,
99+
insertTextFormat: 2,
100+
documentation: {
101+
kind: 'markdown',
102+
value:
103+
'[OAuth Flow Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oauthFlowObject)\n\\\n\\\nConfiguration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.',
104+
},
105+
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
106+
},
65107
{
66108
label: 'authorizationCode',
67109
insertText: 'clientCredentials',
@@ -81,6 +123,20 @@ const completion: ApidomCompletionItem[] = [
81123
{ namespace: 'openapi', version: '3.0.3' },
82124
],
83125
},
126+
{
127+
label: 'authorizationCode',
128+
insertText: 'clientCredentials',
129+
kind: 14,
130+
format: CompletionFormat.OBJECT,
131+
type: CompletionType.PROPERTY,
132+
insertTextFormat: 2,
133+
documentation: {
134+
kind: 'markdown',
135+
value:
136+
'[OAuth Flow Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oauthFlowObject)\n\\\n\\\nConfiguration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.',
137+
},
138+
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
139+
},
84140
];
85141

86142
export default completion;

0 commit comments

Comments
 (0)