Skip to content

grape/swagger POST arrays with embedded params don't work correctly in the UI #302

Open
@pswenson

Description

@pswenson

code like this:

desc 'create new symptom'
    params do
      optional :id, type: Integer
      requires :reasonCode, type: String
      requires :lifeThreatening, type: Boolean
      requires :msp, type: Boolean
      optional :symptomNamesAttributes, type: Array, default: [] do
          requires :name, type: String
          requires :primary, type: Boolean, default: false
      end
  end
end

screen shot 2015-10-02 at 2 53 12 pm

The area of interest is the SymtomNamesAttributes.

First problem: you can only enter one symtomNamesAttributes despite it being declared as an array.
Second (bigger problem): even though symtomNamesAttributes is marked as "optional", the UI makes it required because the nested names/primary fields are required.

Are these known issues? Is there a work around?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions