Skip to content

Commit

Permalink
fix(spec): apply eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Apr 8, 2022
1 parent 9d77035 commit 4cebae8
Show file tree
Hide file tree
Showing 119 changed files with 922 additions and 839 deletions.
10 changes: 5 additions & 5 deletions specs/abtesting/common/schemas/ABTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ABTest:
additionalProperties: false
properties:
abTestID:
$ref: ../parameters.yml#/abTestID
$ref: '../parameters.yml#/abTestID'
clickSignificance:
type: number
format: double
Expand All @@ -19,16 +19,16 @@ ABTest:
format: double
description: A/B test significance based on conversion data. Should be > 0.95 to be considered significant (no matter which variant is winning).
endAt:
$ref: ../parameters.yml#/endAt
$ref: '../parameters.yml#/endAt'
createdAt:
$ref: ../parameters.yml#/createdAt
$ref: '../parameters.yml#/createdAt'
name:
$ref: ../parameters.yml#/name
$ref: '../parameters.yml#/name'
status:
type: string
description: status of the A/B test.
variants:
$ref: Variant.yml#/variants
$ref: 'Variant.yml#/variants'
required:
- status
- name
Expand Down
6 changes: 3 additions & 3 deletions specs/abtesting/common/schemas/ABTestResponse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ ABTestResponse:
additionalProperties: false
properties:
index:
$ref: ../parameters.yml#/index
$ref: '../parameters.yml#/index'
abTestID:
$ref: ../parameters.yml#/abTestID
$ref: '../parameters.yml#/abTestID'
taskID:
$ref: ../../../common/parameters.yml#/taskID
$ref: '../../../common/parameters.yml#/taskID'
required:
- abTestID
- index
Expand Down
6 changes: 3 additions & 3 deletions specs/abtesting/common/schemas/AddABTestsVariant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ abTestsVariant:
additionalProperties: false
properties:
index:
$ref: ../parameters.yml#/index
$ref: '../parameters.yml#/index'
trafficPercentage:
$ref: ../parameters.yml#/trafficPercentage
$ref: '../parameters.yml#/trafficPercentage'
description:
$ref: ../parameters.yml#/description
$ref: '../parameters.yml#/description'
required:
- index
- trafficPercentage
Expand Down
10 changes: 5 additions & 5 deletions specs/abtesting/common/schemas/Variant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ variant:
format: double
description: Conversion rate for the variant.
description:
$ref: ../parameters.yml#/description
$ref: '../parameters.yml#/description'
index:
$ref: ../parameters.yml#/index
$ref: '../parameters.yml#/index'
noResultCount:
$ref: ../../../common/parameters.yml#/count
$ref: '../../../common/parameters.yml#/count'
searchCount:
type: integer
description: The number of search during the A/B test.
trackedSearchCount:
$ref: ../../../common/parameters.yml#/trackedSearchCount
$ref: '../../../common/parameters.yml#/trackedSearchCount'
trafficPercentage:
$ref: ../parameters.yml#/trafficPercentage
$ref: '../parameters.yml#/trafficPercentage'
userCount:
type: integer
description: The number of user during the A/B test.
Expand Down
24 changes: 12 additions & 12 deletions specs/abtesting/paths/abtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,41 @@ get:
Behaves in the same way as GET /2/abtests however the endpoint will return 403.
summary: Returns metadata and metrics for A/B test id.
parameters:
- $ref: ../common/parameters.yml#/ID
- $ref: '../common/parameters.yml#/ID'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../common/schemas/ABTest.yml#/ABTest
$ref: '../common/schemas/ABTest.yml#/ABTest'
'400':
$ref: ../../common/responses/BadRequest.yml
$ref: '../../common/responses/BadRequest.yml'
'402':
$ref: ../../common/responses/FeatureNotEnabled.yml
$ref: '../../common/responses/FeatureNotEnabled.yml'
'403':
$ref: ../../common/responses/MethodNotAllowed.yml
$ref: '../../common/responses/MethodNotAllowed.yml'
'404':
$ref: ../../common/responses/IndexNotFound.yml
$ref: '../../common/responses/IndexNotFound.yml'

