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

Unsupported JSON structures in formData fields #154

Open
blast-hardcheese opened this Issue Jan 7, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@blast-hardcheese
Copy link
Collaborator

blast-hardcheese commented Jan 7, 2019

While working on #148/#150, I discovered that type: object is not supported for formData parameters. I've not needed this feature, but opening it here in case someone else needs it.

Minimal example:

swagger: '2.0'
paths:
  /test:
    put:
      operationId: updateFoo
      consumes:
        - multipart/form-data
      parameters:
        - in: formData
          name: structure
          type: object
          schema:
            $ref: '#/definitions/Foo'
      responses:
        202:
          schema:
            $ref: '#/definitions/Foo'
definitions:
  Foo:
    type: object
    required:
    - name
    properties:
      name:
        type: string

Errors:

[error] .../guardrail/modules/sample/src/main/scala/issues/issue148/client/akkaHttp/Client.scala:60:224: could not find implicit value for parameter ev: issues.issue148.client.akkaHttp.Implicits.Show[io.circe.Json]
[error]       () => List(Some(Multipart.FormData.BodyPart("foo", Formatter.show(foo))), bar.map(v => Multipart.FormData.BodyPart("bar", Formatter.show(v))), structure.map(v => Multipart.FormData.BodyPart("structure", Formatter.show(v)))).flatten.iterator
[error]                                                                                                                                                                                                                                ^
[error] .../guardrail/modules/sample/src/main/scala/issues/issue148/client/http4s/Client.scala:59:210: could not find implicit value for parameter ev: issues.issue148.client.http4s.Implicits.Show[io.circe.Json]
[error] Error occurred in an application involving default arguments.
[error]     val _multipart = Multipart(List(Some(Part.formData[F]("foo", Formatter.show(foo))), bar.map(v => Part.formData[F]("bar", Formatter.show(v))), structure.map(v => Part.formData[F]("structure", Formatter.show(v)))).flatten.toVector)
[error]                                                                                                                                                                                                                  ^
[error] two errors found
[error] (sample / Compile / compileIncremental) Compilation failed
[error] Total time: 18 s, completed Jan 6, 2019 7:10:46 PM
@blast-hardcheese

This comment has been minimized.

Copy link
Collaborator

blast-hardcheese commented Jan 13, 2019

Related to #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment