Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OAS] Fix handling of schema.nullable to path and query params #197046

Merged

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Oct 21, 2024

Summary

Fixes handling of schema.nullable(schema.object({..})) to params and query inputs. Example in the wild.

Checklist

@jloleysens jloleysens added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Feature:OAS Work or issues related to Core-provided mechanisms for generating OAS backport:version Backport to applied version labels v8.17.0 labels Oct 21, 2024
@jloleysens jloleysens self-assigned this Oct 21, 2024
@jloleysens
Copy link
Contributor Author

/ci

@jloleysens jloleysens marked this pull request as ready for review October 22, 2024 12:09
@jloleysens jloleysens requested a review from a team as a code owner October 22, 2024 12:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@@ -88,12 +88,17 @@ const convertObjectMembersToParameterObjects = (
knownParameters: KnownParameters = {},
isPathParameter = false
) => {
let properties: Exclude<OpenAPIV3.SchemaObject['properties'], undefined>;
let properties: undefined | Exclude<OpenAPIV3.SchemaObject['properties'], undefined>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT can't properties be simply:

let properties: OpenAPIV3.SchemaObject['properties'];

@jloleysens jloleysens enabled auto-merge (squash) October 25, 2024 09:27
Copy link
Contributor

@gsoldevila gsoldevila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jloleysens jloleysens merged commit d3569f6 into elastic:main Oct 25, 2024
22 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11517110862

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #91 / Rule execution logic API Detection Engine - Execution logic @ess @serverless Indicator match type rules, alert suppression Code execution path: events count is smaller than threats count should suppress an alert on real rule executions

Metrics [docs]

✅ unchanged

History

cc @jloleysens

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 25, 2024
…stic#197046)

## Summary

Fixes handling of `schema.nullable(schema.object({..}))` to params and
query inputs. [Example in the
wild](https://github.com/jloleysens/kibana/blob/83e76cb4d854a3c3f9ffdaad8c6ee29d66d56710/x-pack/plugins/reporting/server/routes/common/generate/request_handler.ts#L33).

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit d3569f6)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 25, 2024
…uery params (#197046) (#197801)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[OAS] Fix handling of &#x60;schema.nullable&#x60; to path and query
params (#197046)](#197046)

<!--- Backport version: 9.4.3 -->

### 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-10-25T11:11:14Z","message":"[OAS]
Fix handling of `schema.nullable` to path and query params
(#197046)\n\n## Summary\r\n\r\nFixes handling of
`schema.nullable(schema.object({..}))` to params and\r\nquery inputs.
[Example in
the\r\nwild](https://github.com/jloleysens/kibana/blob/83e76cb4d854a3c3f9ffdaad8c6ee29d66d56710/x-pack/plugins/reporting/server/routes/common/generate/request_handler.ts#L33).\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"d3569f609acd3a6f1f012bbf684d5bea9e3f1424","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","v9.0.0","Feature:OAS","backport:version","v8.17.0"],"title":"[OAS]
Fix handling of `schema.nullable` to path and query
params","number":197046,"url":"https://github.com/elastic/kibana/pull/197046","mergeCommit":{"message":"[OAS]
Fix handling of `schema.nullable` to path and query params
(#197046)\n\n## Summary\r\n\r\nFixes handling of
`schema.nullable(schema.object({..}))` to params and\r\nquery inputs.
[Example in
the\r\nwild](https://github.com/jloleysens/kibana/blob/83e76cb4d854a3c3f9ffdaad8c6ee29d66d56710/x-pack/plugins/reporting/server/routes/common/generate/request_handler.ts#L33).\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"d3569f609acd3a6f1f012bbf684d5bea9e3f1424"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197046","number":197046,"mergeCommit":{"message":"[OAS]
Fix handling of `schema.nullable` to path and query params
(#197046)\n\n## Summary\r\n\r\nFixes handling of
`schema.nullable(schema.object({..}))` to params and\r\nquery inputs.
[Example in
the\r\nwild](https://github.com/jloleysens/kibana/blob/83e76cb4d854a3c3f9ffdaad8c6ee29d66d56710/x-pack/plugins/reporting/server/routes/common/generate/request_handler.ts#L33).\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"d3569f609acd3a6f1f012bbf684d5bea9e3f1424"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:OAS Work or issues related to Core-provided mechanisms for generating OAS release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants