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

array type is showing model key instead of model id #446

Closed
alekbarszczewski opened this issue Apr 14, 2014 · 1 comment
Closed

array type is showing model key instead of model id #446

alekbarszczewski opened this issue Apr 14, 2014 · 1 comment

Comments

@alekbarszczewski
Copy link

models:

{
   UserKey: {
      id: 'User', 
      properties: {
          id: { type: 'integer', format: 'int64' }
      }
   },
   CollectionKey: {
      id: 'UsersCollection',
      properties: {
         items: { type: 'array', items: { $ref: 'UserKey' } }
      }
}

When displaying UsersCollection model swagger UI shows this:

UsersCollection {
   items (array[UserKey])
}
User {
   id (integer)
}

I think it should display items (array[User]) instead of items (array[UserKey]).
For me this is an issue because I declare many models with same id and different key to override model attributes for specific method - for example only email property for PUT /user and email and password for POST /user.

@fehguy
Copy link
Contributor

fehguy commented Apr 14, 2014

Hi, this is true--in the spec it is using the key rather than the ID. I'd suggest filing a ticket in the swagger-spec repo:

https://github.com/wordnik/swagger-spec

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

2 participants