Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #636
Closed
Open
Issue created Jul 24, 2018 by Administrator@rootContributor

[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

Assignee
Assign to
Time tracking