[ruby-on-rails] Bug generating ruby-on-rails controller
Created by: and0x000
Description
ruby-on-rails generator uses different names for controller class file and controller name in routes.rb
.
I suppose it is related to the usage of tags.
openapi-generator version
3.1.2-SNAPSHOT via docker
OpenAPI declaration file content or url
openapi: 3.0.0
info:
version: 1.0.0
title: asdf
paths:
/foo_bar:
get:
summary: list all foobars
operationId: listFooBar
tags:
- foo_bar
responses:
'200':
description: OK
Command line used for generation
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/codegen_debug.yaml -g "ruby-on-rails" -o /local/out
Steps to reproduce
generate ruby-on-rails stub with the yaml file above.
The command generates route
[...]
add_openapi_route 'GET', '//foo_bar', controller_name: 'fooBar', action_name: 'list_foo_bar'
[...]
but the generated controller file is named foo_bar_controller.rb
Related issues/PRs
unknown
Suggest a fix/enhancement
Use common name for controller in routes.rb
and the actual controller class file