Skip to content

Conversation

Foorack
Copy link

@Foorack Foorack commented Jul 1, 2025

Fixes #1324

When I add an enum only in the header, it gets referenced in the yaml output, but there is no corresponding schema in the yaml schema definitions. When I additionally add the enum to a body, it appears in the schema definitions and works as expected.

@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 12:35
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for including component schemas for path parameters (such as header enums) in generated OpenAPI docs and provides a test that validates an enum-only header parameter is added to components.schemas.

  • Implements get_component_schemas on Parameter to extract schema references
  • Integrates parameter schemas into the SchemaReferences implementation in path.rs
  • Adds a test (derive_enum_header_parameter_includes_schema) reproducing #1324 and verifying the enum header appears in components.schemas

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/path_parameter_derive_test.rs New test ensuring header-only enum parameters generate schemas
src/path/parameter.rs New get_component_schemas method and iterator for parameters
src/path.rs Wire up parameter schemas in SchemaReferences generation

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.

Enum in header is not transmitted to schemas

1 participant