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

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

Open
tschaffter opened this issue Aug 14, 2021 · 0 comments
Open

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

tschaffter opened this issue Aug 14, 2021 · 0 comments
Assignees
Labels
Bug Something isn't working

Comments

@tschaffter
Copy link
Member

tschaffter commented Aug 14, 2021

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
@tschaffter tschaffter added the Bug Something isn't working label Aug 14, 2021
@tschaffter tschaffter self-assigned this Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant