Giter VIP home page Giter VIP logo

Comments (4)

jonaslagoni avatar jonaslagoni commented on July 23, 2024

There are different ways to achieve this so given the following JSON Schema:

{
  "type": "object",
  "properties": {
    "builtin": { "type": "number" }
  },
  "patternProperties": {
    "^S_": { "type": "string" },
    "^I_": { "type": "integer" }
  },
  "additionalProperties": { "type": "string" }
}

should it generate a model (gonna use Java as an example here) such as:

public class ClassName {
  private builtin: number; 
  private Map<String, string> S_PatternProperties = new HashMap();
  private Map<String, int> I_PatternProperties = new HashMap();
  private Map<String, string> additionalProperties = new HashMap();
}

or

public class ClassName {
  private builtin: number; 
  private Map<String, Object> additionalProperties = new HashMap();
}

from modelina.

jonaslagoni avatar jonaslagoni commented on July 23, 2024

Based on multiple discussion we should go with something like:

public class ClassName {
  private builtin: number; 
  private Map<String, string> S_PatternProperties = new HashMap();
  private Map<String, int> I_PatternProperties = new HashMap();
  private Map<String, string> additionalProperties = new HashMap();
}

Now we still have a problem with duplicate properties in cases where properties would contain a property called S_PatternProperties which we need to figure out how to handle.

from modelina.

github-actions avatar github-actions commented on July 23, 2024

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

from modelina.

jonaslagoni avatar jonaslagoni commented on July 23, 2024

Gonna close this issue since we currently interpret patternProperties, all that is missing are #154

from modelina.

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.