Comments (4)
Hi, thanks for the report. I've figured out the issue with the RequestedPackageLineItemDimensions
which is related to nested usage of allOf
compositions which work with a patch I've developed (still need to write some test cases).
Another issue which occurs later is related to the Body
entry of the schema, a large collection of oneOf
references where only a single oneOf
branch provides an actual schema. All other branches provide example data (so strictly no validation rules and every body is valid as a oneOf
branch with only example data is always fulfilled no matter which data is provided). I'll have a deeper look into it and check if it makes sense to skip branches which only contain example data during the generation process.
For example:
{
"body": 34
}
validates against the following simplified schema which shows the issue with the Body
from the rate.json schema which doesn't seem to be intended:
{
"type":"object",
"properties":{
"body": {
"oneOf": [
{
"type":"object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"]
},
{
"example": {
"name": "wol-soft"
}
}
]
}
},
"required": ["body"]
}
from php-json-schema-model-generator.
Thank you for checking into this! It would be great if your library could support these schemas. Everything I've tried so far has either choked on them, or generated output we've had to manually modify afterward. I think the body section you mentioned was a problem, and was one thing we had to remove from classes generated with another tool.
from php-json-schema-model-generator.
I pulled issue72_nestedCompositionbranch that links to this issue, and used it to generate ship models from FedEx's ship schema and got this error:
Message: Unresolved Reference #/components/schemas/RequestedShipment in file /tmp/ship.json in file: /home/hfinn/repos/ship/vendor/wol-soft/php-json-schema-model-generator/src/PropertyProcessor/Property/ReferenceProcessor.php
on line: 50
Same as the rate schema, go to Shipping documentation > click Download Json Schema to look at the json.
from php-json-schema-model-generator.
Hi, I'm still facing some issues with the rate.json
related to validators in combination with the nested allOf
usage.
It takes some time to further investigate the issue which I'm currently not able to invest - sorry. I'll check it, when time allows.
To be fair: this seems to be the most complex schema I've seen the library being used on. Nice challenge 😄
Then I'll also have a look at the shipping schema. The schema looks correct, the reference is defined and consequently should be resolved.
from php-json-schema-model-generator.
Related Issues (20)
- Support for minContains and maxContains
- Incorrectly escaped backslashes in regex in generated code HOT 9
- Make code output stable across multiple runs HOT 7
- Integer property with default 0 is incorrectly nullable HOT 3
- Validation of nested composition causes fatal error
- Access to undeclared property `_propertyValidationState` on simple templates HOT 3
- Incorrect native parameter type on nullable setters in mutable models HOT 5
- Crash on `"type": ["object"]` on object properties
- Inconsistency of generated code when using different methods to declare nullable structures HOT 1
- uuid string type support HOT 1
- No nested schema for composed property HOT 5
- Support number property key HOT 3
- Constructor with explicit argument HOT 1
- Add validateOption to FilterInterface
- ...PropertyProxy::getProperty(): Return value must be of type ...PropertyInterface, null returned in HOT 4
- Stable version HOT 1
- Filter for a property inside a Composition inside an array is not executed
- Serialization Bug: Including Null Properties in JSON Output instead of Excluding Them HOT 1
- Creation of dynamic property for composed item validators on properties
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 php-json-schema-model-generator.