swagger-api / swagger-api/swagger-codegen

[RUBY] Bug generated code does not have inheritance

Open
#12,348 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I am trying to generate ruby code for the .json file provided below. It generates fine, but the code that comes out of it does not have any inheritance, while in the code it uses super, so it should clearly have that. When I try to generate the c# code for it, it does have the expected (not sure if it's correct yet) inheritance. Examples

[DataContract]
        public partial class AuthenticationCommand : Command,  IEquatable<AuthenticationCommand>, IValidatableObject
class AuthenticationCommand
    attr_accessor :action_uid

    attr_accessor :pwd

    attr_accessor :user_name

    .....

    def initialize(attributes = {})
      # call parent's initialize
      super(attributes)
Swagger-codegen version

wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.52/swagger-codegen-cli-3.0.52.jar -O swagger-codegen-cli.jar

3.0.52

Swagger declaration file content or url

https://gist.github.com/Ruubb/0724a4d471f4363ebedde7ff6006fce9

Command line used for generation

java -jar swagger-codegen-cli.jar generate -i openapi_clean.json -l ruby -o /path/

Steps to reproduce
  1. Download right swagger version
  2. Download json file
  3. Run the command provided above
  4. Look at the generated Ruby code
Related issues/PRs

N/A

Suggest a fix/enhancement

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Ruby generation with swagger-codegen-cli 3.0.52, the provided command, and the linked OpenAPI JSON. Compare AuthenticationCommand and its super call with the generated C# inheritance, then verify that the Ruby output represents the expected inheritance consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, ruby
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.