Skip to content

feat: add support for the QUERY HTTP method#1743

Merged
garrytrinder merged 4 commits into
dotnet:mainfrom
waldekmastykarz:waldekmastykarz-query-http-verb-support
Jul 4, 2026
Merged

feat: add support for the QUERY HTTP method#1743
garrytrinder merged 4 commits into
dotnet:mainfrom
waldekmastykarz:waldekmastykarz-query-http-verb-support

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Collaborator

Summary

Adds support for the QUERY HTTP method (IETF draft-ietf-httpbis-safe-method-w-body): a safe, idempotent method like GET but with a request body, exposed in .NET 10 as HttpMethod.Query.

Only the generic, API-agnostic plugins and their config schemas are extended. Graph-specific plugins are intentionally left unchanged because Microsoft Graph does not support QUERY.

Changes

Plugins

  • OpenApiSpecGeneratorPlugin — maps QUERYHttpMethod.Query so recorded QUERY traffic generates a valid spec instead of throwing NotSupportedException. Microsoft.OpenApi 3.7 serializes it as a query: path item field in OpenAPI 3.2 and x-oai-additionalOperations in 3.0/3.1.
  • OpenApiDocumentExtensions (used by all minimal-permissions plugins) — maps QUERY so permission checks match QUERY requests against query operations.
  • TypeSpecGeneratorPlugin — skips QUERY gracefully, since TypeSpec's @http library has no verb decorator for QUERY (previously Enum.Parse<HttpVerb> would crash generation).

Schemas

  • Bumps version to 3.2.0 and adds the schemas/v3.2.0/ folder (v3.1.0 is released and must not change).
  • Adds QUERY to the method enum in mockresponseplugin.mocksfile, mockrequestplugin.mockfile, genericrandomerrorplugin.errorsfile, and crudapiplugin.apifile.

Notes

  • Plugins that already treat the HTTP method as a pass-through string (GenericRandomErrorPlugin, MockResponsePlugin, CrudApiPlugin, HttpFileGeneratorPlugin, caching guidance, API Center plugins) need no code changes — their == "GET" body-skip logic correctly does not apply to QUERY, which has a body.
  • Installer/script files carry a -beta.1 suffix (version-upgrade default for the next beta).

Testing

  • dotnet build DevProxy.sln — 0 warnings, 0 errors.
  • Verified with Microsoft.OpenApi 3.7 that a QUERY operation round-trips (serialize + parse back to HttpMethod.Query) across OpenAPI 3.0/3.1/3.2.

Extend the generic, API-agnostic plugins and their config schemas to
support the QUERY HTTP method (safe, idempotent, with a request body).

- OpenApiSpecGeneratorPlugin/OpenApiDocumentExtensions: map QUERY to
  HttpMethod.Query so specs and minimal-permissions checks handle it
- TypeSpecGeneratorPlugin: skip QUERY (TypeSpec has no QUERY verb)
- Add QUERY to the method enums in the mock, error, and CRUD schemas
- Bump version to 3.2.0 and add the v3.2.0 schema folder (v3.1.0 is
  released and must not change)

Graph-specific plugins are intentionally left unchanged because
Microsoft Graph does not support the QUERY method.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 4, 2026 10:37
@waldekmastykarz waldekmastykarz requested a review from a team as a code owner July 4, 2026 10:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds end-to-end support for the experimental QUERY HTTP method in Dev Proxy’s generic plugins and config schemas, while also bumping the project/schema version to 3.2.0 and updating distributed config examples accordingly.

Changes:

  • Extend OpenAPI generation + minimal-permissions matching to recognize QUERY operations.
  • Update TypeSpec generation to skip QUERY requests (unsupported by TypeSpec @http verb decorators).
  • Add a new schemas/v3.2.0/ schema set (including QUERY in relevant method enums) and bump versions across scripts/installer/docker/config examples.

Reviewed changes

