Skip to content

[BUG] [python-flask] missing explanation why it uses connexion and not flask #15062

Open
@qyanu

Description

@qyanu

Bug Report Checklist

  • [✓] Have you provided a full/minimal spec to reproduce the issue?
  • [✓] Have you validated the input using an OpenAPI validator (example)?
  • [no] Have you tested with the latest master to confirm the issue still exists?
  • [✓] Have you searched for related issues/PRs?
  • [✓] What's the actual output vs expected output?
  • [no] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The generator "python-flask" indeed does not generate anything related
to flask (https://flask.palletsprojects.com/), but uses connexion
(https://pypi.org/project/connexion/).

While this is technically mentioned in the helpText (e.g. google
searchable here https://openapi-generator.tech/docs/generators/python-flask/ )
and also mentioned in the generated/README.md, this is surprising
nonetheless.

I would have expected for the generator to have the name 'python-connexion'
if indeed the connexion library is used, and to have the name
'python-flask' only if the generated code is somewhat related to the
usage of flask according to flask's user-guide (e.g. https://flask.palletsprojects.com/en/2.2.x/quickstart/#a-minimal-application ).

My guess is, that there is some historical reason to the current naming
of this python generator. However, indeed the current naming blocks for
example me from writing another python generator that produces code
using the flask library.

openapi-generator version

I have downloaded the 6.4.0 version of the generator as follows:

$ wget -q -O openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.4.0/openapi-generator-cli-6.4.0.jar
$ sha256sum -b openapi-generator-cli.jar
35aead300e0c9469fbd9d30cf46f4153897dcb282912091ca4ec9212dce9d151 *openapi-generator-cli.jar
OpenAPI declaration file content or url
%YAML 1.2
---
openapi: "3.1.0"
info:
  version: "0.1.0"
  title: "Example API"
servers:
  - url: /
paths:
  /hello:
    summary: a greeting from the server
    get:
      operationId: hello-get
      responses:
        200:
          description: "a greeting from the server"
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    type: string
                    description: >-
                      the software version running at the server
Generation Details

The code was generated as follows:

$ java -jar ./openapi-generator-cli.jar generate -g python-flask -i ./example.yaml -o generated > openapi-generate-output.txt
Related issues/PRs

none found

Suggest a fix
  • write into the helpText, why connexion is used and not flask;
  • rename from "python-flask" to "python-connexion".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions