Skip to content

test(oas3): add regression tests for oneOf/anyOf parameter explode behavior#10823

Open
maruthang wants to merge 1 commit intoswagger-api:masterfrom
maruthang:fix/issue-10002-oneof-param-explode
Open

test(oas3): add regression tests for oneOf/anyOf parameter explode behavior#10823
maruthang wants to merge 1 commit intoswagger-api:masterfrom
maruthang:fix/issue-10002-oneof-param-explode

Conversation

@maruthang
Copy link
Copy Markdown

Description

Added regression tests verifying that query parameters with oneOf/anyOf schemas correctly generate object default values when using style:form/explode:true. The underlying bug was already fixed by the composeJsonSchema method in parameter-row.jsx and the swagger-client 3.37.1 upgrade. These tests prevent future regressions.

Motivation and Context

Closes #10002

Query parameters with oneOf schemas and style:form/explode:true were not being properly exploded — the parameter value was not generated correctly when the schema used composition keywords. The bug is now fixed in the current codebase; this PR adds test coverage to prevent future regressions.

How Has This Been Tested?

3 new unit tests in test/unit/bugs/10002-oneof-param-explode.jsx:

  • oneOf object parameter generates correct default value
  • anyOf object parameter generates correct default value
  • oneOf parameter with resolved $ref ($$ref marker) generates correct default value

All tests pass locally with npm run test:unit.

Screenshots (if appropriate)

N/A — test-only change, no UI modifications.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My change requires no change to documentation
  • I have added tests to cover my changes
  • All new and existing tests pass
  • I have updated the documentation accordingly (N/A)

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.

GET parameters not exploded when "in": "query","style": "form","explode": true and the request can be oneOf a few different objects

1 participant