-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathopenapi.json
More file actions
969 lines (969 loc) · 29.4 KB
/
Copy pathopenapi.json
File metadata and controls
969 lines (969 loc) · 29.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
{
"openapi": "3.1.0",
"info": {
"title": "nuanced-lsp",
"description": "",
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"version": "0.5.0"
},
"servers": [
{
"url": "http://localhost:4444/v1",
"description": "API server v1"
}
],
"paths": {
"/symbol/definitions-in-file": {
"get": {
"tags": [
"symbol"
],
"summary": "Get all symbol definitions in a file",
"operationId": "definitions_in_file",
"parameters": [
{
"name": "file_path",
"in": "query",
"description": "The path to the file to get the symbols for, relative to the root of the workspace.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Symbols retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Symbol"
}
}
}
}
},
"400": {
"description": "Bad request"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/symbol/find-definition": {
"post": {
"tags": [
"symbol"
],
"summary": "Get the definition of a symbol at a specific position in a file",
"operationId": "find_definition",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindDefinitionRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Definition retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindDefinitionResponse"
}
}
}
},
"400": {
"description": "Bad request"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/symbol/find-identifier": {
"post": {
"tags": [
"symbol"
],
"summary": "Find an identifier by name",
"operationId": "find_identifier",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindIdentifierRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Identifier found successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindIdentifierResponse"
}
}
}
},
"400": {
"description": "Bad request"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/symbol/find-referenced-symbols": {
"post": {
"tags": [
"symbol"
],
"summary": "Find all symbols referenced within a given symbol",
"operationId": "find_referenced_symbols",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindReferencedSymbolsRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Referenced symbols retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindReferencedSymbolsResponse"
}
}
}
},
"400": {
"description": "Bad request"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/symbol/find-references": {
"post": {
"tags": [
"symbol"
],
"summary": "Get all references to a symbol",
"operationId": "find_references",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindReferencesRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "References retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindReferencesResponse"
}
}
}
},
"400": {
"description": "Bad request"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/system/health": {
"get": {
"tags": [
"system"
],
"summary": "Get health status of the LSP proxy service",
"description": "Returns the service status, version and language server availability\nReturns 503 Service Unavailable while initialization is in progress",
"operationId": "health_check",
"responses": {
"200": {
"description": "Service is healthy and initialized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HealthResponse"
}
}
}
},
"500": {
"description": "Internal server error"
},
"503": {
"description": "Service is initializing",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HealthResponse"
}
}
}
}
}
}
},
"/workspace/list-files": {
"get": {
"tags": [
"file"
],
"summary": "List all files in the workspace",
"operationId": "list_files",
"responses": {
"200": {
"description": "Files listed successfully",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"500": {
"description": "Internal server error"
}
}
}
},
"/workspace/read-source-code": {
"post": {
"tags": [
"file"
],
"summary": "Read source code from a file",
"operationId": "read_source_code",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReadSourceCodeRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Source code retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReadSourceCodeResponse"
}
}
}
},
"400": {
"description": "Bad request"
},
"500": {
"description": "Internal server error"
}
}
}
}
},
"components": {
"schemas": {
"CodeContext": {
"type": "object",
"required": [
"range",
"source_code"
],
"properties": {
"range": {
"$ref": "#/components/schemas/FileRange"
},
"source_code": {
"type": "string"
}
}
},
"DefinitionsInFileRequest": {
"type": "object",
"description": "Request to get the symbols in a file.",
"required": [
"file_path"
],
"properties": {
"file_path": {
"type": "string",
"description": "The path to the file to get the symbols for, relative to the root of the workspace.",
"example": "src/main.py"
}
}
},
"ErrorResponse": {
"type": "object",
"description": "Response returned when an API error occurs",
"required": [
"error"
],
"properties": {
"error": {
"type": "string",
"description": "Description of the error that occurred"
}
}
},
"FilePosition": {
"type": "object",
"description": "A position within a specific file in the workspace",
"required": [
"path",
"position"
],
"properties": {
"path": {
"type": "string",
"description": "Path to the file, relative to the workspace root",
"example": "src/main.py"
},
"position": {
"$ref": "#/components/schemas/Position",
"description": "Position within the file"
}
}
},
"FileRange": {
"type": "object",
"description": "A range within a specific file, defined by start and end positions",
"required": [
"path",
"range"
],
"properties": {
"path": {
"type": "string",
"description": "The path to the file.",
"example": "src/main.py"
},
"range": {
"$ref": "#/components/schemas/Range",
"description": "The range within the file"
}
}
},
"FindDefinitionRequest": {
"type": "object",
"required": [
"position"
],
"properties": {
"include_raw_response": {
"type": "boolean",
"description": "Whether to include the raw response from the langserver in the response.\nDefaults to false.",
"example": false
},
"include_source_code": {
"type": "boolean",
"description": "Whether to include the source code around the symbol's identifier in the response.\nDefaults to false.\nTODO: Implement this",
"example": false
},
"position": {
"$ref": "#/components/schemas/FilePosition"
}
}
},
"FindDefinitionResponse": {
"type": "object",
"description": "Response to a definition request.\n\nThe definition(s) of the symbol.\nPoints to the start position of the symbol's identifier.\n\ne.g. for the definition of `User` on line 5 of `src/main.py` with the code:\n```text\n0: class User:\n_________^\n1: def __init__(self, name, age):\n2: self.name = name\n3: self.age = age\n4:\n5: user = User(\"John\", 30)\n__________^\n```\nThe definition(s) will be `[{\"path\": \"src/main.py\", \"line\": 0, \"character\": 6}]`.",
"required": [
"definitions",
"selected_identifier"
],
"properties": {
"definitions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FilePosition"
}
},
"raw_response": {
"description": "The raw response from the langserver.\n\nhttps://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_definition"
},
"selected_identifier": {
"$ref": "#/components/schemas/Identifier",
"description": "The identifier that was \"clicked-on\" to get the definition."
},
"source_code_context": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/components/schemas/CodeContext"
},
"description": "The source code of symbol definitions."
}
}
},
"FindIdentifierRequest": {
"type": "object",
"required": [
"name",
"path"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the identifier to search for.",
"example": "User"
},
"path": {
"type": "string",
"description": "The path to the file to search for identifiers.",
"example": "src/main.py"
},
"position": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/Position",
"description": "The position hint to search for identifiers. If not provided."
}
]
}
}
},
"FindIdentifierResponse": {
"type": "object",
"required": [
"identifiers"
],
"properties": {
"identifiers": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Identifier"
}
}
}
},
"FindReferencedSymbolsRequest": {
"type": "object",
"description": "Request to get all symbols that are referenced from a symbol at the given position, either\nfocusing on function calls, or more permissively finding all references\n\nThe input position must point to a symbol (e.g. function name, class name, variable name).\nThe response will include all symbols that are referenced from that input symbol.\nFor example, if the position points to a function name, the response will include\nall symbols referenced within that function's implementation.",
"required": [
"identifier_position"
],
"properties": {
"full_scan": {
"type": "boolean",
"description": "Whether to use the more permissive rules to find referenced symbols. This will be not just\ncode that is executed but also things like type hints and chained indirection.\nDefaults to false.",
"example": false
},
"identifier_position": {
"$ref": "#/components/schemas/FilePosition",
"description": "The identifier position of the symbol to find references within"
}
}
},
"FindReferencedSymbolsResponse": {
"type": "object",
"description": "Response containing symbols referenced from the requested position\n\nThe symbols are categorized into:\n- workspace_symbols: References to symbols that were found and have definitions in the workspace\n- external_symbols: References to symbols from outside the workspace (built-in functions, external libraries)\n- not_found: References where the symbol definition could not be found",
"required": [
"workspace_symbols",
"external_symbols",
"not_found"
],
"properties": {
"external_symbols": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Identifier"
}
},
"not_found": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Identifier"
}
},
"workspace_symbols": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ReferenceWithSymbolDefinitions"
}
}
}
},
"FindReferencesRequest": {
"type": "object",
"required": [
"identifier_position"
],
"properties": {
"identifier_position": {
"$ref": "#/components/schemas/FilePosition"
},
"include_code_context_lines": {
"type": [
"integer",
"null"
],
"format": "int32",
"description": "Whether to include the source code of the symbol in the response.\nDefaults to none.",
"example": 5,
"minimum": 0
},
"include_raw_response": {
"type": "boolean",
"description": "Whether to include the raw response from the langserver in the response.\nDefaults to false.",
"example": false
}
}
},
"FindReferencesResponse": {
"type": "object",
"description": "Response to a references request.\n\nPoints to the start position of the symbol's identifier.\n\ne.g. for the references of `User` on line 0 character 6 of `src/main.py` with the code:\n```text\n0: class User:\n1: def __init__(self, name, age):\n2: self.name = name\n3: self.age = age\n4:\n5: user = User(\"John\", 30)\n_________^\n6:\n7: print(user.name)\n```\nThe references will be `[{\"path\": \"src/main.py\", \"line\": 5, \"character\": 7}]`.",
"required": [
"references",
"selected_identifier"
],
"properties": {
"context": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/components/schemas/CodeContext"
},
"description": "The source code around the references."
},
"raw_response": {
"description": "The raw response from the langserver.\n\nhttps://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_references"
},
"references": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FilePosition"
}
},
"selected_identifier": {
"$ref": "#/components/schemas/Identifier",
"description": "The identifier that was \"clicked-on\" to get the references."
}
}
},
"HealthResponse": {
"type": "object",
"description": "Response returned by the health check endpoint",
"required": [
"status",
"version",
"languages"
],
"properties": {
"languages": {
"type": "object",
"description": "Map of supported languages and whether they are currently available (healthy)",
"additionalProperties": {
"type": "boolean"
},
"propertyNames": {
"oneOf": [
{
"type": "string",
"enum": [
"Python"
]
},
{
"type": "string",
"description": "TypeScript and JavaScript are handled by the same langserver",
"enum": [
"TypeScriptJavaScript"
]
},
{
"type": "string",
"enum": [
"Rust"
]
},
{
"type": "string",
"enum": [
"CPP"
]
},
{
"type": "string",
"enum": [
"CSharp"
]
},
{
"type": "string",
"enum": [
"Java"
]
},
{
"type": "string",
"enum": [
"Golang"
]
},
{
"type": "string",
"enum": [
"PHP"
]
},
{
"type": "object",
"description": "Ruby with version and optional Sorbet variant",
"required": [
"Ruby"
],
"properties": {
"Ruby": {
"type": "object",
"description": "Ruby with version and optional Sorbet variant",
"required": [
"version",
"variant"
],
"properties": {
"sorbet_config_dir": {
"type": [
"string",
"null"
],
"description": "For Sorbet variant: the directory containing sorbet/config (relative to workspace root)\nThis is used to pass --dir to Sorbet so it can find its config in nested projects\nThis field is runtime-only and not exposed in the API schema"
},
"variant": {
"$ref": "#/components/schemas/LanguageVariant"
},
"version": {
"$ref": "#/components/schemas/LanguageVersion"
}
}
}
}
}
],
"description": "Supported programming languages with optional version information\n\nThis enum represents languages that can be analyzed by the LSP proxy.\nLanguages with version detection (like Ruby) carry version information,\nwhile others use a single unversioned container."
}
},
"status": {
"type": "string",
"description": "Current status of the service (\"ok\" or error description)"
},
"version": {
"type": "string",
"description": "Version of the service"
}
}
},
"Identifier": {
"type": "object",
"required": [
"name",
"file_range"
],
"properties": {
"file_range": {
"$ref": "#/components/schemas/FileRange"
},
"kind": {
"type": [
"string",
"null"
]
},
"name": {
"type": "string"
}
}
},
"LanguageVariant": {
"type": "string",
"description": "Language variant for languages that have multiple type system modes\n\nSome languages support different type-checking modes that require different\nlanguage servers or configurations. This enum captures those variants.",
"enum": [
"standard",
"sorbet"
]
},
"LanguageVersion": {
"type": "string",
"description": "Language version string (e.g., \"3.4.4\" for Ruby, \"3.12\" for Python)\n\nThis represents the runtime/compiler version of a language, not the container image version.\nFor languages without version detection, this may be None."
},
"Position": {
"type": "object",
"description": "A position within a text document, using 0-based indexing",
"required": [
"line",
"character"
],
"properties": {
"character": {
"type": "integer",
"format": "int32",
"description": "0-indexed character index within the line.",
"example": 5,
"minimum": 0
},
"line": {
"type": "integer",
"format": "int32",
"description": "0-indexed line number.",
"example": 10,
"minimum": 0
}
}
},
"Range": {
"type": "object",
"required": [
"start",
"end"
],
"properties": {
"end": {
"$ref": "#/components/schemas/Position",
"description": "The end position of the range."
},
"start": {
"$ref": "#/components/schemas/Position",
"description": "The start position of the range."
}
}
},
"ReadSourceCodeRequest": {
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"type": "string",
"description": "Path to the file, relative to the workspace root",
"example": "src/main.py"
},
"range": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/Range",
"description": "Optional range within the file to read"
}
]
}
}
},
"ReadSourceCodeResponse": {
"type": "object",
"required": [
"source_code"
],
"properties": {
"source_code": {
"type": "string"
}
}
},
"ReferenceWithSymbolDefinitions": {
"type": "object",
"description": "A reference to a symbol along with its definition(s) found in the workspace\n\ne.g. for a reference to `User` in `main.py`:\n```python\nuser = User(\"John\", 30)\n_______^\n```\nThis would contain:\n- The reference location and name (\"User\" at line 0)\n- The symbol definition(s) (e.g. \"class User\" in models.py)",
"required": [
"reference",
"definitions"
],
"properties": {
"definitions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Symbol"
}
},
"reference": {
"$ref": "#/components/schemas/Identifier"
}
}
},
"SupportedLanguages": {
"oneOf": [
{
"type": "string",
"enum": [
"Python"
]
},
{
"type": "string",
"description": "TypeScript and JavaScript are handled by the same langserver",
"enum": [
"TypeScriptJavaScript"
]
},
{
"type": "string",
"enum": [
"Rust"
]
},
{
"type": "string",
"enum": [
"CPP"
]
},
{
"type": "string",
"enum": [
"CSharp"
]
},
{
"type": "string",
"enum": [
"Java"
]
},
{
"type": "string",
"enum": [
"Golang"
]
},
{
"type": "string",
"enum": [
"PHP"
]
},
{
"type": "object",
"description": "Ruby with version and optional Sorbet variant",
"required": [
"Ruby"
],
"properties": {
"Ruby": {
"type": "object",
"description": "Ruby with version and optional Sorbet variant",
"required": [
"version",
"variant"
],
"properties": {
"sorbet_config_dir": {
"type": [
"string",
"null"
],
"description": "For Sorbet variant: the directory containing sorbet/config (relative to workspace root)\nThis is used to pass --dir to Sorbet so it can find its config in nested projects\nThis field is runtime-only and not exposed in the API schema"
},
"variant": {
"$ref": "#/components/schemas/LanguageVariant"
},
"version": {
"$ref": "#/components/schemas/LanguageVersion"
}
}
}
}
}
],
"description": "Supported programming languages with optional version information\n\nThis enum represents languages that can be analyzed by the LSP proxy.\nLanguages with version detection (like Ruby) carry version information,\nwhile others use a single unversioned container."
},
"Symbol": {
"type": "object",
"required": [
"name",
"kind",
"identifier_position",
"file_range"
],
"properties": {
"file_range": {
"$ref": "#/components/schemas/FileRange",
"description": "The full range of the symbol."
},
"identifier_position": {
"$ref": "#/components/schemas/FilePosition",
"description": "The start position of the symbol's identifier."
},
"kind": {
"type": "string",
"description": "The kind of the symbol (e.g., function, class).",
"example": "class"
},
"name": {
"type": "string",
"description": "The name of the symbol.",
"example": "User"
}
}
}
},
"securitySchemes": {
"bearer_auth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
},
"security": [
{
"bearer_auth": []
}
],
"tags": [
{
"name": "nuanced-lsp-api",
"description": "Nuanced LSP API"
}
]
}