Skip to content

Parameters for nested array #455

Open

Description

@gregdymek

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) ?

Activity

  1. gregdymek commented on Jan 3, 2020

    @gregdymek
    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

  2. daniel-illi commented on Oct 20, 2020

    @daniel-illi

    I'm facing the same issue

  3. ngoral commented on Feb 17, 2022

    @ngoral

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions