Module: Graphiti::OpenAPI::Parameters
Instance Method Summary collapse
- #array_enum(enum, type: :string, uniq: true) ⇒ Object
- #parameter(name, desc: nil, **options) ⇒ Object
- #path_parameter(name, required: true, **options) ⇒ Object
- #query_parameter(name, **options) ⇒ Object
Instance Method Details
#array_enum(enum, type: :string, uniq: true) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'app/models/graphiti/open_api/parameters.rb', line 19 def array_enum(enum, type: :string, uniq: true) { type: :array, items: { type: type, enum: enum, uniqueItems: uniq, }, } end |
#parameter(name, desc: nil, **options) ⇒ Object
5 6 7 8 9 |
# File 'app/models/graphiti/open_api/parameters.rb', line 5 def parameter(name, desc: nil, **) .merge(name: name).tap do |parameter| parameter[:description] = desc if desc end end |
#path_parameter(name, required: true, **options) ⇒ Object
15 16 17 |
# File 'app/models/graphiti/open_api/parameters.rb', line 15 def path_parameter(name, required: true, **) parameter(name, in: :path, required: required, **) end |
#query_parameter(name, **options) ⇒ Object
11 12 13 |
# File 'app/models/graphiti/open_api/parameters.rb', line 11 def query_parameter(name, **) parameter(name, in: :query, **) end |