typesense-api-spec icon indicating copy to clipboard operation
typesense-api-spec copied to clipboard

Linting issues with openapi.yml spec

Open kianmeng opened this issue 1 year ago • 1 comments

Description

Steps to reproduce

$ cd /tmp
$ wget https://raw.githubusercontent.com/typesense/typesense-api-spec/master/openapi.yml
$ npx @redocly/cli lint openapi.yml

Expected Behavior

There should not be any errors or warnings.

Actual Behavior

No configurations were provided -- using built in recommended configuration by default.

validating openapi.yml...
[1] openapi.yml:1:1 at #/openapi

Servers must be present.

1 | openapi: 3.0.3
  | ^^^^^^^
2 | info:
3 |   title: Typesense API

Error was generated by the no-empty-servers rule.


[2] openapi.yml:2:1 at #/info

Info object should contain `license` field.

1 | openapi: 3.0.3
2 | info:
  | ^^^^
3 |   title: Typesense API
4 |   description: "An open source search engine for building delightful search experiences."

Warning was generated by the info-license rule.


[3] openapi.yml:61:7 at #/paths/~1collections/get/responses

Operation must have at least one `4XX` response.

59 |   first.
60 | operationId: getCollections
61 | responses:
   | ^^^^^^^^^
62 |   200:
63 |     description: List of all collections

Warning was generated by the operation-4xx-response rule.


[4] openapi.yml:408:7 at #/paths/~1collections~1{collectionName}~1overrides/get/responses

Operation must have at least one `4XX` response.

406 |     schema:
407 |       type: string
408 | responses:
    | ^^^^^^^^^
409 |   200:
410 |     description: List of all search overrides

Warning was generated by the operation-4xx-response rule.


[5] openapi.yml:436:7 at #/paths/~1collections~1{collectionName}~1overrides~1{overrideId}/get/responses

Operation must have at least one `4XX` response.

434 |     schema:
435 |       type: string
436 | responses:
    | ^^^^^^^^^
437 |   200:
438 |     description: Search override fetched

Warning was generated by the operation-4xx-response rule.


[6] openapi.yml:885:7 at #/paths/~1keys/get/responses

Operation must have at least one `4XX` response.

883 | summary: Retrieve (metadata about) all keys.
884 | operationId: getKeys
885 | responses:
    | ^^^^^^^^^
886 |   200:
887 |     description: List of all keys

Warning was generated by the operation-4xx-response rule.


[7] openapi.yml:997:7 at #/paths/~1aliases/get/responses

Operation must have at least one `4XX` response.

995 | description: List all aliases and the corresponding collections that they map to.
996 | operationId: getAliases
997 | responses:
    | ^^^^^^^^^
998 |   200:
999 |     description: List of all collection aliases

Warning was generated by the operation-4xx-response rule.


[8] openapi.yml:1106:7 at #/paths/~1debug/get/responses

Operation must have at least one `4XX` response.

1104 | description: Print debugging information
1105 | operationId: debug
1106 | responses:
     | ^^^^^^^^^
1107 |   200:
1108 |     description: Debugging information

Warning was generated by the operation-4xx-response rule.


[9] openapi.yml:1123:7 at #/paths/~1health/get/responses

Operation must have at least one `4XX` response.

1121 | description: Checks if Typesense server is ready to accept requests.
1122 | operationId: health
1123 | responses:
     | ^^^^^^^^^
1124 |   200:
1125 |     description: Search service is ready for requests.

Warning was generated by the operation-4xx-response rule.


[10] openapi.yml:1147:7 at #/paths/~1operations~1snapshot/post/responses

Operation must have at least one `4XX` response.

1145 |     schema:
1146 |       type: string
1147 | responses:
     | ^^^^^^^^^
1148 |   201:
1149 |     description: Snapshot is created.

Warning was generated by the operation-4xx-response rule.


[11] openapi.yml:1164:7 at #/paths/~1operations~1vote/post/responses

Operation must have at least one `4XX` response.

1162 |   once this command succeeds.
1163 | operationId: vote
1164 | responses:
     | ^^^^^^^^^
1165 |   200:
1166 |     description: Re-election is performed.

Warning was generated by the operation-4xx-response rule.


[12] openapi.yml:1239:7 at #/paths/~1analytics~1rules/get/responses

Operation must have at least one `4XX` response.

1237 |   Retrieve the details of all analytics rules
1238 | operationId: retrieveAnalyticsRules
1239 | responses:
     | ^^^^^^^^^
1240 |   200:
1241 |     description: Analytics rules fetched

Warning was generated by the operation-4xx-response rule.


[13] openapi.yml:1343:7 at #/paths/~1stopwords/get/responses

Operation must have at least one `4XX` response.

1341 |   Retrieve the details of all stopwords sets
1342 | operationId: retrieveStopwordsSets
1343 | responses:
     | ^^^^^^^^^
1344 |   200:
1345 |     description: Stopwords sets fetched.

Warning was generated by the operation-4xx-response rule.


[14] openapi.yml:1979:5 at #/components/schemas/ScopedKeyParameters

Component: "ScopedKeyParameters" is never used.

1977 |       items:
1978 |         $ref: "#/components/schemas/ApiKey"
1979 | ScopedKeyParameters:
     | ^^^^^^^^^^^^^^^^^^^
1980 |   type: object
1981 |   properties:

Warning was generated by the no-unused-components rule.


[15] openapi.yml:1987:5 at #/components/schemas/SnapshotParameters

Component: "SnapshotParameters" is never used.

1985 |       type: integer
1986 |       format: int64
1987 | SnapshotParameters:
     | ^^^^^^^^^^^^^^^^^^
1988 |   type: object
1989 |   properties:

Warning was generated by the no-unused-components rule.


[16] openapi.yml:1992:5 at #/components/schemas/ErrorResponse

Component: "ErrorResponse" is never used.

1990 |     snapshot_path:
1991 |       type: string
1992 | ErrorResponse:
     | ^^^^^^^^^^^^^
1993 |   type: object
1994 |   properties:

Warning was generated by the no-unused-components rule.


openapi.yml: validated in 93ms

❌ Validation failed with 1 error and 15 warnings.
run `redocly lint --generate-ignore-file` to add all problems to the ignore file.

Metadata

Typesense Version: 0.25.0

OS: Ubuntu 23.10


kianmeng avatar Apr 30 '24 17:04 kianmeng

related #84

jaeyson avatar Dec 15 '24 15:12 jaeyson