swagger-api / swagger-api/swagger-codegen

[Go] Enhancement to enum support in Go API client and servers

Open
#5,641 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Go Enhancement: Feature Feature: Enum help wanted Server: Go
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Currently, the Go API client and server only supports enum class, e.g.

https://github.com/swagger-api/swagger-codegen/blob/2.3.0/samples/client/petstore/go/go-petstore/enum_test.go

But not enum for property/parameter type (EnumString, EnumNumber, EnumInteger) in enum_test.go

We also want to add some test cases in https://github.com/swagger-api/swagger-codegen/tree/2.3.0/samples/client/petstore/go for enum.

Swagger-codegen version

2.3.0

Swagger declaration file content or url

If anyone has an opinion on supporting enum property/parameter type in Go API client/server, please reply to let us know.

If anyone wants to contribute the test cases, please reply to let us know as well. Thanks.

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 with samples/client/petstore/go/go-petstore/enum_test.go and compare existing enum-class coverage with property and parameter cases such as EnumString, EnumNumber, and EnumInteger. Review how the Go API client and server represent those declarations, then add the requested test cases under samples/client/petstore/go and confirm the generated behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.