-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when generating classes with FedEx OpenAPI schema #72
Comments
Hi, thanks for the report. I've figured out the issue with the Another issue which occurs later is related to the For example: {
"body": 34
} validates against the following simplified schema which shows the issue with the {
"type":"object",
"properties":{
"body": {
"oneOf": [
{
"type":"object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"]
},
{
"example": {
"name": "wol-soft"
}
}
]
}
},
"required": ["body"]
} |
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. |
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:
Same as the rate schema, go to Shipping documentation > click Download Json Schema to look at the json. |
Hi, I'm still facing some issues with the 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. Then I'll also have a look at the shipping schema. The schema looks correct, the reference is defined and consequently should be resolved. |
Describe the bug
When I use this library to try to generate PHP classes from FedEx's OpenAPI schema for their new RESTful API, I get this error:
PHP Fatal error: Uncaught PHPModelGenerator\Exception\SchemaException: No nested schema for composed property RequestePackageLineItemDimensions in file /[...]/utils/../schemas/rate.json
(Note: that should be RequestedPackageLineItemDimensions, but the first 'd' is missing in the reference and the definition, so it shouldn't matter.)
This is mentioned in issue 57, but the solution there was to alter the schema. Since the goal is to be as hands-off as possible, I'd much prefer to simply download the schemas and run this function on them. I don't want to have to modify every schema we need (ship, rate, address validation, and more) each time we have to update to a new API release. I've installed a java-based tool that converts schemas into PHP, and it didn't encounter this problem when using this schema, so I know it's possible. I also validated the schema with two online validators, and both indicated that the JSON is valid for OpenAPI.
Expected behavior
Given that this is a valid OpenAPI 3 schema from a major company, I expect it to be processed into PHP classes properly.
Schema
https://developer.fedex.com/api/en-us/catalog/rate/v1/docs.html > click "download JSON schema". I'd link to it directly here, but the page uses some JS to actually serve the JSON file.
Here's the function I'm using to try to generate the classes:
Version:
0.23.3
Additional context
I don't think I have anything to add. I'm experienced with PHP, but very new to OpenAPI and class generation. If more information is required, please ask.
The text was updated successfully, but these errors were encountered: