Spring: support OpenAPI 3.2 `query` operations (HTTP QUERY, RFC 10008)
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in SpringFrameworkAnnotations.kt at MAPPING_ANNOTATIONS and compare the existing HEAD/OPTIONS/TRACE entries with the RequestMethod.QUERY mapping proposed in the issue; note the lookup also runs during import collection, which is why exclude: true still fails. Add the entry, then run the processor's unit tests for the Spring annotations and regenerate a sample spec containing a query operation to confirm the @RequestMapping(method = RequestMethod.QUERY) output. Done means a query spec processes successfully and unknown custom methods fail with a clear message instead of a NoSuchElementException.
Written by the indexing model from the issue text.
Description
Description
openapi-processor-base 2025.6 added parser support for OpenAPI 3.2 query and custom
http methods (openapi-processor-base#313). However, openapi-processor-spring fails as soon
as the spec contains a query operation, because SpringFrameworkAnnotations has no
mapping annotation for HttpMethod.QUERY.
Spring Framework 7.1 (Spring Boot 4.2) now supports QUERY natively via
RequestMethod.QUERY / HttpMethod.QUERY, so the generated interface could use
@RequestMapping(method = RequestMethod.QUERY).
Versions
- openapi-processor-spring: 2026.3.2 (latest release)
- openapi-processor gradle plugin: 2026.2
- Gradle 9.7.1, Java 25
Steps to reproduce
openapi/openapi.yaml:
openapi: 3.2.0
info:
title: query sample
version: 1.0.0
paths:
/products:
query:
operationId: queryProducts
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ProductSearchCriteria'
responses:
'200':
description: matching products
content:
application/json:
schema:
type: array
items:
type: string
components:
schemas:
ProductSearchCriteria:
type: object
properties:
keyword:
type: string
openapi/mapping.yaml:
openapi-processor-mapping: v17
options:
package-name: com.example.api
Run ./gradlew processSpring.
Actual result
processing failed!
java.util.NoSuchElementException: Key QUERY is missing in the map.
at io.openapiprocessor.spring.processor.SpringFrameworkAnnotations.getAnnotation(SpringFrameworkAnnotations.kt:32)
at io.openapiprocessor.core.writer.java.InterfaceWriter.collectImports(InterfaceWriter.kt:59)
at io.openapiprocessor.core.writer.java.InterfaceWriter.write(InterfaceWriter.kt:33)
at io.openapiprocessor.core.writer.java.ApiWriter.writeInterface(ApiWriter.kt:114)
...
Excluding the endpoint in mapping.yaml gives the same error:
map:
paths:
/products:
query:
exclude: true
Changing only query: to post: in the same spec generates code successfully:
@PostMapping(path = "/products", consumes = {"application/json"}, produces = {"application/json"})
String[] queryProducts(@RequestBody ProductSearchCriteria body);
As a result, a spec that contains any query operation cannot be processed at all.
Expected result
Something like the following, analogous to how HEAD/OPTIONS/TRACE are generated today:
@RequestMapping(path = "/products", method = RequestMethod.QUERY, consumes = {"application/json"}, produces = {"application/json"})
String[] queryProducts(@RequestBody ProductSearchCriteria body);
Possible fix
Add an entry to MAPPING_ANNOTATIONS in SpringFrameworkAnnotations.kt:
HttpMethod.QUERY to Annotation(getMappingAnnotationName("request"), linkedMapOf(
"method" to SimpleParameterValue("RequestMethod.QUERY", ANNOTATION_REQUEST_METHOD))
),
Notes:
RequestMethod.QUERYexists only in Spring Framework 7.1+. Generated code for a spec
withqueryoperations would therefore require Spring 7.1. This seems acceptable, since
such a spec cannot be implemented on older Spring versions anyway, but it may be worth
documenting.- Custom methods from
additionalOperations(e.g.COPY) cannot be expressed with Spring's
RequestMethodenum. A clear error message (or skipping them with a warning) would be
better than aNoSuchElementException. - Spring 7.1 does not (yet) provide a
@QueryMappingshortcut annotation, so
@RequestMapping(method = RequestMethod.QUERY)is the way to declare it.
I verified on Spring Boot 4.2.0 with embedded Tomcat 11 that a hand-written controller
using @RequestMapping(method = RequestMethod.QUERY) works, including JSON and form-urlencoded
request bodies. The generated interface should work the same way.
- Dominant language
- Kotlin
- Stars
- 56
- Forks
- 11
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openapi-processor/openapi-processor-spring
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
openapi-processor/openapi-processor-spring#334 · 2 comments ·
Maintainers usually reply within 2 days
-
Inheritance supportOpen
Difficulty 5/5 Over a week Newbie friendliness 20/100
openapi-processor/openapi-processor-spring#159 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 42/100
openapi-processor/openapi-processor-spring#150 · 3 comments ·
Maintainers usually reply within 2 days
-
undecided
Difficulty 5/5 Over a week Newbie friendliness 25/100
openapi-processor/openapi-processor-spring#101 · 1 comment ·
Maintainers usually reply within 2 days
-
log unknown optionsOpenenhancement undecided
Difficulty 3/5 1-2 days Newbie friendliness 35/100
openapi-processor/openapi-processor-spring#51 ·
Maintainers usually reply within 2 days
All issues in openapi-processor/openapi-processor-spring
Similar issues
-
help wanted needs investigation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
LeanBitLab/LeanType#883 ·
Maintainers usually reply within 1 day
-
Heavy legs 1.12–1.17: compiler corpus goldens not regenerated for #4770Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
intellij-elixir/intellij-elixir#4782 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
komikku-app/komikku#1983 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Seb3thehacker/gearslip#121 ·