Skip to content

EndpointGen: Support adding custom imports and custom types #3867

@kf-envrs

Description

@kf-envrs

Is your feature request related to a problem? Please describe.
When generating models and endpoints from openAPI, usually each endpoint specification has multiple http errors (400, 401, 403, 500 usually). Also quite often applications have their own business errors and then one would need to map to those API errors models.

Describe the solution you'd like
I would like to have ability to specify my custom error types in generated code along with custom imports for those models. That way I would be able to still use my internal business errors, but having all benefits of generated models and endpoints.

Describe alternatives you've considered
Solution would be to either create map function or using API models directly. None of those is ideal solution.

Additional context
Other libraries such as guardrail is already capable of working in that way and it works really well. It would be really good, if ZIO gen could have such functionality as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions