OpenAPITools / OpenAPITools/openapi-generator

protobuf model not support array enum

Open
#16,815 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

protobuf-schema template , model not support array enum

openapi-generator version

all version

OpenAPI declaration file content or url
          "clientList": {
            "type": "array",
            "description": "client name",
            "items": {
              "type": "string",
              "description": "client name",
              "enum": [
                "APP",
                "M",
                "PC"
              ]
            }
          }
Command line used for generation
Steps to reproduce
Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/14892

https://github.com/Lo0on/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache

Suggest a fix/enhancement

modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache row 32 update
{{#vendorExtensions.x-protobuf-type}}{{{.}}} {{/vendorExtensions.x-protobuf-type}}{{enumName}} {{name}} = {{vendorExtensions.x-protobuf-index}};

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 modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache around line 32 and review related issue #14892. Check how the provided array-of-enum declaration is rendered by the protobuf-schema model template. Done means the generated model correctly supports the clientList array enum case.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.