Skip to content

Python Flask apps do not include Error-based models #255

@tschaffter

Description

@tschaffter

Taking the example of the Date Annotator API, possible responses include 500 - BadRequest. The official NLP Sandbox schemas is correct has shown below:

image

But the openapi.yaml generated for Python-Flask apps by openapi-generator convert the BadRequest schema, for example, to its base class, Error. Yet the description of the error come from BadRequest, for example.

  /textDateAnnotations:
    post:
      description: Return the date annotations found in a clinical note
      operationId: create_text_date_annotations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextDateAnnotationRequest'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextDateAnnotationResponse'
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid request
        "500":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: The request cannot be fulfilled due to an unexpected server
            error

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions