-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.15] [OAS/HTTP] Empty response bodies (status only) and description…
…s for responses (#188632) (#190545) # Backport This will backport the following commits from `main` to `8.15`: - [[OAS/HTTP] Empty response bodies (status only) and descriptions for responses (#188632)](#188632) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jean-Louis Leysens","email":"jeanlouis.leysens@elastic.co"},"sourceCommit":{"committedDate":"2024-07-22T13:29:15Z","message":"[OAS/HTTP] Empty response bodies (status only) and descriptions for responses (#188632)\n\n## Summary\r\n\r\n* Adds the ability to exclude a response schema when declaring route\r\nschemas\r\n* Adds the ability to provide a description of a the response\r\n\r\nSee code comments for more info.\r\n\r\n## Example\r\n\r\nYou can declare a response with no validation to imply an empty object\r\nin OAS\r\n\r\n```\r\nrouter.versioned.post({ version: '2023-10-31', access: 'public', path: '...' })\r\n .addVersion({\r\n validation: {\r\n responses: {\r\n 201: { description: 'Resource created!' }\r\n }\r\n }\r\n }, () => {})\r\n```\r\n\r\nWill result in\r\n\r\n```jsonc\r\n{\r\n //...\r\n 201: { description: 'Resource created!' }\r\n //...\r\n}\r\n```\r\n\r\n## Risks\r\n\r\nNo notable risks","sha":"a8091ab0acff6f8fae2cbe19c273048fb2734632","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:http","Team:Core","release_note:skip","backport:skip","v8.15.0","Feature:OAS","v8.16.0"],"number":188632,"url":"https://github.com/elastic/kibana/pull/188632","mergeCommit":{"message":"[OAS/HTTP] Empty response bodies (status only) and descriptions for responses (#188632)\n\n## Summary\r\n\r\n* Adds the ability to exclude a response schema when declaring route\r\nschemas\r\n* Adds the ability to provide a description of a the response\r\n\r\nSee code comments for more info.\r\n\r\n## Example\r\n\r\nYou can declare a response with no validation to imply an empty object\r\nin OAS\r\n\r\n```\r\nrouter.versioned.post({ version: '2023-10-31', access: 'public', path: '...' })\r\n .addVersion({\r\n validation: {\r\n responses: {\r\n 201: { description: 'Resource created!' }\r\n }\r\n }\r\n }, () => {})\r\n```\r\n\r\nWill result in\r\n\r\n```jsonc\r\n{\r\n //...\r\n 201: { description: 'Resource created!' }\r\n //...\r\n}\r\n```\r\n\r\n## Risks\r\n\r\nNo notable risks","sha":"a8091ab0acff6f8fae2cbe19c273048fb2734632"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188632","number":188632,"mergeCommit":{"message":"[OAS/HTTP] Empty response bodies (status only) and descriptions for responses (#188632)\n\n## Summary\r\n\r\n* Adds the ability to exclude a response schema when declaring route\r\nschemas\r\n* Adds the ability to provide a description of a the response\r\n\r\nSee code comments for more info.\r\n\r\n## Example\r\n\r\nYou can declare a response with no validation to imply an empty object\r\nin OAS\r\n\r\n```\r\nrouter.versioned.post({ version: '2023-10-31', access: 'public', path: '...' })\r\n .addVersion({\r\n validation: {\r\n responses: {\r\n 201: { description: 'Resource created!' }\r\n }\r\n }\r\n }, () => {})\r\n```\r\n\r\nWill result in\r\n\r\n```jsonc\r\n{\r\n //...\r\n 201: { description: 'Resource created!' }\r\n //...\r\n}\r\n```\r\n\r\n## Risks\r\n\r\nNo notable risks","sha":"a8091ab0acff6f8fae2cbe19c273048fb2734632"}}]}] BACKPORT--> Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co>
- Loading branch information
1 parent
3a053eb
commit 0b285e6
Showing
22 changed files
with
792 additions
and
109 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
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
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
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
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
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
Oops, something went wrong.