-
Notifications
You must be signed in to change notification settings - Fork 66
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
Enums unusable as path params due to not deriving Display
#253
Comments
I'm curious about how deserialisation of the |
Progenitor actually generates the internal type w/
Some context here is that |
Ironically the order of the enum isn't preserved on serialization so the point is moot. Regardless, it'll work in either direction so we're covered on that bit. |
I think we'll want to insert "label hints" for the two variants as we do for Regardless, progenitor can add yet another special case trait impls / derive macros to handle this situation. The generalized case will need to consider the full type graph with cycles etc. |
Arguably a bug: we just derive Presumably, the |
In oxidecomputer/omicron#1957 I'm experimenting with a new API approach as laid out in RFD-322. In this approach we have at most one path param that may be a
Name
orUuid
type.Example endpoint
When
nexus.json
is first generated it succeeds with an openapi spec that seems reasonable to me.Spec example
After
nexus.json
is updated though, the progenitor macro fails with the following error:The
NameOrId
type generated via progenitor doesn't deriveDisplay
but when we're building outsend
endpoints for routes the URL is constructed with generated code like this:instance
in the above case is theNameOrId
type (or at least a wrapper around that type).Deriving
display
for single member enums in progenitor would make this usecase possible.The text was updated successfully, but these errors were encountered: