rspec-openapi 0.3.3 → 0.3.4

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: b483a73ef32d771b4da3e66f3c63d1cd0a1cfbb839752546d5465cda43ff8444
4
- data.tar.gz: cf8ec362c29193e2434db5433170ec655008cd5f636a8f2341f9abf7e7f3d454
3
+ metadata.gz: 72b0193cdb3e3f8ee7b2cf52f1d2211a0b57a2074424323ab595af78693b5563
4
+ data.tar.gz: 021e6b386ffb4ed889bd08e61b8d26030cae32667fd8225f1e6ad24e1345aaf4
5
5
  SHA512:
6
- metadata.gz: de935612cc1afdd9c8ccca7d69711beca33dea36ec97555293978544c9c1a978c04cdc196c42a39888408d7575e40d0d6dff76adf1d629b27512c569feb9b29a
7
- data.tar.gz: 423d62a92e8a9b143fae9304af57d893e079dbc9cb956e17320ea45a3bf30d8084f88395fdeaa835cd8689c3b72ecba2b40812bd9c81a0f044ddf91754169f9c
6
+ metadata.gz: 65e8998e2bcfd5ad2d34bd42477e86474baa3daadc8de07210ae9601c05cdb571306b9e8768d3d50de803fd078e167592febea3f820df294e3807e09f0c0c2fd
7
+ data.tar.gz: 1b9fee7f0277f71d4364ee7d39679749c941afcf3fd79df0180abf7510379b9d06e7f9ce24f0cb686f258204c205251f0d50b7211706f82e62f27f1ebc2ff0ce
@@ -1,3 +1,8 @@
1
+ ## v0.3.4
2
+
3
+ * Generate tags by controller names
4
+ [#10](https://github.com/k0kubun/rspec-openapi/issues/10)
5
+
1
6
  ## v0.3.3
2
7
 
3
8
  * Avoid `JSON::ParserError` when a response body is no content
data/README.md CHANGED
@@ -65,15 +65,19 @@ paths:
65
65
  "/tables":
66
66
  get:
67
67
  summary: 'tables #index'
68
+ tags:
69
+ - tables
68
70
  parameters:
69
71
  - name: page
70
72
  in: query
71
73
  schema:
72
74
  type: integer
75
+ example: 1
73
76
  - name: per
74
77
  in: query
75
78
  schema:
76
79
  type: integer
80
+ example: 10
77
81
  responses:
78
82
  '200':
79
83
  description: returns a list of tables
@@ -6,6 +6,7 @@ RSpec::OpenAPI::Record = Struct.new(
6
6
  :request_params, # @param [Hash] - {:request=>"body"}
7
7
  :request_content_type, # @param [String] - "application/json"
8
8
  :summary, # @param [String] - "v1/statuses #show"
9
+ :tags, # @param [Array] - ["Status"]
9
10
  :description, # @param [String] - "returns a status"
10
11
  :status, # @param [Integer] - 200
11
12
  :response_body, # @param [Object] - {"status" => "ok"}
@@ -19,6 +19,7 @@ class << RSpec::OpenAPI::RecordBuilder = Object.new
19
19
  route = find_rails_route(request)
20
20
  path = route.path.spec.to_s.delete_suffix('(.:format)')
21
21
  summary = "#{route.requirements[:controller]} ##{route.requirements[:action]}"
22
+ tags = [route.requirements[:controller]]
22
23
  else
23
24
  path = request.path
24
25
  summary = "#{request.method} #{request.path}"
@@ -39,6 +40,7 @@ class << RSpec::OpenAPI::RecordBuilder = Object.new
39
40
  request_params: raw_request_params(request),
40
41
  request_content_type: request.content_type,
41
42
  summary: summary,
43
+ tags: tags,
42
44
  description: RSpec::OpenAPI.description_builder.call(example),
43
45
  status: response.status,
44
46
  response_body: response_body,
@@ -20,6 +20,7 @@ class << RSpec::OpenAPI::SchemaBuilder = Object.new
20
20
  normalize_path(record.path) => {
21
21
  record.method.downcase => {
22
22
  summary: record.summary,
23
+ tags: record.tags,
23
24
  parameters: build_parameters(record),
24
25
  requestBody: build_request_body(record),
25
26
  responses: {
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module OpenAPI
3
- VERSION = '0.3.3'
3
+ VERSION = '0.3.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-openapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-11 00:00:00.000000000 Z
11
+ date: 2020-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack