Commit Graph

13 Commits

Author SHA1 Message Date
Gabriel Sobrinho
f8dbd98bbc
Add a macro for complexes multiparts
This will allow to describe multipart in a short way, like JSON payload:

Before:

    put 'Creates a blog with thumbnail' do
      consumes 'multipart/form-data'
      parameter name: :title, in: :formData, type: :string, required: true
      parameter name: :content, in: :formData, type: :string, required: true
      parameter name: :file, in: :formData, type: :file, required: true

      let(:blog) { FactoryBot.build(:blog) }
      let(:title) { blog.title }
      let(:content) { blog.content }
      let(:file) { blog.file }

      ...
    end

After:

    put 'Creates a blog with thumbnail' do
      consumes 'multipart/form-data'
      parameter name: :blog, in: :formData, schema: { '$ref' => '#/definitions/blog' }

      let(:blog) { FactoryBot.attributes_for(:blog) }

      ...
    end

Your mileage may vary but you can always choose the best option.
2020-04-16 22:38:35 -03:00
Greg Myers
b5e210cd96 Merge branch 'openapi/master' into openapi/merge 2020-03-20 15:38:40 +00:00
Jay Danielian
032ad5dc54 Fixes last little pathing mistakes from rename
All specs are passing in all gems and in test-app

Properly generates open api 3 swagger via rake rswag:specs:swaggerize and via bundle exec rspec in test-app dir
2019-08-01 09:10:38 -04:00
Jay Danielian
b8dcc8fe30 Adds support for proper requestBody examples. Adds mechanism to allow for adding additional ways to add request body examples
Can add externalValue or  it will work and produce valid swagger spec.

The Symbol name matching the let parameter is always required
2019-07-21 15:03:37 -04:00
Jay Danielian
cd348b53f8 Adds anyOf support to requestBody 2019-07-20 13:50:38 -04:00
domaindrivendev
ad9cd5de66 Support paired security requirements - e.g. basic and apiKey 2017-08-21 01:07:47 -07:00
domaindrivendev
b16198377b Merge branch 'add-formData-support' of https://github.com/thg303/rswag into thg303-add-formData-support 2017-07-21 14:25:29 -07:00
domaindrivendev
97c2a39cfa Refactor request_factory & response_validator 2017-07-20 23:42:40 -07:00
Ali Qanavatian
44840ab836 Merge branch 'master' into add-formData-support 2017-07-04 09:45:33 +04:30
domaindrivendev
de7ec5f15d Leverage security definitions for headers in example requests 2017-06-26 17:52:00 -07:00
ali.q
182ee093f4 add formData support 2017-05-11 05:06:46 +04:30
richie
941b195f68 In .travis.yml, use Rails 3 version that's compatable with Ruby 2.2 2016-10-11 23:00:12 -07:00
richie
c558098c39 rename to rswag plus major refactor - almost a rewrite 2016-10-11 18:31:12 -07:00