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

Invalid Nested Array of Different Types Generated #193

Open
LindaOrtega opened this issue Jun 13, 2019 · 0 comments
Open

Invalid Nested Array of Different Types Generated #193

LindaOrtega opened this issue Jun 13, 2019 · 0 comments

Comments

@LindaOrtega
Copy link

Invalid swagger generated for types that are represented as nested arrays of different types.

For example,

data Simple = Simple Int String
(Int, String)

both seem to be represented as Swagger Arrays of two items with two types.

But if I'm representing a array of these types:

[Simple]
[(Int,String)]
newtype SimpleMap = SimpleMap (HashMap SomeType1 SomeType2)

seemed to be represented as Swagger Arrays of Swagger Arrays of different types.

When I run the generated swagger through a swagger editor, I get an error because swagger 2.0 doesn't like nested arrays of different types.

Swagger:

 SimpleMap:
    items:
      minItems: 2
      items:
        - $ref: '#/definitions/SomeType1'
        - $ref: '#/definitions/SomeType2'
      maxItems: 2
      type: array
    type: array

Error:

Structural error at definitions.SimpleMap.items.items
should be object
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