Skip to content

Commit

Permalink
openapi: method names from operationId field
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Dec 7, 2018
1 parent b66a99a commit d684939
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 1 addition & 4 deletions lib/3scale_toolbox/commands/import_command/openapi/method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ def method
end

def friendly_name
"#{operation[:verb].upcase}_#{operation[:path]}"
.tr('}', '_')
.tr('{', '_')
.gsub(%r{/}, '_SLASH_')
operation[:operationId]
end

def system_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def parse_operations(openapi)
openapi.operations.map do |op|
Operation.new(
path: "#{openapi.base_path}#{op.path}",
verb: op.verb
verb: op.verb,
operationId: op.operationId
)
end
end
Expand Down

0 comments on commit d684939

Please sign in to comment.