OpenAPITools / OpenAPITools/openapi-generator

[BUG] [Flask] x-body-name is not in the right place to make Connextions work

Open
#11,516 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • 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?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Connexions only respects the x-body-name cfg when it's in the request body schema (or when it's in the schema of the referred type).

The existing AbstractPythonConnexionServerCodegen places it as the request body level.

The result is that there's not way to override the request body param name.

See also description here https://github.com/zalando/connexion/issues/757 which I've verified with the master build of this product.

openapi-generator version

master

OpenAPI declaration file content or url

Needs to look like this code for Connexions to use it...

 post:
      parameters:
      requestBody:
        content:
          application/json:
            schema:
              **x-body-name: overriddenParamName**
              $ref: '#/components/schemas/SomeType'
        required: true```


##### Related issues/PRs

https://github.com/zalando/connexion/issues/757 

##### Suggest a fix

Change the Python code gen to put it the right place

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at AbstractPythonConnexionServerCodegen and inspect how x-body-name is emitted for Flask/Connexion request-body schemas; compare the generated declaration with the linked Connexion behavior. Done when the extension is placed on the request-body schema, including the referred type case, and relevant Python generator tests cover the generated output.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.