Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions scripts/specs/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,22 @@ export async function bundleSpecsForDoc(bundledPath: string, clientName: string)

// skip custom path for cURL
if (pathKey !== '/{path}' && specMethod['x-codeSamples']) {
const harRequest = harRequests.find((baseHarRequest) =>
baseHarRequest.url.includes(pathKey.replace('{indexName}', 'ALGOLIA_INDEX_NAME')),
);
const harRequest = harRequests.find((baseHarRequest) => {
// the url also has the query parameters, so we need to check if it ends with the path
// all the variables are also replaced by the example in the spec, so we need to check with a regex.
const urlRegex = new RegExp(
`${pathKey
.replace('{indexName}', 'ALGOLIA_INDEX_NAME')
.replace('*', '\\*')
.replace(/\{.*?\}/g, '.*?')}($|\\?)`,
);
return (
baseHarRequest.url.match(urlRegex) !== null && baseHarRequest.method.toLowerCase() === method.toLowerCase()
);
});
if (!harRequest) {
throw new Error(`Could not find a the correct HAR request for ${method} ${pathKey}`);
}

if (!harRequest?.headers) {
break;
Expand Down
2 changes: 1 addition & 1 deletion specs/composition-full/paths/search/search.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
post:
tags:
- search
- Search
operationId: search
x-use-read-transporter: true
x-cacheable: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
post:
tags:
- search
- Search
operationId: searchForFacetValues
x-use-read-transporter: true
x-cacheable: true
Expand Down
11 changes: 4 additions & 7 deletions specs/composition/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,18 @@ security:
- appId: []
apiKey: []
tags:
- name: compositions
x-displayName: Compositions
- name: Compositions
description: |
Manage your compositions and composition settings.
- name: rules
x-displayName: Rules
- name: Rules
description: |
Manage your compositions rules.
- name: search
x-displayName: Search
- name: Search
description: Search one composition for matching records or facet values.
x-tagGroups:
- name: Compositions
tags:
- search
- Search
paths:
# ########################
# ### Search Endpoints ###
Expand Down
2 changes: 1 addition & 1 deletion specs/query-suggestions/common/schemas/IndexName.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: indexName
type: string
description: Name of the Query Suggestions index (case-sensitive).
example: products_query_suggestions
example: ALGOLIA_INDEX_NAME
Loading