poem: Generics produce invalid OpenAPI identifiers
Having a generic type with #[derive(Object)]
will produce identifiers like PaginatedResponse<SessionSnapshot>
which look nice, but are not valid according to the spec:
Component names can only contain the characters A-Z a-z 0-9 - . _
It would be nicer to allow renaming them at the specialization site with an [oai(rename)]
, or allow forcing the definition to be inlined in the spec.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15 (9 by maintainers)
Maybe the Object derive macro could also accept an
#[oai(generic_name_format="{}<{}>")]
and use it to generate the namepinging to keep the issue alive.
This problem can currently only be solved by avoiding the use of generics. 🙂