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

allOf doesn't work with multipart/form-data #1868

Open
alfechner opened this issue Feb 9, 2024 · 0 comments
Open

allOf doesn't work with multipart/form-data #1868

alfechner opened this issue Feb 9, 2024 · 0 comments

Comments

@alfechner
Copy link
Contributor

Description

I use multipart/form-data content type.

The following spec works just fine:

openapi: 3.0.3
info:
  title: LIQUID Dataset Service
  version: 1.0.0
paths:
  /foo:
    post:
      x-openapi-router-controller: liquid_dataset_service.controllers.dataset_controller
      operationId: create_bar
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                bar:
                  type: string
      responses:
        204:
          description: No Content

In the next spec I used allOf to assemble objects (in this minimal example I only use one object):

openapi: 3.0.3
info:
  title: LIQUID Dataset Service
  version: 1.0.0
paths:
  /foo:
    post:
      x-openapi-router-controller: liquid_dataset_service.controllers.dataset_controller
      operationId: create_bar
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              allOf:
                - type: object
                  properties:
                    bar:
                      type: string
      responses:
        204:
          description: No Content

Expected behaviour

Spec two should behave exactly like spec one.

Actual behaviour

Server raises error: ExtraParameterProblem(status_code=400, detail='Extra formData parameter(s) bar not in spec')

Steps to reproduce

Create a controller function, e.g.:

def create_bar(bar):
    return

Use the second spec from above. Adjust property x-openapi-router-controller accordingly.

Fire up the swagger page and run the request.

Additional info:

Output of the commands:

  • python --version: Python 3.11.6
  • pip show connexion | grep "^Version\:": Version: 3.0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant