Giter VIP home page Giter VIP logo

Comments (4)

snackycracky avatar snackycracky commented on May 20, 2024

https://github.com/tim-vandecasteele/grape-swagger/pull/96

from grape-swagger.

antek-drzewiecki avatar antek-drzewiecki commented on May 20, 2024

#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.

hut8 avatar hut8 commented on May 20, 2024

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.

LeFnord avatar LeFnord commented on May 20, 2024

impmented in actual versions

from grape-swagger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.