Skip to content
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

Validation error when generating code for guichet-unique.inpi.fr/api #335

Open
pulse-mind opened this issue Mar 20, 2023 · 1 comment
Open

Comments

@pulse-mind
Copy link

pulse-mind commented Mar 20, 2023

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
Copy link
Contributor

yyamano commented Aug 14, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants