Comments (4)
https://github.com/tim-vandecasteele/grape-swagger/pull/96
from grape-swagger.
#132 plus #105 might have fixed this.
You need to explicitly tell grape that the parameter type is an Array and that it has values. Note that the values need to be an Array in an Array.
params do
optional :number, type: Array, desc: "Favourite number" , values: [[1],[2],[3]]
optional :foo_or_bar , type: String, desc: "Foo or Bar?" , values: %w(Foo Bar)
end
Is the behaviour for param number the behaviour you want?
from grape-swagger.
It looks like none of the specs actually test that allowMultiple can be generated. I'm trying to do this:
optional :mapping, type: Hash, documentation: { is_array: true } do
requires :from, type: String, desc: 'Mapping done from'
requires :to, type: String, desc: 'Mapping goes to'
end
relevant line in doc_methods.rb
:
allowMultiple: is_array && data_type != 'array' && %w(query header path).include?(param_type)
What am I missing here? And why can't multiple values be in the body? Thanks.
from grape-swagger.
impmented in actual versions
from grape-swagger.
Related Issues (20)
- How to document dynamic hashes in response?
- The generated swagger_doc.json filename is malformatted.
- Does not detect Wildcard Segments as Path Parameters
- Override Grape Entity Model Description
- changes to default web server broke my build
- Does Not Handle Rails Optional Path Segments
- Does not handle file Parameters
- Does not support query array parameters HOT 1
- Should not document examples for non-schema parameters
- Duplicate OperationIds
- Default Global param_type
- Unable to load all the api end points or call api in grape api swagger.
- new release soon ? HOT 1
- Params extension does not work when param_type is body HOT 2
- Add support for primitive data types in responses HOT 4
- Should the minimum, maximum values be only Integer type?
- Should rack-test be considered an optional dependency? HOT 1
- Restore Ruby 3.0 support? HOT 2
- Support to OpenAPI/Swagger 3? HOT 1
- Wrong route ordering HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grape-swagger.