-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(specs): add validate endpoint (#3087)
Co-authored-by: shortcuts <vannicattec@gmail.com>
- Loading branch information
Showing
6 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
post: | ||
tags: | ||
- sources | ||
summary: Validates a source payload | ||
description: | | ||
Validates a source payload to ensure it can be created and that the data source can be reached by Algolia. | ||
operationId: validateSource | ||
x-acl: | ||
- addObject | ||
- deleteIndex | ||
- editSettings | ||
requestBody: | ||
description: '' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../common/schemas/source.yml#/SourceCreate' | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../common/schemas/source.yml#/SourceValidateResponse' | ||
'400': | ||
$ref: '../../../common/responses/BadRequest.yml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
post: | ||
tags: | ||
- sources | ||
summary: Validates an update of a source payload | ||
description: | | ||
Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia. | ||
operationId: validateSourceBeforeUpdate | ||
x-acl: | ||
- addObject | ||
- deleteIndex | ||
- editSettings | ||
parameters: | ||
- $ref: '../../common/parameters.yml#/pathSourceID' | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../common/schemas/source.yml#/SourceUpdate' | ||
required: true | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../common/schemas/source.yml#/SourceValidateResponse' | ||
'400': | ||
$ref: '../../../common/responses/BadRequest.yml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[ | ||
{ | ||
"testName": "validateSource", | ||
"parameters": { | ||
"type": "commercetools", | ||
"name": "sourceName", | ||
"input": { | ||
"storeKeys": [ | ||
"myStore" | ||
], | ||
"locales": [ | ||
"de" | ||
], | ||
"url": "http://commercetools.com", | ||
"projectKey": "keyID" | ||
}, | ||
"authenticationID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f" | ||
}, | ||
"request": { | ||
"path": "/1/sources/validate", | ||
"method": "POST", | ||
"body": { | ||
"type": "commercetools", | ||
"name": "sourceName", | ||
"input": { | ||
"storeKeys": [ | ||
"myStore" | ||
], | ||
"locales": [ | ||
"de" | ||
], | ||
"url": "http://commercetools.com", | ||
"projectKey": "keyID" | ||
}, | ||
"authenticationID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f" | ||
} | ||
} | ||
} | ||
] |
18 changes: 18 additions & 0 deletions
18
tests/CTS/requests/ingestion/validateSourceBeforeUpdate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ | ||
"testName": "validateSourceBeforeUpdate", | ||
"parameters": { | ||
"sourceID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f", | ||
"sourceUpdate": { | ||
"name": "newName" | ||
} | ||
}, | ||
"request": { | ||
"path": "/1/sources/6c02aeb1-775e-418e-870b-1faccd4b2c0f/validate", | ||
"method": "POST", | ||
"body": { | ||
"name": "newName" | ||
} | ||
} | ||
} | ||
] |
c91ca54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://api-clients-automation.netlify.app as production
🚀 Deployed on https://66732554235f9b77aea5c1cb--api-clients-automation.netlify.app