ProbablyClem / utoipauto

Rust Macros to automate the addition of Paths/Schemas to Utoipa crate, simulating Reflection during the compilation phase
Apache License 2.0
108 stars 10 forks source link

Add Support for Enum Schema #6

Closed saman3d closed 8 months ago

saman3d commented 8 months ago

This pull request addresses the lack of support for "enum" schemas. In addition to adding this feature, I've made some refactors to enhance the overall codebase. only edited discover.rs file in the core crate.

Changes Made:

Added Support for enum schema: Since the utoipa already supports schemas for enum types, adding support for enum schema types is beneficial.

Refactoring: created a single function for checking ToSchema and ToResponse macros, shared between enums and structs. Implemented method chaining to reduce code complexity. Introduced a DiscoverType to simplify the handling of vector tuples and enable easier iteration over the DiscoverType vector.