swaggard 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddc21f0ceaac51adcd841ded044bc82165d666e1dc0fb832f86577a02839f21e
4
- data.tar.gz: 1140599ec5d0ef899782beb4aec529ca642114eae19509638c4672a23b2982f7
3
+ metadata.gz: 1027d54356ae054b3765498f191cb2f20bfbbf0f9904ceb303fd4d5c2db22174
4
+ data.tar.gz: 6fb462d05a13551c8c257e62756cd2f5b1e7fcb38165dc7531b06286a9709fd8
5
5
  SHA512:
6
- metadata.gz: 0daa594c72416c1620e20d37da32ad90d4b5c6b5a3e16c8ff063366318d9f4d70c101675c249c23f4ad17b80d77975e5e52c251b9f259a8fae7577c9ac278f45
7
- data.tar.gz: 813fc4f48af7ed3ee726820257f8410247fd96e0059797b6dccc0958b3d0dbb6503c19cb825ce0ddd46125419a365096276f805d88de020d652a247f8255e5b6
6
+ metadata.gz: 0c22983eb886206224a65d7ba44ed909236031af1fdb6d38fab0e99639f68e404765e630b62d176eccb5458d4a72183b9a63e7ba959087348d6058b96dd23e03
7
+ data.tar.gz: 2da94dd7872f071794dc924b4245f1d9b70619b1867f4ba36edaf3a803746ced0d96c75d0fc3b7cb6d29d21fea4804932b0f935a132355bf5fbc78491f1ab30f
@@ -22,7 +22,7 @@ module Swaggard
22
22
  end
23
23
 
24
24
  def empty?
25
- @definition.empty?
25
+ @definition.empty? && @definition_id == @definition.id
26
26
  end
27
27
 
28
28
  def to_request_body
@@ -1,3 +1,3 @@
1
1
  module Swaggard
2
- VERSION = '4.0.1'
2
+ VERSION = '4.0.2'
3
3
  end
@@ -57,6 +57,30 @@
57
57
  "description": "successful operation"
58
58
  }
59
59
  }
60
+ },
61
+ "post": {
62
+ "tags": [
63
+ "pets"
64
+ ],
65
+ "operationId": "create",
66
+ "summary": "create a new Pet",
67
+ "description": "",
68
+ "parameters": [],
69
+ "responses": {
70
+ "default": {
71
+ "description": "successful operation"
72
+ }
73
+ },
74
+ "requestBody": {
75
+ "required": true,
76
+ "content": {
77
+ "application/json": {
78
+ "schema": {
79
+ "$ref": "#/components/schemas/PetBody"
80
+ }
81
+ }
82
+ }
83
+ }
60
84
  }
61
85
  },
62
86
  "/pets/{id}": {
@@ -107,5 +131,27 @@
107
131
  }
108
132
  }
109
133
  }
134
+ },
135
+ "components": {
136
+ "schemas": {
137
+ "PetBody": {
138
+ "type": "object",
139
+ "properties": {
140
+ "name": {
141
+ "type": "string",
142
+ "description": "The name of the Pet"
143
+ },
144
+ "age": {
145
+ "type": "integer",
146
+ "format": "int32",
147
+ "description": "The age of the Pet"
148
+ }
149
+ }
150
+ },
151
+ "PetsController.create_body": {
152
+ "type": "object",
153
+ "properties": {}
154
+ }
155
+ }
110
156
  }
111
157
  }
@@ -13,4 +13,11 @@ class PetsController < ApplicationController
13
13
  def show
14
14
  end
15
15
 
16
+ # create a new Pet
17
+ #
18
+ # @body_required
19
+ # @body_definition PetBody
20
+ def create
21
+ end
22
+
16
23
  end
@@ -0,0 +1,3 @@
1
+ # @attr [string] name The name of the Pet
2
+ # @attr [integer] age The age of the Pet
3
+ class PetBody; end
@@ -1,6 +1,6 @@
1
1
  Dummy::Application.routes.draw do
2
2
 
3
- resources :pets, only: [:index, :show]
3
+ resources :pets, only: [:index, :show, :create]
4
4
 
5
5
  namespace :admin do
6
6
  resources :pets, only: :index
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swaggard
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Gomez
@@ -152,6 +152,7 @@ files:
152
152
  - spec/fixtures/dummy/app/controllers/admin/pets_controller.rb
153
153
  - spec/fixtures/dummy/app/controllers/application_controller.rb
154
154
  - spec/fixtures/dummy/app/controllers/pets_controller.rb
155
+ - spec/fixtures/dummy/app/serializers/pet_body.rb
155
156
  - spec/fixtures/dummy/config/application.rb
156
157
  - spec/fixtures/dummy/config/environments/development.rb
157
158
  - spec/fixtures/dummy/config/routes.rb
@@ -188,6 +189,7 @@ test_files:
188
189
  - spec/fixtures/dummy/app/controllers/admin/pets_controller.rb
189
190
  - spec/fixtures/dummy/app/controllers/application_controller.rb
190
191
  - spec/fixtures/dummy/app/controllers/pets_controller.rb
192
+ - spec/fixtures/dummy/app/serializers/pet_body.rb
191
193
  - spec/fixtures/dummy/config/application.rb
192
194
  - spec/fixtures/dummy/config/environments/development.rb
193
195
  - spec/fixtures/dummy/config/routes.rb