Open davidmigloz opened 11 months ago
I see your point, it may be better to do it at the code generation level to keep the spec pure and clean.
onUnionConstructorName
sounds like a good idea, in line with the other functions.
Sounds good. I'll get that in, I could actually use such a function myself!
I had in my mind a feature request to allow to specify custom factory names, which (together with the already implemented titles) would be the ultimate piece for full customization support.
My idea was to use Specification Extensions to define the factory name in the schema (e.g. using something like
x-factoryName
):_Originally posted by @davidmigloz in https://github.com/tazatechnology/openapi_spec/issues/32#issuecomment-1791059764_
Yea this package does not introduce any sort of package specific customization like that. The idea was to just be compatible with any API schema out of the box, without introducing any extra dependency or custom definitions.
@davidmigloz alternatively, we can do it at the code generation level with an
onUnionConstructorName
function that would allow a user to override the constructor of a specific union. Feel free to open an issue and we can move that chat there.Will cut a new release with these changes.
_Originally posted by @walsha2 in https://github.com/tazatechnology/openapi_spec/issues/32#issuecomment-1791177913_