Giter Site home page Giter Site logo

Comments (5)

jmini avatar jmini commented on May 6, 2024

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.

jimschubert avatar jimschubert commented on May 6, 2024

@jmini My comment was toward API parameters, not model properties. I must have misread.

from openapi-generator.

jimschubert avatar jimschubert commented on May 6, 2024

@jmini

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.

jmini avatar jmini commented on May 6, 2024

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.

jimschubert avatar jimschubert commented on May 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.