delete:
operationId: deleteABTest
description: Deletes the A/B Test and removes all associated metadata & metrics.
summary: Deletes the A/B Test.
parameters:
- $ref: ../common/parameters.yml#/ID
- $ref: '../common/parameters.yml#/ID'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../common/schemas/ABTestResponse.yml#/ABTestResponse
$ref: '../common/schemas/ABTestResponse.yml#/ABTestResponse'
'400':
$ref: ../../common/responses/BadRequest.yml
$ref: '../../common/responses/BadRequest.yml'
'402':
$ref: ../../common/responses/FeatureNotEnabled.yml
$ref: '../../common/responses/FeatureNotEnabled.yml'
'403':
$ref: ../../common/responses/MethodNotAllowed.yml
$ref: '../../common/responses/MethodNotAllowed.yml'
'404':
$ref: ../../common/responses/IndexNotFound.yml
$ref: '../../common/responses/IndexNotFound.yml'
30 changes: 15 additions & 15 deletions specs/abtesting/paths/abtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ post:
additionalProperties: false
properties:
name:
$ref: ../common/parameters.yml#/name
$ref: '../common/parameters.yml#/name'
variant:
type: array
description: List of 2 variants for the A/B test.
minItems: 2
maxItems: 2
items:
$ref: ../common/schemas/AddABTestsVariant.yml#/AddABTestsVariant
$ref: '../common/schemas/AddABTestsVariant.yml#/AddABTestsVariant'
endAt:
$ref: ../common/parameters.yml#/endAt
$ref: '../common/parameters.yml#/endAt'
required:
- name
- variant
Expand All @@ -35,24 +35,24 @@ post:
content:
application/json:
schema:
$ref: ../common/schemas/ABTestResponse.yml#/ABTestResponse
$ref: '../common/schemas/ABTestResponse.yml#/ABTestResponse'
'400':
$ref: ../../common/responses/BadRequest.yml
$ref: '../../common/responses/BadRequest.yml'
'402':
$ref: ../../common/responses/FeatureNotEnabled.yml
$ref: '../../common/responses/FeatureNotEnabled.yml'
'403':
$ref: ../../common/responses/MethodNotAllowed.yml
$ref: '../../common/responses/MethodNotAllowed.yml'
'404':
$ref: ../../common/responses/IndexNotFound.yml
$ref: '../../common/responses/IndexNotFound.yml'

get:
operationId: listABTests
description: >
Fetch all existing A/B tests for App that are available for the current API Key. Returns an array of metadata and metrics. When no data has been processed, the metrics will be returned as null.
summary: Fetch all existing A/B tests for App that are available for the current API Key.
parameters:
- $ref: ../../common/parameters.yml#/Offset
- $ref: ../../common/parameters.yml#/Limit
- $ref: '../../common/parameters.yml#/Offset'
- $ref: '../../common/parameters.yml#/Limit'
responses:
'200':
description: OK
Expand All @@ -64,7 +64,7 @@ get:
additionalProperties: false
properties:
abtests:
$ref: ../common/schemas/ABTest.yml#/ABTests
$ref: '../common/schemas/ABTest.yml#/ABTests'
count:
type: integer
description: Number of A/B tests found for the app.
Expand All @@ -76,10 +76,10 @@ get:
- count
- total
'400':
$ref: ../../common/responses/BadRequest.yml
$ref: '../../common/responses/BadRequest.yml'
'402':
$ref: ../../common/responses/FeatureNotEnabled.yml
$ref: '../../common/responses/FeatureNotEnabled.yml'
'403':
$ref: ../../common/responses/MethodNotAllowed.yml
$ref: '../../common/responses/MethodNotAllowed.yml'
'404':
$ref: ../../common/responses/IndexNotFound.yml
$ref: '../../common/responses/IndexNotFound.yml'
12 changes: 6 additions & 6 deletions specs/abtesting/paths/stopABTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ post:
Associated metadata and metrics are still stored.
summary: Marks the A/B test as stopped.
parameters:
- $ref: ../common/parameters.yml#/ID
- $ref: '../common/parameters.yml#/ID'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../common/schemas/ABTestResponse.yml#/ABTestResponse
$ref: '../common/schemas/ABTestResponse.yml#/ABTestResponse'
'400':
$ref: ../../common/responses/BadRequest.yml
$ref: '../../common/responses/BadRequest.yml'
'402':
$ref: ../../common/responses/FeatureNotEnabled.yml
$ref: '../../common/responses/FeatureNotEnabled.yml'
'403':
$ref: ../../common/responses/MethodNotAllowed.yml
$ref: '../../common/responses/MethodNotAllowed.yml'
'404':
$ref: ../../common/responses/IndexNotFound.yml
$ref: '../../common/responses/IndexNotFound.yml'
12 changes: 6 additions & 6 deletions specs/abtesting/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ info:
components:
securitySchemes:
appId:
$ref: ../common/securitySchemes.yml#/appId
$ref: '../common/securitySchemes.yml#/appId'
apiKey:
$ref: ../common/securitySchemes.yml#/apiKey
$ref: '../common/securitySchemes.yml#/apiKey'
servers:
- url: https://analytics.{region}.algolia.com
variables:
Expand All @@ -29,11 +29,11 @@ paths:
# ### Custom request ###
# ######################
/1{path}:
$ref: ../common/paths/customRequest.yml
$ref: '../common/paths/customRequest.yml'

