fastapi-code-generator icon indicating copy to clipboard operation
fastapi-code-generator copied to clipboard

Code generation completes silently, generating nothing for schemas with 0 content sections

Open olivergondza opened this issue 4 years ago • 0 comments

I run into an issue that some schema I was working on, caused no files to be generated (and old files not overwritten, as one would expect). It appears to happen when there are no content sections in the yaml.

Reproducible as fastapi-codegen --input spec.yaml --output generated/, with both 0.3.0 and 0.3.2. The command prints nothing and completes with 0 exit code.

Working:

openapi: 3.0.0

paths:
  /foo:
    put:
      summary: Bar
      responses:
        '400':
          description: Baz
          content:
            application/json:
              schema:
                type: object

Broken:

openapi: 3.0.0

paths:
  /foo:
    put:
      summary: Bar
      responses:
        '400':
          description: Baz

olivergondza avatar Nov 30 '21 11:11 olivergondza