Validation error when generating code for guichet-unique.inpi.fr/api
pulse-mind opened this issue · 1 comments
pulse-mind commented
When I get the file by clicking on Download (https://guichet-unique.inpi.fr/api/docs/mandataire or get it from https://app.swaggerhub.com/apis/fravetier/INPI-GuichetUnique/3.0.3#/) and run the tool like this fastapi-codegen --input inpi-swagger.json --output app
I get two errors :
ValidationError: 2 validation errors for JsonSchemaObject
properties -> typePersonne -> enum
value is not a valid list (type=type_error.list)
properties -> typePersonne
value could not be parsed to a boolean (type=type_error.bool)
The output does not give enough information about the problem so I can't say if the problem is coming from the input file or from fastapi-code-generator
.
yyamano commented
I got the following errors with https://app.swaggerhub.com/apis/fravetier/INPI-GuichetUnique/3.0.3#/.
ValidationError: 2 validation errors for JsonSchemaObject
properties -> parking_restrictions -> required
value is not a valid list (type=type_error.list)
properties -> parking_restrictions
value could not be parsed to a boolean (type=type_error.bool)
The above errors come from:
parking_restrictions:
type: object
required: false
$ref: '#/components/schemas/ParkingRestriction'
description: The restrictions that apply to the parking spot.
If I remove "required: false", it works fine to me.
New are versions of JSON Schema Spec (and OpenAPI Spec) don't allow it.