Comments (5)
Input from @jimschubert on Gitter:
I had fixed this once with Kotlin and I think C#
the fix for Kotlin and C# for items nested in arrays, though, wouldn't necessarily be accurate for Java because it has type erasure where the others don't. That is, the type may be correct but wouldn't be verifiable at compile time. I think the fix you've added for Java is a good fix.
Plus, C# for example treats Enum as a primitive (it compiles to an integral value) rather than an object like Java does. I seem to recall when looking at similar solutions that they didn't work in C#. I'll need to check to make sure refactoring haven't cause a regression in that behavior, now that I think about it.
Here we are really at my limitations, because for me the pattern in csharp/modelGeneric.mustache
lines 15-27 looks really similar to what I have changed for java. But I really do not know...
from openapi-generator.
@jmini My comment was toward API parameters, not model properties. I must have misread.
from openapi-generator.
Do you think a mustache helper would be out of the question here?
I believe we can wrap the template example you've provided here into something that could be invoked as {{#shared.model_inner_enum}}{{/shared.model_inner_enum}}
. This would then just include the template from the current framework/library templates.
from openapi-generator.
I really need to catch up on the JMustache lib. I thought not having helper in template is a big difference between handlebar and JMustache.
In swagger-codegen v3 I solved it with an helper that returns the most inner type or the type itself if it isn't a container see: swagger-api/swagger-codegen-generators#58
from openapi-generator.
JMustache supports helpers and filters. The big difference is that Handlebars support control for statements other that the existence checks of Mustache.
from openapi-generator.
Related Issues (20)
- [BUG][Kotlin] openapi 3.0.3 allOf + description + nullable = intermediate class created
- [BUG] [typescript-angular] cannot compile with noUncheckedIndexedAccess set to true
- [BUG] [SPRING] Generation of JSonNullable for OpenApi 3.1 stops working from version 7.3
- [BUG] Spring boot 3 - can't see interfaces with default methods. "Ignored because not a concrete top-level class"
- [BUG] [C++] [Restbed] Post handler cannot fetch large request Body
- Python: Creating an async client HOT 2
- [REQ] A go client vendor extension to skip the generation of UnmarshalJSON HOT 1
- [BUG] [JAVA] okhttp-gson joda client codegen ambiguous references for LocalDate and DateTimeFormatter HOT 1
- [BUG][Kotlin-Spring] Default values for Int64 parameters creates broken spring API HOT 1
- Java Play-framework server is using a library that is not available anymore (com.typesafe.play/sbt-plugin/2.8.3) HOT 1
- [BUG] openapi-Normalizer usage in config.yaml file doesn't seem to do anything HOT 9
- [BUG] [aspnetcore] - models are generated with an invalid constructor (v7.5.0)
- [BUG] [aspnetcore] - models are generated with an invalid constructor (v7.5.0)
- [BUG] Broken enum code generation when uppercase and lowercase enums are given HOT 1
- [BUG] [Powershell] Array context not maintained when converting a parameter to JSON
- [BUG][PowerShell] [System.IO.FileInfo] object used in multipart/form-data submission does not support relative paths
- [BUG] openapi-generator 7.5.0 is no longer able to resolve local $refs HOT 1
- [JAVA] [JAXRS] [BUG] Enums Decorated with @Valid in Componentized Classes HOT 2
- [BUG] CodegenConfigurator#setOpenAPINormalizer changes HOT 3
- [kotlin] modelPackage ignored on import of model classes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-generator.