rspec-openapi 0.1.0 → 0.1.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/rspec/openapi/schema_builder.rb +5 -1
- data/lib/rspec/openapi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c7805f6dabb952af2af91c519fb185ea61422c22ba16d938a29a040d8cbfedd
|
4
|
+
data.tar.gz: 3662b332e329348248b0fb888d2908a47871d5dc3a9cd7a955626b6c0cd81fcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd9e48617b13a14ed573a8e1985b5f6d56ffecc50c36501b536215a2efc0bc44cad9b2719439b40aa4eafd86a39d87de8d6a16eb0a92ac6350d0347b3ea443f6
|
7
|
+
data.tar.gz: '0497ef8426997c7fdda69a9a76ca4f36b3bf31ab731312da6ce66e8f59a58390093d5fb851b0854a14ee408df891957cc1237caf491e1b1cbf92e27d600b9a1f'
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -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
|