Copilot reviewed 60 out of 60 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/version.ps1 Bumps script version string to 3.2.0-beta.1.
scripts/local-setup.ps1 Bumps local setup version string to 3.2.0-beta.1.
scripts/Dockerfile_local Updates local Docker build arg to 3.2.0-beta.1.
schemas/v3.2.0/typespecgeneratorplugin.schema.json Adds v3.2.0 schema for TypeSpecGeneratorPlugin config.
schemas/v3.2.0/rewriteplugin.schema.json Adds v3.2.0 schema for RewritePlugin config.
schemas/v3.2.0/rewriteplugin.rewritesfile.schema.json Adds v3.2.0 schema for rewrite rules file.
schemas/v3.2.0/rc.schema.json Adds v3.2.0 schema for main devproxyrc config.
schemas/v3.2.0/ratelimitingplugin.schema.json Adds v3.2.0 schema for RateLimitingPlugin config.
schemas/v3.2.0/ratelimitingplugin.customresponsefile.schema.json Adds v3.2.0 schema for RateLimitingPlugin custom response file.
schemas/v3.2.0/openapispecgeneratorplugin.schema.json Adds v3.2.0 schema for OpenApiSpecGeneratorPlugin config.
schemas/v3.2.0/openaitelemetryplugin.schema.json Adds v3.2.0 schema for OpenAI telemetry plugin config.
schemas/v3.2.0/openaitelemetryplugin.pricesfile.schema.json Adds v3.2.0 schema for OpenAI telemetry prices file.
schemas/v3.2.0/mockstdioresponseplugin.schema.json Adds v3.2.0 schema for MockStdioResponsePlugin config.
schemas/v3.2.0/mockstdioresponseplugin.mocksfile.schema.json Adds v3.2.0 schema for MockStdioResponsePlugin mocks file.
schemas/v3.2.0/mockresponseplugin.schema.json Adds v3.2.0 schema for MockResponsePlugin config.
schemas/v3.2.0/mockresponseplugin.mocksfile.schema.json Adds v3.2.0 schema for MockResponsePlugin mocks file (includes QUERY in method enum).
schemas/v3.2.0/mockrequestplugin.schema.json Adds v3.2.0 schema for MockRequestPlugin config.
schemas/v3.2.0/mockrequestplugin.mockfile.schema.json Adds v3.2.0 schema for MockRequestPlugin mock file (includes QUERY in method enum).
schemas/v3.2.0/minimalpermissionsplugin.schema.json Adds v3.2.0 schema for MinimalPermissionsPlugin config.
schemas/v3.2.0/minimalpermissionsguidanceplugin.schema.json Adds v3.2.0 schema for MinimalPermissionsGuidancePlugin config.
schemas/v3.2.0/minimalcsompermissionsplugin.schema.json Adds v3.2.0 schema for MinimalCsomPermissionsPlugin config.
schemas/v3.2.0/minimalcsompermissions.types.schema.json Adds v3.2.0 schema for SharePoint CSOM types/permissions file.
schemas/v3.2.0/latencyplugin.schema.json Adds v3.2.0 schema for LatencyPlugin config.
schemas/v3.2.0/languagemodelratelimitingplugin.schema.json Adds v3.2.0 schema for LanguageModelRateLimitingPlugin config.
schemas/v3.2.0/languagemodelratelimitingplugin.customresponsefile.schema.json Adds v3.2.0 schema for LM rate limit custom response file.
schemas/v3.2.0/languagemodelfailureplugin.schema.json Adds v3.2.0 schema for LanguageModelFailurePlugin config.
schemas/v3.2.0/httpfilegeneratorplugin.schema.json Adds v3.2.0 schema for HttpFileGeneratorPlugin config.
schemas/v3.2.0/hargeneratorplugin.schema.json Adds v3.2.0 schema for HarGeneratorPlugin config.
schemas/v3.2.0/graphrandomerrorplugin.schema.json Adds v3.2.0 schema for GraphRandomErrorPlugin config.
schemas/v3.2.0/graphminimalpermissionsplugin.schema.json Adds v3.2.0 schema for GraphMinimalPermissionsPlugin config.
schemas/v3.2.0/graphminimalpermissionsguidanceplugin.schema.json Adds v3.2.0 schema for GraphMinimalPermissionsGuidancePlugin config.
schemas/v3.2.0/genericrandomerrorplugin.schema.json Adds v3.2.0 schema for GenericRandomErrorPlugin config.
schemas/v3.2.0/genericrandomerrorplugin.errorsfile.schema.json Adds v3.2.0 schema for GenericRandomErrorPlugin errors file (includes QUERY in method enum).
schemas/v3.2.0/executionsummaryplugin.schema.json Adds v3.2.0 schema for ExecutionSummaryPlugin config.
schemas/v3.2.0/devtoolsplugin.schema.json Adds v3.2.0 schema for DevToolsPlugin config.
schemas/v3.2.0/crudapiplugin.schema.json Adds v3.2.0 schema for CrudApiPlugin config.
schemas/v3.2.0/crudapiplugin.apifile.schema.json Adds v3.2.0 schema for CRUD API file (includes QUERY in method enum).
schemas/v3.2.0/cachingguidanceplugin.schema.json Adds v3.2.0 schema for CachingGuidancePlugin config.
schemas/v3.2.0/authplugin.schema.json Adds v3.2.0 schema for AuthPlugin config.
schemas/v3.2.0/apicenterproductionversionplugin.schema.json Adds v3.2.0 schema for ApiCenterProductionVersionPlugin config.
schemas/v3.2.0/apicenteronboardingplugin.schema.json Adds v3.2.0 schema for ApiCenterOnboardingPlugin config.
schemas/v3.2.0/apicenterminimalpermissionsplugin.schema.json Adds v3.2.0 schema for ApiCenterMinimalPermissionsPlugin config.
install.iss Bumps stable Windows installer version to 3.2.0.
install-beta.iss Bumps beta Windows installer version to 3.2.0-beta.1.
Dockerfile_beta Bumps docker build arg to 3.2.0.
Dockerfile Bumps docker build arg to 3.2.0.
DevProxy/devproxyrc.json Updates example config $schema links to v3.2.0.
DevProxy/DevProxy.csproj Bumps DevProxy package version to 3.2.0.
DevProxy/devproxy-errors.json Updates example errors file $schema link to v3.2.0.
DevProxy/config/spo-csom-types.json Updates example CSOM types $schema link to v3.2.0.
DevProxy/config/microsoft-graph.json Updates example config $schema links to v3.2.0.
DevProxy/config/microsoft-graph-rate-limiting.json Updates example config $schema link to v3.2.0.
DevProxy/config/m365.json Updates example config $schema links to v3.2.0.
DevProxy/config/m365-mocks.json Updates example mocks $schema link to v3.2.0.
DevProxy.Plugins/Mocking/MockResponsePlugin.cs Updates default schema URL for mocks file to v3.2.0.
DevProxy.Plugins/Generation/TypeSpecGeneratorPlugin.cs Skips QUERY requests during TypeSpec generation.
DevProxy.Plugins/Generation/OpenApiSpecGeneratorPlugin.cs Maps QUERY to OpenAPI method representation for spec generation.
DevProxy.Plugins/Extensions/OpenApiDocumentExtensions.cs Maps QUERY so minimal-permissions matching can locate query operations.
DevProxy.Plugins/DevProxy.Plugins.csproj Bumps DevProxy.Plugins package version to 3.2.0.
DevProxy.Abstractions/DevProxy.Abstractions.csproj Bumps DevProxy.Abstractions package version to 3.2.0.

Comment thread schemas/v3.2.0/openapispecgeneratorplugin.schema.json
waldekmastykarz and others added 2 commits July 4, 2026 12:43
The consumer lock files still recorded the old transitive versions for
the devproxy.abstractions project reference, breaking restore in
--locked-mode (NU1004). Regenerated with --force-evaluate.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…hema

The plugin's SpecVersion enum supports v3_1 and v3_2, but the schema
only allowed v2_0 and v3_0, so those valid values failed schema
validation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@garrytrinder garrytrinder merged commit 8c6d247 into dotnet:main Jul 4, 2026
4 checks passed
@waldekmastykarz waldekmastykarz deleted the waldekmastykarz-query-http-verb-support branch July 4, 2026 11:38
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.

3 participants