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
  • #2100
Closed
Open
Issue created Feb 09, 2019 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG] The generated Ruby client's code violates its own Rubocop rule.

Created by: autopp

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

The generated Ruby client's code violates its own Rubocop rule.

openapi-generator version
$ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar version
4.0.0-SNAPSHOT

$ git log --oneline -n 1
0b10092262 (HEAD -> master, origin/master, origin/HEAD, autopp/master) [python-flask] [python-aiohttp] [bug] Fixed handling of dotted module names (#2041)
OpenAPI declaration file content or url
swagger: "2.0"
info:
  title: "Example API"
  version: "1.0.0"
host: "example.com"
paths:
  /foo:
    get:
      responses:
        200:
          description: ''
Command line used for generation
$ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate --skip-validate-spec -g ruby -o /tmp/gem -i 'https://gist.githubusercontent.com/autopp/86b54a836b45332da307b2a998d9cd1f/raw/2d4d7ce07450a5a99d9dc32bc12449a9eac5afce/example.yml'
Steps to reproduce
  1. Run the above command to generate client code for Ruby.
  2. Go to /tmp/gem and run rubocop to check style of the generated model code.
  3. Get warning in lib/openapi_client/api/default_api.rb:
    $ (cd /tmp/gem; rubocop)
    Inspecting 13 files
    ........C....
    
    Offenses:
    
    lib/openapi_client/api/default_api.rb:61:1: C: Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body end.
    
    13 files inspected, 1 offense detected
Related issues/PRs

N/A

Suggest a fix

Just fix this: https://github.com/OpenAPITools/openapi-generator/blob/0b1009226276a4869cc3b9dc6a17cd0b143741a9/modules/openapi-generator/src/main/resources/ruby-client/api.mustache#L191

Assignee
Assign to
Time tracking