mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
Move path metadata into 'path_item' hash
This commit is contained in:
@@ -2,9 +2,9 @@ module Rswag
|
||||
module Specs
|
||||
module ExampleGroupHelpers
|
||||
|
||||
def path(path, &block)
|
||||
api_metadata = { path: path}
|
||||
describe(path, api_metadata, &block)
|
||||
def path(template, &block)
|
||||
api_metadata = { path_item: { template: template } }
|
||||
describe(template, api_metadata, &block)
|
||||
end
|
||||
|
||||
[ :get, :post, :patch, :put, :delete, :head ].each do |verb|
|
||||
|
||||
@@ -11,7 +11,7 @@ module Rswag
|
||||
end
|
||||
|
||||
def build_fullpath(example)
|
||||
@api_metadata[:path].dup.tap do |t|
|
||||
@api_metadata[:path_item][:template].dup.tap do |t|
|
||||
t.prepend(@global_metadata[:basePath] || '')
|
||||
parameters_in(:path).each { |p| t.gsub!("{#{p[:name]}}", example.send(p[:name]).to_s) }
|
||||
t.concat(build_query_string(example))
|
||||
|
||||
@@ -56,7 +56,7 @@ module Rswag
|
||||
|
||||
{
|
||||
paths: {
|
||||
metadata[:path] => {
|
||||
metadata[:path_item][:template] => {
|
||||
verb => operation
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user