swagger-api / swagger-api/swagger-codegen

[JS Client] Model classes and index.js have empty values for {{classname}}

Open
#2,441 2 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

I have tried using both 2.1.5 and 2.1.6-SNAPSHOT for generating the JS Client. With both versions, the Model classes and index.js were incorrectly generated. I am using the Petstore Spec and this was generated:

index.js
}(function(ApiClient, , , , , , , UserApi, StoreApi, PetApi) { 'use strict';

Pet.js
root.Petstore. = factory(root.Petstore.ApiClient, root.Petstore.Category, root.Petstore.Tag);

It seems like the {{classname}} is not recognized in the Javascript mustache templates.

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

Reproduce the generated JavaScript client from the Petstore Spec using the reported generator versions, then compare index.js and Pet.js with the JavaScript Mustache templates. Trace the values used for the model classes and index.js imports, and consider the issue done when both files contain the expected class and import names.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.