diff --git a/openapi_spec/parameters.yml b/openapi_spec/parameters.yml index ae77ae2257..226ccfb473 100644 --- a/openapi_spec/parameters.yml +++ b/openapi_spec/parameters.yml @@ -5,8 +5,8 @@ AppId: required: true schema: type: string - pattern: "^(?:beta|testing)?[A-Z0-9]{10}$" - example: "DJNVGS47DK" + pattern: '^(?:beta|testing)?[A-Z0-9]{10}$' + example: 'DJNVGS47DK' ApiKey: name: X-Algolia-API-Key in: header @@ -14,8 +14,8 @@ ApiKey: required: true schema: type: string - pattern: "^[a-f0-9]{32}$" - example: "43b15df305339e827f0ac0bdc5ebcaa7" + pattern: '^[a-f0-9]{32}$' + example: '43b15df305339e827f0ac0bdc5ebcaa7' IndexName: name: indexName in: path @@ -23,4 +23,4 @@ IndexName: required: true schema: type: string - example: "myIndexName" + example: 'myIndexName' diff --git a/openapi_spec/paths/indexes/batch.yml b/openapi_spec/paths/indexes/batch.yml index e37aafe8dc..c0854784d9 100644 --- a/openapi_spec/paths/indexes/batch.yml +++ b/openapi_spec/paths/indexes/batch.yml @@ -1,12 +1,12 @@ post: tags: - - object + - search operationId: batch summary: Performs multiple write operations in a single API call parameters: - - $ref: "../../parameters.yml#/AppId" - - $ref: "../../parameters.yml#/ApiKey" - - $ref: "../../parameters.yml#/IndexName" + - $ref: '../../parameters.yml#/AppId' + - $ref: '../../parameters.yml#/ApiKey' + - $ref: '../../parameters.yml#/IndexName' requestBody: required: true content: @@ -24,13 +24,13 @@ post: action: type: string enum: - - "addObject" - - "updateObject" - - "partialUpdateObject" - - "partialUpdateObjectNoCreate" - - "deleteObject" - - "delete" - - "clear" + - 'addObject' + - 'updateObject' + - 'partialUpdateObject' + - 'partialUpdateObjectNoCreate' + - 'deleteObject' + - 'delete' + - 'clear' description: type of operation body: type: object @@ -38,7 +38,7 @@ post: additionalProperties: true description: arguments to the operation (depends on the type of the operation) responses: - "200": + '200': description: OK content: application/json: @@ -52,7 +52,7 @@ post: type: array items: type: string - "400": - $ref: "../../responses/BadRequest.yml" - "404": - $ref: "../../responses/IndexNotFound.yml" + '400': + $ref: '../../responses/BadRequest.yml' + '404': + $ref: '../../responses/IndexNotFound.yml' diff --git a/openapi_spec/paths/indexes/searchMulti.yml b/openapi_spec/paths/indexes/multipleQueries.yml similarity index 87% rename from openapi_spec/paths/indexes/searchMulti.yml rename to openapi_spec/paths/indexes/multipleQueries.yml index ac5a3ba0cc..1dd7675d06 100644 --- a/openapi_spec/paths/indexes/searchMulti.yml +++ b/openapi_spec/paths/indexes/multipleQueries.yml @@ -1,11 +1,11 @@ post: tags: - search - operationId: searchMulti + operationId: multipleQueries summary: Get search results for the given requests. parameters: - - $ref: "../../parameters.yml#/AppId" - - $ref: "../../parameters.yml#/ApiKey" + - $ref: '../../parameters.yml#/AppId' + - $ref: '../../parameters.yml#/ApiKey' requestBody: required: true content: @@ -43,11 +43,11 @@ post: - indexName strategy: type: string - enum: ["none", "stopIfEnoughMatches"] + enum: ['none', 'stopIfEnoughMatches'] required: - requests responses: - "200": + '200': description: OK content: application/json: @@ -75,9 +75,9 @@ post: type: integer queryID: type: string - pattern: "[a-f0-9]{32}" + pattern: '[a-f0-9]{32}' example: 43b15df305339e827f0ac0bdc5ebcaa7 - "400": - $ref: "../../responses/BadRequest.yml" - "404": - $ref: "../../responses/IndexNotFound.yml" + '400': + $ref: '../../responses/BadRequest.yml' + '404': + $ref: '../../responses/IndexNotFound.yml' diff --git a/openapi_spec/paths/indexes/saveObject.yml b/openapi_spec/paths/indexes/saveObject.yml index d4b95cff9e..8942065cec 100644 --- a/openapi_spec/paths/indexes/saveObject.yml +++ b/openapi_spec/paths/indexes/saveObject.yml @@ -5,9 +5,9 @@ post: summary: Save object description: Add an object to the index, automatically assigning it an object ID parameters: - - $ref: "../../parameters.yml#/AppId" - - $ref: "../../parameters.yml#/ApiKey" - - $ref: "../../parameters.yml#/IndexName" + - $ref: '../../parameters.yml#/AppId' + - $ref: '../../parameters.yml#/ApiKey' + - $ref: '../../parameters.yml#/IndexName' requestBody: required: true content: @@ -16,7 +16,7 @@ post: type: object additionalProperties: true responses: - "200": + '200': description: OK content: application/json: @@ -30,7 +30,7 @@ post: type: integer objectID: type: string - "400": - $ref: "../../responses/BadRequest.yml" - "404": - $ref: "../../responses/IndexNotFound.yml" + '400': + $ref: '../../responses/BadRequest.yml' + '404': + $ref: '../../responses/IndexNotFound.yml' diff --git a/openapi_spec/paths/indexes/search.yml b/openapi_spec/paths/indexes/search.yml index 3d43ecb717..ee44d8af4f 100644 --- a/openapi_spec/paths/indexes/search.yml +++ b/openapi_spec/paths/indexes/search.yml @@ -4,13 +4,13 @@ post: operationId: search summary: Get search results parameters: - - $ref: "../../parameters.yml#/AppId" - - $ref: "../../parameters.yml#/ApiKey" - - $ref: "../../parameters.yml#/IndexName" + - $ref: '../../parameters.yml#/AppId' + - $ref: '../../parameters.yml#/ApiKey' + - $ref: '../../parameters.yml#/IndexName' requestBody: - $ref: "../../schemas/SearchParams.yml" + $ref: '../../schemas/SearchParams.yml' responses: - "200": + '200': description: OK content: application/json: @@ -32,9 +32,9 @@ post: type: integer queryID: type: string - pattern: "[a-f0-9]{32}" + pattern: '[a-f0-9]{32}' example: 43b15df305339e827f0ac0bdc5ebcaa7 - "400": - $ref: "../../responses/BadRequest.yml" - "404": - $ref: "../../responses/IndexNotFound.yml" + '400': + $ref: '../../responses/BadRequest.yml' + '404': + $ref: '../../responses/IndexNotFound.yml' diff --git a/openapi_spec/responses/BadRequest.yml b/openapi_spec/responses/BadRequest.yml index 112fbe73f5..b811bc1e78 100644 --- a/openapi_spec/responses/BadRequest.yml +++ b/openapi_spec/responses/BadRequest.yml @@ -2,4 +2,4 @@ description: Bad request or request arguments content: application/json: schema: - $ref: "../schemas/Error.yml" + $ref: '../schemas/Error.yml' diff --git a/openapi_spec/responses/IndexNotFound.yml b/openapi_spec/responses/IndexNotFound.yml index 0ac5e0980f..73fd650f77 100644 --- a/openapi_spec/responses/IndexNotFound.yml +++ b/openapi_spec/responses/IndexNotFound.yml @@ -2,4 +2,4 @@ description: Index not found content: application/json: schema: - $ref: "../schemas/Error.yml" + $ref: '../schemas/Error.yml' diff --git a/openapi_spec/schemas/Error.yml b/openapi_spec/schemas/Error.yml index 214c152880..4f2ed33d16 100644 --- a/openapi_spec/schemas/Error.yml +++ b/openapi_spec/schemas/Error.yml @@ -4,4 +4,4 @@ additionalProperties: true properties: message: type: string - example: "Invalid application id" + example: 'Invalid application id' diff --git a/openapi_spec/schemas/SearchParams.yml b/openapi_spec/schemas/SearchParams.yml index e45a88ed52..4dfa2cd345 100644 --- a/openapi_spec/schemas/SearchParams.yml +++ b/openapi_spec/schemas/SearchParams.yml @@ -4,11 +4,11 @@ properties: query: type: string description: The text to search in the index. - default: "" + default: '' similarQuery: type: string - description: Overrides the query parameter and performs a more generic search that can be used to find “similar” results. - default: "" + description: Overrides the query parameter and performs a more generic search that can be used to find "similar" results. + default: '' searchableAttributes: type: array items: @@ -32,7 +32,7 @@ properties: items: type: string description: This parameter controls which attributes to retrieve and which not to retrieve. - default: ["*"] + default: ['*'] restrictSearchableAttributes: type: array items: @@ -45,14 +45,14 @@ properties: type: string description: Controls how Algolia should sort your results. default: - - "typo" - - "geo" - - "words" - - "filters" - - "proximity" - - "attribute" - - "exact" - - "custom" + - 'typo' + - 'geo' + - 'words' + - 'filters' + - 'proximity' + - 'attribute' + - 'exact' + - 'custom' customRanking: type: array items: @@ -72,7 +72,7 @@ properties: filters: type: string description: Filter the query with numeric, facet and/or tag filters. - default: "" + default: '' # There could be a pattern for this one (complicated one) facetFilters: type: array @@ -119,7 +119,7 @@ properties: sortFacetValuesBy: type: string description: Controls how facet values are fetched. - default: "count" + default: 'count' attributesToHighlight: type: array items: @@ -134,15 +134,15 @@ properties: highlightPreTag: type: string description: The HTML string to insert before the highlighted parts in all highlight and snippet results. - default: "" + default: '' highlightPostTag: type: string description: The HTML string to insert after the highlighted parts in all highlight and snippet results. - default: "" + default: '' snippetEllipsisText: type: string description: String used as an ellipsis indicator when a snippet is truncated. - default: "…" + default: '…' restrictHighlightAndSnippetArrays: type: boolean description: Restrict highlighting and snippeting to items that matched the query. @@ -177,7 +177,7 @@ properties: default: 8 typoTolerance: type: string - enum: [true, false, "min", "strict"] + enum: [true, false, 'min', 'strict'] description: Controls whether typo tolerance is enabled and how it is applied. default: true allowTyposOnNumericTokens: @@ -199,7 +199,7 @@ properties: separatorsToIndex: type: string description: Control which separators are indexed. - default: "" + default: '' aroundLatLng: type: string description: Search for entries around a central geolocation, enabling a geo search within a circular area. @@ -259,7 +259,7 @@ properties: keepDiacriticsOnCharacters: type: string description: List of characters that the engine shouldn’t automatically normalize. - default: "" + default: '' customNormalization: type: object additionalProperties: true @@ -314,14 +314,14 @@ properties: description: Associates a certain user token with the current search. queryType: type: string - enum: ["prefixLast", "prefixAll", "prefixNone"] + enum: ['prefixLast', 'prefixAll', 'prefixNone'] description: Controls if and how query words are interpreted as prefixes. - default: "prefixLast" + default: 'prefixLast' removeWordsIfNoResults: type: string - enum: ["none", "lastWords", "firstWords", "allOptional"] + enum: ['none', 'lastWords', 'firstWords', 'allOptional'] description: Selects a strategy to remove words from the query when it doesn’t match any hits. - default: "none" + default: 'none' advancedSyntax: type: boolean description: Enables the advanced query syntax. @@ -346,23 +346,23 @@ properties: default: [] exactOnSingleWordQuery: type: string - enum: ["attribute", "none", "word"] + enum: ['attribute', 'none', 'word'] description: Controls how the exact ranking criterion is computed when the query contains only one word. - default: "attribute" + default: 'attribute' alternativesAsExact: type: array items: type: string - enum: ["ignorePlurals", "singleWordSynonym", "multiWordsSynonym"] + enum: ['ignorePlurals', 'singleWordSynonym', 'multiWordsSynonym'] description: List of alternatives that should be considered an exact match by the exact ranking criterion. - default: ["ignorePlurals", "singleWordSynonym"] + default: ['ignorePlurals', 'singleWordSynonym'] advancedSyntaxFeatures: type: array items: type: string - enum: ["exactPhrase", "excludeWords"] + enum: ['exactPhrase', 'excludeWords'] description: Allows you to specify which advanced syntax features are active when ‘advancedSyntax’ is enabled. - default: ["exactPhrase", "excludeWords"] + default: ['exactPhrase', 'excludeWords'] numericAttributesForFiltering: type: array items: diff --git a/openapi_spec/spec.yml b/openapi_spec/spec.yml index dd38e0ac78..c6ac21cebd 100644 --- a/openapi_spec/spec.yml +++ b/openapi_spec/spec.yml @@ -25,8 +25,8 @@ paths: # /1/indexes/{indexName}/query: # $ref: "./paths/indexes/search.yml" /1/indexes/*/queries: - $ref: "./paths/indexes/searchMulti.yml" + $ref: './paths/indexes/multipleQueries.yml' /1/indexes/{indexName}: - $ref: "./paths/indexes/saveObject.yml" + $ref: './paths/indexes/saveObject.yml' /1/indexes/{indexName}/batch: - $ref: "./paths/indexes/batch.yml" + $ref: './paths/indexes/batch.yml' diff --git a/openapitools.json b/openapitools.json index 57e1cc283a..fb51cbe923 100644 --- a/openapitools.json +++ b/openapitools.json @@ -9,10 +9,9 @@ "config": "#{cwd}/openapitools.json", "enablePostProcessFile": true, "httpUserAgent": "Algolia for JavaScript ({packageVersion});", - "apiPackage": "client-search", "output": "#{cwd}/output/", - "glob": "search_spec.yml", + "glob": "openapi_spec/spec.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-javascript",