Skip to content

Commit

Permalink
use simple quote and change tags
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Nov 9, 2021
1 parent 47fc15d commit cb2e499
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 87 deletions.
10 changes: 5 additions & 5 deletions openapi_spec/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ 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
description: Algolia API key
required: true
schema:
type: string
pattern: "^[a-f0-9]{32}$"
example: "43b15df305339e827f0ac0bdc5ebcaa7"
pattern: '^[a-f0-9]{32}$'
example: '43b15df305339e827f0ac0bdc5ebcaa7'
IndexName:
name: indexName
in: path
description: The index in which to perform the request
required: true
schema:
type: string
example: "myIndexName"
example: 'myIndexName'
32 changes: 16 additions & 16 deletions openapi_spec/paths/indexes/batch.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -24,21 +24,21 @@ 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
# this could be a long oneOf with every possibilities
additionalProperties: true
description: arguments to the operation (depends on the type of the operation)
responses:
"200":
'200':
description: OK
content:
application/json:
Expand All @@ -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'
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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'
16 changes: 8 additions & 8 deletions openapi_spec/paths/indexes/saveObject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -16,7 +16,7 @@ post:
type: object
additionalProperties: true
responses:
"200":
'200':
description: OK
content:
application/json:
Expand All @@ -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'
20 changes: 10 additions & 10 deletions openapi_spec/paths/indexes/search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'
2 changes: 1 addition & 1 deletion openapi_spec/responses/BadRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ description: Bad request or request arguments
content:
application/json:
schema:
$ref: "../schemas/Error.yml"
$ref: '../schemas/Error.yml'
2 changes: 1 addition & 1 deletion openapi_spec/responses/IndexNotFound.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ description: Index not found
content:
application/json:
schema:
$ref: "../schemas/Error.yml"
$ref: '../schemas/Error.yml'
2 changes: 1 addition & 1 deletion openapi_spec/schemas/Error.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ additionalProperties: true
properties:
message:
type: string
example: "Invalid application id"
example: 'Invalid application id'
60 changes: 30 additions & 30 deletions openapi_spec/schemas/SearchParams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -119,7 +119,7 @@ properties:
sortFacetValuesBy:
type: string
description: Controls how facet values are fetched.
default: "count"
default: 'count'
attributesToHighlight:
type: array
items:
Expand All @@ -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: "<em>"
default: '<em>'
highlightPostTag:
type: string
description: The HTML string to insert after the highlighted parts in all highlight and snippet results.
default: "</em>"
default: '</em>'
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.
Expand Down Expand Up @@ -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:
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions openapi_spec/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Loading

0 comments on commit cb2e499

Please sign in to comment.