The julia-server and julia-client generators emit the OpenAPI.property_type discriminator resolver using eval(Base.Meta.parse("ModelName")). The model types are already in scope in the generated module, so straight ModelName works: ~30× faster on the resolver call and pre-compilation friendly, while keeping the behavior the same.
Relevant template pieces: lines 16, 18 here and here: simply replace with return {{modelName}} and return {{.}}.
Worth confirming {{modelName}} is always a valid Julia identifier (true for normal model names) before merging.
The
julia-serverandjulia-clientgenerators emit theOpenAPI.property_typediscriminator resolver usingeval(Base.Meta.parse("ModelName")). The model types are already in scope in the generated module, so straightModelNameworks: ~30× faster on the resolver call and pre-compilation friendly, while keeping the behavior the same.Relevant template pieces: lines 16, 18 here and here: simply replace with
return {{modelName}}andreturn {{.}}.Worth confirming
{{modelName}}is always a valid Julia identifier (true for normal model names) before merging.