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

Set setResolveCombinators to false when parsing OpenAPI/Swagger definition #12726

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ashanhr
Copy link
Contributor

@ashanhr ashanhr commented Dec 17, 2024

Purpose

  • This PR fixes the issue of incorrect request validation when schemas are defined as composed schemas (allOf, anyOf, and oneOf). In the current code, the setResolveCombinators option is not set to false during parsing, which introduces this issue.
  • By default, the setResolveCombinators option is true during parsing, which transforms composed schemas into "non-composed" ones by merging all properties into a single resulting schema. Because of this, requests are not validated as intended when schemas are defined as composed schemas.
  • Resolves: [APIM 4.1.0] Issue with Request Validation Using oneOf and anyOf in API definition. api-manager#3409

Approach

  • The setResolveCombinators option is explicitly set to false.
  • Additionally, the setResolve option is explicitly set to true. Although this is implicitly enabled with the setResolveFully option, setting it explicitly is considered a best practice.

…ition (swagger string) into an OpenAPI object using the parsing option setResolveFully
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APIM 4.1.0] Issue with Request Validation Using oneOf and anyOf in API definition.
2 participants