swagger-api / swagger-api/swagger-codegen
isEnum returns false when enum is referenced
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When is defined enum as standalone type and is referenced from elsewhere, template var isEnum is set to false.
Swagger-codegen version
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-cli</artifactId>
<version>2.3.1</version>
</dependency>
Swagger declaration file content or url
definitions:
UIDocumentsOverviewLock:
type: object
properties:
action:
$ref: '#/definitions/InvalidateDocsAction'
InvalidateDocsAction:
type: string
enum:
- FINAL
- INDIVIDUALIZED
- FC_NOT_INDIVIDUALIZED
- FC_AND_INDIVIDUALIZED
Command line used for generation
Steps to reproduce
in mustasche template is isEnum false on property 'action' and should be true because InvalidateDocsAction is defined as enum.
Related issues/PRs
Suggest a fix/enhancement
Checking the referenced class type
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Swagger definition and reproduce generation for the Mustache template, focusing on the referenced property action and its isEnum value. Inspect how the referenced class type is represented during template processing; done means isEnum is true for action because InvalidateDocsAction is defined as an enum.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100