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

[java] Request body's of multipart/form-data requests are ignored by at least all Java generators #148

Closed
lion7 opened this issue Aug 9, 2018 · 0 comments

Comments

@lion7
Copy link
Contributor

lion7 commented Aug 9, 2018

In the OpenAPI specification 3.0 an example of a multipart/form-data request body can be found (source):

requestBody:
  content:
    multipart/form-data:
      schema:
        type: object
        properties:
          id:
            type: string
            format: uuid
          address:
            # default Content-Type for objects is `application/json`
            type: object
            properties: {}
          profileImage:
            # default Content-Type for string/binary is `application/octet-stream`
            type: string
            format: binary
          children:
            # default Content-Type for arrays is based on the `inner` type (text/plain here)
            type: array
            items:
              type: string
          addresses:
            # default Content-Type for arrays is based on the `inner` type (object shown, so `application/json` in this example)
            type: array
            items:
              type: '#/components/schemas/Address'

The swagger-parser used by the generators parses this example different from other blocks; the schema is always a schema that refers to another schema, either an 'anonymous' schema or 1 that is defined in the components section, The current implementation of DefaultCodegenConfig does not follow this reference and hence all properties defined are ignored during code generation.

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