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

Parameters for nested array #455

Open
gregdymek opened this issue Jan 3, 2020 · 3 comments
Open

Parameters for nested array #455

gregdymek opened this issue Jan 3, 2020 · 3 comments
Labels
good-first-issue Good issue for new contributors to pick up openapi

Comments

@gregdymek
Copy link

gregdymek commented Jan 3, 2020

let's say I have a structure like:

{
  data: [
    {
      id: 5,
      name: 'test'
    },
    {
      id: 6,
      name: 'test2'
    }
  ]
}

is there a way I can document the nested fields so as a result I will get openapi generated correctly (so in swagger I can add these items from the UI) ?

@gregdymek
Copy link
Author

I was trying with something like this:

parameter :data, type: :array
parameter :id, type: :string, scope: :data
parameter :name, type: :string, scope: :data

but it didn't work

@daniel-illi
Copy link

I'm facing the same issue

@jakehow jakehow added good-first-issue Good issue for new contributors to pick up openapi labels Oct 20, 2020
@ngoral
Copy link

ngoral commented Feb 17, 2022

I guess one can use

parameter :data, type: array
parameter :id, type: integer, scope: 'data[]'

I also want a conversation about this part in #413, cause I'm facing the same issue and want to fix it in the way most users will be happy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good issue for new contributors to pick up openapi
Projects
None yet
Development

No branches or pull requests

4 participants