Skip to content

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

@Yurzel

Description

@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;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions