Describe the bug
Two bugs in the OpenAPI spec at /api/docs.json cause a generated Rust client to fail compilation.
This is caused by two independent errors in the spec.
I only made one issue, as both individually make the build fail. If I should split it into two, please let me know.
groupedParameters uses "type": "unknown_type" on several schemas. This is not a valid OpenAPI type per the OAS 3.1 spec.
- The
Part schema defines manufacturer_product_url and manufacturerProductURL as separate properties. Both map to the same identifier in any generator that normalises casing.
To Reproduce
Steps to reproduce the behavior:
curl -H "Authorization: Bearer <token>" https://<your-partdb>/api/docs.json -o spec.json
openapi-generator-cli generate -i spec.json -g rust -o ./partdb-rs --skip-validate-spec
cd partdb-rs && cargo build
You will get these two erros:
error[E0425]: cannot find type `UnknownType` in module `models`
error[E0124]: field `manufacturer_product_url` is already declared
Expected behavior
- Replace
"type": "unknown_type" with an empty schema {}. Per JSON Schema 2020-12
§4.3.2, {} accepts any value.
- Remove
manufacturerProductURL or manufacturer_product_url one is enough to cover that field.
Screenshots
N/A
Server Side
- Part-DB Version: Part-DB 2.12.1
- PHP Version: PHP 8.4.22
- Database Server: MySQL 8.0.46
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
While the Rust generator is used as the example here, both bugs will affect any generator that validates type names or normalises property names to a single casing convention.
Describe the bug
Two bugs in the OpenAPI spec at
/api/docs.jsoncause a generated Rust client to fail compilation.This is caused by two independent errors in the spec.
I only made one issue, as both individually make the build fail. If I should split it into two, please let me know.
groupedParametersuses"type": "unknown_type"on several schemas. This is not a valid OpenAPI type per the OAS 3.1 spec.Partschema definesmanufacturer_product_urlandmanufacturerProductURLas separate properties. Both map to the same identifier in any generator that normalises casing.To Reproduce
Steps to reproduce the behavior:
You will get these two erros:
Expected behavior
"type": "unknown_type"with an empty schema{}. Per JSON Schema 2020-12§4.3.2,
{}accepts any value.manufacturerProductURLormanufacturer_product_urlone is enough to cover that field.Screenshots
N/A
Server Side
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
While the Rust generator is used as the example here, both bugs will affect any generator that validates type names or normalises property names to a single casing convention.