smartive / zitadel-rust

An implementation of the ZITADEL gRPC API in Rust. Complemented with other useful elements such as ServiceAccount auth.
https://docs.rs/zitadel/latest/zitadel/
Other
46 stars 17 forks source link

Feature Request: Optional Support for Rocket-Okapi Integration in IntrospectedUser #558

Closed NewtTheWolf closed 1 month ago

NewtTheWolf commented 4 months ago

Feature Request: Optional Support for Rocket-Okapi Integration in IntrospectedUser

Description

I propose integrating the rocket-okapi library as an optional feature in the zitadel-rust project, specifically by implementing the OpenApiResponderInner and/or OpenApiResponder traits in the IntrospectedUser type. This enhancement would enable OpenAPI specification support for Rocket-based applications, facilitating automated API documentation generation.

Motivation

Adding rocket-okapi support as an optional feature would improve the developer experience by providing automated API documentation generation capabilities, without imposing additional overhead on those who do not require this functionality. It is particularly useful for teams that need to maintain clear and accurate API documentation in fast-paced development environments.

Suggestion

The feature should be implemented as non-default, allowing developers to opt in as needed. Implementing the required traits in IntrospectedUser would make it straightforward to generate API documentation for services that utilize this type.

Possible Implementation Steps:

  1. Modify the IntrospectedUser type to implement the OpenApiResponderInner and OpenApiResponder traits.
  2. Implement the integration as a feature flag within the zitadel-rust project to keep it optional.
  3. Create detailed examples and documentation to guide developers on how to enable and use the new feature.
  4. Conduct comprehensive testing to ensure that enabling this feature does not affect the existing functionalities negatively.

Conclusion

Integrating rocket-okapi as an optional feature within IntrospectedUser could greatly enhance the capability of developers to maintain robust API documentation with minimal overhead. This feature would be particularly advantageous for projects requiring detailed and accurate API specs without disrupting the current project setup. I am eager to hear your thoughts and suggestions regarding this proposal.

Thank you for considering this feature request.

rocket-okapi GitHub Link

NewtTheWolf commented 4 months ago

i would try to implement it, atm i am struggling to develop the project

but i could test the new features of course!

pustekuchen91 commented 4 months ago

Hello @NewtTheWolf,

thanks for implementing this. I am also interested in this feature.

@buehler Can I somehow support this to appear in the next zitadel version?

NewtTheWolf commented 4 months ago

Uh, someone is intrested, atm i am using a Tuplestruct to Achive it

But i will implement it correctly later that day in my Draft Pull so it could be Merged

NewtTheWolf commented 4 months ago

@pustekuchen91 do you have an idea by any chance?

https://github.com/smartive/zitadel-rust/pull/559#discussion_r1664007775

buehler commented 4 months ago

Hey @pustekuchen91 @NewtTheWolf

Thanks for the proposals. This sounds reasonable :-)

I currently have no time to implement such a thing, but feel free to create a PR which I'll happily review ;-)

NewtTheWolf commented 4 months ago

hey @buehler i already implemented it in the linked PR

could you maybe already do a little review? more to check if everything is okey and the little problem i mentioned in my comment about the URL

FrTerstappen commented 2 months ago

Hello @buehler and @NewtTheWolf ,

I am also interested in this feature. Is there some way to support this effort? I am currently using the changes made by @NewtTheWolf. And while they are not perfect they are going in the right direction. I have left some feedback in the draft for this change.

buehler commented 1 month ago

Implemented with #559