rspec-openapi 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9534432fc4ab2f67ce016ed07e0c36c687c201e4c1c01388beb4d845a24def6d
4
- data.tar.gz: e7884e1ea34519588d2c008af56faaf7c7435f5c287ec5408515a6b66d16cb7c
3
+ metadata.gz: 0c7805f6dabb952af2af91c519fb185ea61422c22ba16d938a29a040d8cbfedd
4
+ data.tar.gz: 3662b332e329348248b0fb888d2908a47871d5dc3a9cd7a955626b6c0cd81fcf
5
5
  SHA512:
6
- metadata.gz: 50af774aa04fc4fc47a52b89ce4355b313faa5d201796aff05f30fdb275d411b6f1bfcbb7762f3a6363484cec9ab69067c70dba1fc867f163631061d0629c874
7
- data.tar.gz: 7498b91af6496b0d4a500405c194584425ca32276f6c9fedbbe92f431c370a035210f99ec103a33d595dc4f18cc2de361cea98f327a4324d3ebbd23a3bcfbb54
6
+ metadata.gz: dd9e48617b13a14ed573a8e1985b5f6d56ffecc50c36501b536215a2efc0bc44cad9b2719439b40aa4eafd86a39d87de8d6a16eb0a92ac6350d0347b3ea443f6
7
+ data.tar.gz: '0497ef8426997c7fdda69a9a76ca4f36b3bf31ab731312da6ce66e8f59a58390093d5fb851b0854a14ee408df891957cc1237caf491e1b1cbf92e27d600b9a1f'
@@ -1,3 +1,7 @@
1
+ ## v0.1.1
2
+
3
+ * Generate a path like `/{id}` instead of `/:id`
4
+
1
5
  ## v0.1.0
2
6
 
3
7
  * Initial release
data/README.md CHANGED
@@ -29,7 +29,7 @@ $ OPENAPI=1 rspec
29
29
 
30
30
  ### Example
31
31
 
32
- Let's say you have [a request spec](./spec/requests/table_spec.rb) like this:
32
+ Let's say you have [a request spec](./spec/requests/tables_spec.rb) like this:
33
33
 
34
34
  ```rb
35
35
  RSpec.describe 'Tables', type: :request do
@@ -4,7 +4,7 @@ class << RSpec::OpenAPI::SchemaBuilder = Object.new
4
4
  def build(record)
5
5
  {
6
6
  paths: {
7
- record.path => {
7
+ normalize_path(record.path) => {
8
8
  record.method.downcase => {
9
9
  summary: "#{record.controller}##{record.action}",
10
10
  parameters: build_parameters(record),
@@ -107,6 +107,10 @@ class << RSpec::OpenAPI::SchemaBuilder = Object.new
107
107
  end
108
108
  end
109
109
 
110
+ def normalize_path(path)
111
+ path.gsub(%r|/:([^:/]+)|, '/{\1}')
112
+ end
113
+
110
114
  def normalize_content_type(content_type)
111
115
  content_type.sub(/;.+\z/, '')
112
116
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module OpenAPI
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-openapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun