LUMASERV / proxmox-ve-openapi

An OpenAPI Spec for the ProxMox VE Rest API
Apache License 2.0
11 stars 6 forks source link

Schema validation issues with OpenAPITools - 4 attributes missing #1

Open dheurtev opened 3 years ago

dheurtev commented 3 years ago

Hi,

Thanks for sharing this great tool.

I parsed your output file spec.v2.yaml with OpenAPITTools.

The generator returns the following 4 errors, indicating that the produced schema is invalid in these four places :

-attribute components.responses.GetNodesSingleDisksSmartResponse.content.'application/json'.schema.items is missing
-attribute components.responses.MigrateVMResponse.content.'application/json'.schema.items is missing
-attribute components.responses.CreateNodesSingleExecuteResponse.content.'application/json'.schema.items is missing
-attribute components.responses.GetClusterHaStatusCurrentResponse.content.'application/json'.schema.items is missing

The issue likely is in the source generator.js or in the source.

I can skip these errors in OpenAPITools with the flag --skip-validate-spec with the OpenAPITools's CLI : openapi-generator-cli generate, but it may result in known issues in clients.

Would be great to fix it.

dheurtev commented 3 years ago

I investigated the issue further.

CreateNodesSingleExecuteResponse has a return type array. It must include the field items per the specification (same with GetClusterHaStatusCurrentResponse).

In OpenAPI, anytime a schema object contains an array, items must be present. Properties must be an OpenAPI schema object, not a JSON Schema object.

Often some of the properties in the original source are arrays but do no indicate what the array returns, making it difficult to modify the code to list the items.

NewtTheWolf commented 1 year ago

any updates?

or a solution how to fix this in the Spec File?

dheurtev commented 1 year ago

Sorry, I have not worked on the issue further as Proxmox is not versioning its API at each release of the product and as the production of the schema is beyond my control. In my view, only Proxmox developpers could insure that their API is compliant in a stable manner.

NewtTheWolf commented 1 year ago

too bad but yes true but thanks anyway for this great project

since the schema currently has only 5 Errors where an item is missing I can fix it myself well, I'm just dependent because I need it for the client generation for Rust which takes a lot of work off

x7airworker commented 1 year ago

We are currently not actively using the OpenAPI specification, so we would happily accept any pull requests to fix this issue. Either fix it in the generator script or directly in the specification, which is also fine.