/2/abtests:
$ref: paths/abtests.yml
$ref: 'paths/abtests.yml'
/2/abtests/{id}:
$ref: paths/abtest.yml
$ref: 'paths/abtest.yml'
/2/abtests/{id}/stop:
$ref: paths/stopABTest.yml
$ref: 'paths/stopABTest.yml'
20 changes: 14 additions & 6 deletions specs/analytics/common/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,26 @@ OrderBy:
name: orderBy
description: Reorder the results.
schema:
type: string
enum: [searchCount, clickThroughRate, conversionRate, averageClickPosition]
default: searchCount
$ref: '#/orderBy'

# private
orderBy:
type: string
enum: [searchCount, clickThroughRate, conversionRate, averageClickPosition]
default: searchCount

Direction:
in: query
name: direction
description: The sorting of the result.
schema:
type: string
enum: [asc, desc]
default: asc
$ref: '#/direction'

# private
direction:
type: string
enum: [asc, desc]
default: asc

ClickAnalytics:
in: query
Expand Down
4 changes: 2 additions & 2 deletions specs/analytics/common/schemas/getTopFilterAttributes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ getTopFilterAttribute:
- count
properties:
attribute:
$ref: ../parameters.yml#/attribute
$ref: '../parameters.yml#/attribute'
count:
$ref: ../../../common/parameters.yml#/count
$ref: '../../../common/parameters.yml#/count'
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ getTopFilterForAttribute:
value:
$ref: '../parameters.yml#/value'
count:
$ref: ../../../common/parameters.yml#/count
$ref: '../../../common/parameters.yml#/count'
2 changes: 1 addition & 1 deletion specs/analytics/common/schemas/getTopFiltersNoResults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ getTopFiltersNoResultsValues:
- count
properties:
count:
$ref: ../../../common/parameters.yml#/count
$ref: '../../../common/parameters.yml#/count'
values:
type: array
description: A list of filters without results.
Expand Down
6 changes: 3 additions & 3 deletions specs/analytics/common/schemas/getTopHits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ topHitsResponse:
hit:
$ref: '../parameters.yml#/hit'
count:
$ref: ../../../common/parameters.yml#/count
$ref: '../../../common/parameters.yml#/count'

topHitsResponseWithAnalytics:
type: object
Expand All @@ -43,13 +43,13 @@ topHitsResponseWithAnalytics:
hit:
$ref: '../parameters.yml#/hit'
count:
$ref: ../../../common/parameters.yml#/count
$ref: '../../../common/parameters.yml#/count'
clickThroughRate:
$ref: '../parameters.yml#/rate'
conversionRate:
$ref: '../parameters.yml#/conversionRate'
trackedSearchCount:
$ref: ../../../common/parameters.yml#/trackedSearchCount
$ref: '../../../common/parameters.yml#/trackedSearchCount'
clickCount:
$ref: '../parameters.yml#/clickCount'
conversionCount:
Expand Down
12 changes: 6 additions & 6 deletions specs/analytics/common/schemas/getTopSearches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ topSearchesResponse:
- nbHits
properties:
search:
$ref: ../parameters.yml#/search
$ref: '../parameters.yml#/search'
count:
$ref: ../../../common/parameters.yml#/count
$ref: '../../../common/parameters.yml#/count'
nbHits:
$ref: ../../../search/common/schemas/SearchResponse.yml#/nbHits
$ref: '../../../search/common/schemas/SearchResponse.yml#/nbHits'

topSearchesResponseWithAnalytics:
type: object
Expand Down Expand Up @@ -48,21 +48,21 @@ topSearchesResponseWithAnalytics:
search:
$ref: '../parameters.yml#/search'
count:
$ref: ../../../common/parameters.yml#/count
$ref: '../../../common/parameters.yml#/count'
clickThroughRate:
$ref: '../parameters.yml#/rate'
averageClickPosition:
$ref: '../parameters.yml#/averageClickPosition'
conversionRate:
$ref: '../parameters.yml#/conversionRate'
trackedSearchCount:
$ref: ../../../common/parameters.yml#/trackedSearchCount
$ref: '../../../common/parameters.yml#/trackedSearchCount'
clickCount:
$ref: '../parameters.yml#/clickCount'
conversionCount:
$ref: '../parameters.yml#/conversionCount'
nbHits:
$ref: ../../../search/common/schemas/SearchResponse.yml#/nbHits
$ref: '../../../search/common/schemas/SearchResponse.yml#/nbHits'

getTopSearchesResponse:
oneOf:
Expand Down
Loading

0 comments on commit 4cebae8

Please sign in to comment.