Comments (7)
Also if I write something like:
{ "type": "array", "items": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }
then this is true union, but I got this same CommonModel, like in tuple case, so user/dev cannot determine which type should be rendered for model and for that must check the originalSchema, which is not acceptable.
from modelina.
This might get fixed by an upcoming pr, there are a bug in the type simplifier.
from modelina.
The simplifier does semi-require the root schema to be an object... I'll try spend a few hours to figure out how we can handle this better.
from modelina.
With the master branch I see the output to be the following:
{
originalSchema: {
type: "array",
items: [
{
type: "string",
},
{
type: "number",
},
],
},
type: "array",
items: {
type: [
"string",
"number",
],
originalSchema: {
type: "array",
items: [
{
type: "string",
},
{
type: "number",
},
],
},
},
}
Which is as expected right?
See #82 for more details
from modelina.
@jonaslagoni No, this is not a true, because this schema indicates that you have an array of union, not a tuple. We should have schema like this:
"items": [
{ type: "string" },
{ type: "number" },
]
from modelina.
We concluded that this a feature request, but also a bug :)
from modelina.
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.
Related Issues (20)
- Divide "Maintainer" role into two categories: Triager and Commiter HOT 2
- [FEATURE] Add Stretchable Sidebar to Playground HOT 12
- Go enum generator does not call `additionalContent` hook
- Change C# Equals() overload to allow reference type properties to be properly compared HOT 13
- [BUG] C# setter for property named `value` prevents assignment. HOT 4
- Allow changing `additionalProperties` property name interpretation
- [BUG] AsyncAPI generator for Java doesn't generate class correctly when there's reference to itself HOT 14
- [FEATURE] Generate code from OpenAPI spec without paths HOT 9
- Java generator does not include import for dictionary models
- Weird behavior with self referencing models not create correct types HOT 1
- AsyncAPIInputProcessor does not respect schemaFormat of the message HOT 2
- Python generator does not handle self reference types correctly
- schemaMapping configuration to re-use existing model classes HOT 4
- Modelina CLI windows build failing HOT 2
- [BUG] Implement avro schema data type HOT 1
- Lonely `additionalProperties` does not generate dictionary type
- Tuple types in marshalling are generated with syntax errors
- Java marshalling preset generate code with syntax errors
- Java jackson preset not serializing dictionary models with unwrap option correctly
- Enable java jackson preset feature to serialize/deserialize unwrappable dictionaries
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 modelina.