Skip to content

Fix content vs schema#1464

Open
kain88-de wants to merge 2 commits into
openapi-generators:mainfrom
kain88-de:fix-content-vs-schema
Open

Fix content vs schema#1464
kain88-de wants to merge 2 commits into
openapi-generators:mainfrom
kain88-de:fix-content-vs-schema

fix: cover content-only parameters in 3.1 snapshots

314e652
Select commit
Loading
Failed to load commit list.
Knope Bot / Require changes to be documented required action Jul 17, 2026

This pull request has not been documented yet

This project requires changes to be documented via either changesets or conventional commits. Depending on how this pull request is merged, it may not be fully documented:

  • ❌ Squash merging is allowed, but the title is not a conventional commit
  • ✅ Merge commits are disabled
  • ✅ Rebase merging is disabled

To satisfy this check, you can:

Details

---
default: CHANGE_TYPE
---

# Fix content vs schema

#1464 by @kain88-de

## Summary

Fix parameter parsing to support OpenAPI parameters defined with `content` instead of `schema`.

OpenAPI 3.1 allows a Parameter Object to include either `schema` or `content`, but not both:
https://spec.openapis.org/oas/v3.1.0.html#parameter-object

Before this change, `content`-only parameters were dropped during parsing because only `param_schema` was considered. That caused:
- path parameters to fail later with an incorrect path templating warning
- query parameters to disappear from generated endpoint signatures

## Changes

- fall back to `content.<media-type>.schema` when `schema` is missing
- add a parser regression test for `content`-only parameters
- add a functional happy-path generated-code test
- add 3.1 snapshot coverage for a `content`-only path parameter