Commit Graph

71 Commits

Author SHA1 Message Date
Blake Erickson
989aab656f
Revert "Add a macro for complexes multiparts" 2021-03-06 14:52:49 -07:00
Blake Erickson
f7036b7e5a
Merge pull request #300 from sobrinho/master
Add a macro for complexes multiparts
2021-03-06 10:22:54 -07:00
Donatas Povilaitis
cbaf6cd3e4 Fix response examples 2021-01-29 20:47:46 +02:00
Jamie Macey
c161de3899 Merge branch 'spec-deprecations' into jamie 2020-10-17 13:43:00 -07:00
Jamie Macey
0a9487b328 make spec output less noisy 2020-10-17 13:34:17 -07:00
Jamie Macey
b3fa5ba54e Merge remote-tracking branch 'psmandzich/master' into jamie 2020-10-17 13:21:28 -07:00
Jamie Macey
7e2c52b242 Merge remote-tracking branch 'olegkyz/bugfix/examples-content' into jamie 2020-10-17 13:14:47 -07:00
psmandzich
347f9da32e enable swagger empty body responses 2020-07-21 09:50:47 +02:00
Oleg Yakovenko
1ff396fb56 example group helper adjustment 2020-06-04 17:17:30 +03:00
Graceful Potato
3b85f09acf Fix RoutePareser#routes and add spec for it 2020-05-26 02:01:38 +03:00
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
d644a91da5 Remove all commented code. Add "nullable" 2020-04-04 23:37:38 +01:00
Greg Myers
b158f1e164 add specific test for formData 2020-04-04 23:05:26 +01:00
Greg Myers
2af7c13e59 feature handle in: :body and :formData params 2020-04-04 22:53:23 +01:00
Greg Myers
cbc7a33ac3 feature remove trailing produces and consumes 2020-04-04 21:25:17 +01:00
Greg Myers
f1f8b0ed18 fix oauth corrections correct way round 2020-04-04 21:03:04 +01:00
Greg Myers
96fc5276c4 add oauth flow renaming and warnings 2020-04-04 20:55:04 +01:00
Greg Myers
d66be41d04 Fix oauth2 transform keys except type 2020-04-04 20:43:31 +01:00
Greg Myers
405ccca494 Add upgrades for consumes and produces in content with schemas 2020-03-26 23:37:00 +00:00
Greg Myers
3393263df7 Remove duplicate test block 2020-03-26 22:17:16 +00:00
Greg Myers
6b4f49aacb Basic rubocops 2020-03-24 16:02:13 +00:00
Greg Myers
5060697761 add conversion oauth flow to flows 2020-03-24 15:20:15 +00:00
Greg Myers
231a2d135c add rewrite for securitySchemes into swagger_doc 2020-03-24 14:56:24 +00:00
Greg Myers
e9aebe6221 fix mistake in assigning header nodes for type 2020-03-22 23:45:47 +00:00
Greg Myers
eb58fe687a add upgrade for basepath and host to server urls 2020-03-22 23:39:48 +00:00
Greg Myers
da230a4f3e add header type schema support for openapi3 2020-03-21 23:17:00 +00:00
Greg Myers
a25307dc69 add support for openapi 3 securitySchemas 2020-03-21 23:14:58 +00:00
Greg Myers
9414ca16b6 add upgrade parameters refs to openapi3 2020-03-21 22:38:49 +00:00
Greg Myers
70eb277e04 add upgrade path and query param type output to openapi3 if selected 2020-03-21 21:38:09 +00:00
Greg Myers
23a1074d07 Add tests for OA3 components/schemas loader with upgrade notice 2020-03-21 20:24:04 +00:00
Greg Myers
b5e210cd96 Merge branch 'openapi/master' into openapi/merge 2020-03-20 15:38:40 +00:00
Rutger Gelling
f331e064fd Add yaml support (#7) 2020-01-27 20:24:27 -05:00
Karl Johansson
4c613af2ba Allow tests to be run without generating docs
By providing the 'document: false' metadata, tests will be run but no swagger
documentation will be generated for the tagged example groups. It works on all
kinds of example groups (responses, verbs, paths etc..).
2019-11-15 16:21:04 +01:00
Greg Myers
acab437a7d Add failing test showing Psych errors 2019-11-02 12:55:09 +00:00
Greg Myers
0e04635b15 Write the files using specified format 2019-11-02 11:19:01 +00:00
Greg Myers
73b84101cc Adding yaml as option for generator
New installations will get :yaml as it's default with openapi 3 as the
version. Old installations will have the key missing and will default
to :json with an easy upgrade path.
2019-11-02 10:45:38 +00:00
Nathan Broadbent
e5eb44191c Use RSpec.describe to fix IRB context warning in Rails console 2019-10-17 16:40:31 +07:00
Greg Myers
4d29e09010 Add spec generator test 2019-10-16 23:19:24 +01:00
Peter McCready
5c9154864e add options and trace verbs 2019-10-04 14:51:41 +01:00
Jay Danielian
13f7007b2f Renames and fixes specs in api and specs project to prefix OpenApi module. Gem name to open_api-rswag 2019-07-27 14:53:01 -04:00
Jay Danielian
4baf5efd11 Updates specs to add 3.0 compliant structure and tests around the new schema/structure 2019-07-20 12:29:44 -04:00
Jay Danielian
04564d933f Fixes example group helpers spec with new 3.0 format 2019-07-18 22:19:10 -04:00
Jay Danielian
aa59c5ff91 Fixes response validators specs for v3 structure 2019-07-18 22:01:00 -04:00
Jay Danielian
297cc447c8 Gets v3 request example saving as well as response example saving
Adds rubocop to the gemset

adds guard to the gemset for testing
2019-07-05 15:59:47 -04:00
domaindrivendev
26a3bf5079 avoid metadata mutation in request_factory 2018-04-23 16:00:07 -07:00
Andrey Kurashev
05e1e2271f Fix Authorization header missing and duplicating 2018-02-20 14:49:13 +06:00
domaindrivendev
06d00de992 Assume symbol for referenced parameter key 2017-09-06 13:38:36 -07:00
domaindrivendev
ad9cd5de66 Support paired security requirements - e.g. basic and apiKey 2017-08-21 01:07:47 -07:00
Travis Hooper
037c0e374a Allows for parameters to be defined without the 'in' key defined to allow for parameter 2017-07-31 17:44:43 -05:00
domaindrivendev
732cab994c simplify validation blocks and use correct scope 2017-07-21 22:26:14 -07:00