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

Parameter display does not display arrays of models properly #343

Closed
whitlockjc opened this issue Apr 1, 2015 · 6 comments
Closed

Parameter display does not display arrays of models properly #343

whitlockjc opened this issue Apr 1, 2015 · 6 comments
Milestone

Comments

@whitlockjc
Copy link
Contributor

Whenever you have an array of models and the schemas items are a reference, instead of Array[ReferencedType] you get Array[Reference] in the parameter display. So for example, the following parameter schema:

// ...
{
  name: 'testing',
  in: 'body',
  schema: {
    type: 'array',
    items: {
      $ref: '#/definitions/Person'
    }
  }
}
// ...

results in a display of Array[#/definitions/Person] instead of Array[Person].

This was original reported from domaindrivendev/Swashbuckle/issues/200.

@ghost
Copy link

ghost commented Apr 17, 2015

As noted elsewhere this behavior can also be observed in http://petstore.swagger.io/#!/user/createUsersWithArrayInput - parameter "body" is shown as "Array[#/definitions/User]"

Once it is fixed, will it only be shown as "Array[User]", or will there be a way to expand it to see the definition of User?

Thanks!

@whitlockjc
Copy link
Contributor Author

@ponelat So is this fixed after merging #381?

@ponelat
Copy link
Member

ponelat commented Apr 23, 2015

@whitlockjc Yes it works in the latest develop_2.0 now.
@beryozad Arrays of models will render the JSON as expandable, something like....

[
  {
     "your": "model here",
      "...": "..."
  }
]

@whitlockjc
Copy link
Contributor Author

What about parameters? When you see a parameter that is an array of models, inline or referenced, does it show Array[SomeDefinition] or Array[#/definitions/SomeDefinition]?

@ponelat
Copy link
Member

ponelat commented Apr 23, 2015

It wouldn't show a string signature but an expandable widget(lack of a better word?)
Like so.... (Note on the right)

screenshot from 2015-04-23 17 58 43

@whitlockjc
Copy link
Contributor Author

That's correct. I think it showed the string version because it wasn't typed right but it seems you've fixed this. Thanks a lot.

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

No branches or pull requests

3 participants