zitadel-rust
zitadel-rust copied to clipboard
Add Support for Error Struct with `JsonSchema` Implementation
The question is whether it’s better to create a dedicated error struct that implements JsonSchema or if we can add this functionality to an existing struct with a feature flag, such as a rocket_okapi feature. The goal is to simplify the maintenance of OpenAPI documentation.
Currently, without this, manual specifications need to be updated each time, which can become cumbersome.
Questions:
- Should we create a new error struct that implements
JsonSchemafor better OpenAPI support, or is it feasible to extend an existing struct by adding a feature (e.g., viarocket_okapi)? - Would adding this feature make it significantly easier to maintain OpenAPI documentation, particularly for custom error responses?
- How can we ensure this approach is scalable, especially in projects with multiple custom error types?
Suggestions:
- Explore the possibility of adding a
rocket_okapifeature flag that enables easier OpenAPI documentation maintenance by integrating error structs withJsonSchema. - Investigate whether adding this to existing structs would simplify OpenAPI documentation updates.
- I’d be happy to take on the implementation after determining the best approach.
I’m raising this issue to gather feedback and ideas on how to make OpenAPI documentation management easier and more scalable.
try to use keycloak instead