Skip to content

[--group-strategy=tag-file] not working for simple weather forecast .NET app #327

@jaider

Description

@jaider

Describe the bug
When using openapi-zod-client with the --group-strategy=tag-file option, expected model generation fails, specifically omitting WeatherForecastGetModel in the output file.
I am working in a .NET environment, generating an OpenAPI specification from a minimal API using the default Weather Forecast sample. I have modified the API by adjusting lowercase formatting, renaming models, and adding tags. Despite these changes, the issue persists, preventing proper model generation.

weatherForecast.json

Minimal reproduction

  1. In a .NET minimal API project, generate an OpenAPI specification from the default Weather Forecast sample.
  2. Modify the API by changing the casing of model names, using different model names, and adding tags.
  3. Run the following command:
    openapi-zod-client http://localhost:[PORT]/openapi/v1.json -o ./src/api-generated --group-strategy=tag-file --export-schemas=true
  4. Check the generated output file WeatherForecastGetModel is missing.

Image

Expected behavior
The tag-file option should correctly group and generate files based on tags while still ensuring all relevant models/types—including.

Additional context
Without using --group-strategy=tag-file, openapi-zod-client generates all code properly in a single file, including all expected types. However, when using --group-strategy=tag-file, the expected behavior of separating files based on tags does not work correctly, and WeatherForecastGetModel is missing from the output.

WeatherForecast.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions