zitadel-rust icon indicating copy to clipboard operation
zitadel-rust copied to clipboard

Add Support for Error Struct with `JsonSchema` Implementation

Open NewtTheWolf opened this issue 1 year ago • 1 comments

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:

  1. Should we create a new error struct that implements JsonSchema for better OpenAPI support, or is it feasible to extend an existing struct by adding a feature (e.g., via rocket_okapi)?
  2. Would adding this feature make it significantly easier to maintain OpenAPI documentation, particularly for custom error responses?
  3. How can we ensure this approach is scalable, especially in projects with multiple custom error types?

Suggestions:

  • Explore the possibility of adding a rocket_okapi feature flag that enables easier OpenAPI documentation maintenance by integrating error structs with JsonSchema.
  • 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.

NewtTheWolf avatar Sep 26 '24 12:09 NewtTheWolf

try to use keycloak instead

nikabernhard avatar Nov 20 '24 22:11 nikabernhard