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

"multipart/form-data" Request Body Schema Inconsistency With Inline Definition Versus Reference #3524

Closed
alex-leroux opened this issue Jun 22, 2021 · 0 comments · Fixed by #4476

Comments

@alex-leroux
Copy link

If I have the following definition for the request body of an operation:

  requestBody:
    description: Contact data
    content:
      multipart/form-data:
        schema:
          type: object
          properties:
            emailAddress:
              type: string
            firstName:
              type: string
            lastName:
              type: string

... then the OperationModelBase will contain a parameter for each of the properties.

However, if I have the following (functionally equivalent) definition for the request body:

  requestBody:
    description: Contact data
    content:
      multipart/form-data:
        schema:
          $ref: '#/components/schemas/Contact'

... then the OperationModelBase will contain a body parameter, of a type which has a property for each of the properties.

I am using versions 13.11.3.

Is it correct that these two scenarios are treated differently?
(they behave differently because line 342 in OperationModelBase uses .Schema rather than .ActualSchema.

May I also please ask why "multipart/form-data" is treated this way? As opposed to other form request content types, like "application/x-www-form-urlencoded" or "multipart/mixed"?

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

Successfully merging a pull request may close this issue.

1 participant