Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Error Struct with JsonSchema Implementation #577

Open
NewtTheWolf opened this issue Sep 26, 2024 · 0 comments
Open

Add Support for Error Struct with JsonSchema Implementation #577

NewtTheWolf opened this issue Sep 26, 2024 · 0 comments

Comments

@NewtTheWolf
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant