swagger-api / swagger-api/swagger-codegen

Doesn't generate interfaces and Enums for GET request (from parameters)

Open
#9,408 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

There are no ways to generate TypeScript interfaces and Enums for GET API request (form parameters).
[JAVA] Now TypeScript models generated only for model based request (PUT/POST etc), but it should be an option to generate models that are in controller despite on the request method.

Description

Is it possible to generate interfaces based on controller and model, maybe with some decorator?-

Swagger-codegen version

2.4.4, Java8

Swagger declaration file content or url

{
"parameters": [ ...... { "name": "sort", "in": "query", "required": false, "type": "string", "enum": [ "CREATE_DATE_ASC", "CREATE_DATE_DESC", ....... ] }
Parameters does't make any sense for compiler if method is GET, it's only generate models for those routes which have POST/PUT/UPDATE requests.

Suggest a fix/enhancement

Does anyone know how to generate models from request parameters?

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

No source files or tests are identified in the issue. Start by tracing Swagger Codegen's TypeScript model generation for GET operations and query parameters, comparing it with POST/PUT model generation. Done means an option or defined behavior generates TypeScript interfaces and enum models from GET parameters, including the shown query enum.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.