Skip to content

feat: support the querystring parameter location and query operation - #14

Open
AdamFiser wants to merge 1 commit into
contributte:masterfrom
AdamFiser:feat/openapi-3.2-query
Open

feat: support the querystring parameter location and query operation#14
AdamFiser wants to merge 1 commit into
contributte:masterfrom
AdamFiser:feat/openapi-3.2-query

Conversation

@AdamFiser

@AdamFiser AdamFiser commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

OpenAPI 3.2.0 added two constructs this library actively mishandles:

Parameter::fromArray(['name' => 'query', 'in' => 'querystring', ...])
=> InvalidArgumentException: Invalid value "querystring" for attribute "in" given.

PathItem::fromArray(['get' => [...], 'query' => [...]])->toArray()
=> {"get":{...}}          // the query operation vanished without a word
  • in: querystring treats the whole query string as a single value. It was rejected because the location was not in Parameter::INS.
  • The query operation was dropped: setOperation() returns early for methods outside its allow list.

Adds Parameter::IN_QUERYSTRING and PathItem::OPERATION_QUERY. Documents that do not use them are unaffected.

A querystring parameter describes itself with content rather than schema, which #13 made possible.

Tests: ParameterTest::testQuerystringLocation and a new PathItemTest; the existing testInvalidIn message now lists the new location.

OpenAPI 3.2.0 added two constructs this library actively mishandled.

A parameter with in: querystring, which treats the whole query string as one
value, threw InvalidArgumentException because the location was not in the
allowed list. Such a parameter must describe itself with content, which the
previous commit made possible.

A path item with a query operation lost it silently: setOperation() returns
early for methods outside its allow list, so the operation vanished from
toArray() without a word.

Both are now known: Parameter::IN_QUERYSTRING and PathItem::OPERATION_QUERY.
@AdamFiser
AdamFiser force-pushed the feat/openapi-3.2-query branch from fb81d28 to 0c0e344 Compare August 3, 2026 04:13
@AdamFiser

Copy link
Copy Markdown
Contributor Author

Rebased onto current master now that #13 is merged - the duplicated commit is gone and the conflict is resolved. The diff is down to what this pull request is actually about: Parameter::IN_QUERYSTRING, PathItem::OPERATION_QUERY and their tests.

vendor/bin/tester tests -C and vendor/bin/phpstan analyse are both green on the rebased branch.

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.

1 participant