Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #10891
Closed
Open
Issue created Nov 18, 2021 by Administrator@rootContributor

[REQ][Protobuf-Schema] Add unknown to enum (index from 1)

Created by: Yurzel

Is your feature request related to a problem? Please describe.

Option to fill the gap if you need to start at index 1. Protobuf needs to start at 0 as it is default value for enums. see: https://developers.google.com/protocol-buffers/docs/overview#enum

/*
  The version of the OpenAPI document: 1.0

  Generated by OpenAPI Generator: https://openapi-generator.tech
*/

syntax = "proto3";

package Random.Namespace;


enum MyNumbersEnum {
  ZERO = 0;
  ONE = 1;
  TWO = 2;
}

Describe the solution you'd like

Generate something like this.

/*
  The version of the OpenAPI document: 1.0

  Generated by OpenAPI Generator: https://openapi-generator.tech
*/

syntax = "proto3";

package Random.Namespace;


enum MyNumbersEnum {
  UNKNOWN = 0;
  ZERO = 1;
  ONE = 2;
  TWO = 3;
}
Assignee
Assign to
Time tracking