google / google/gnostic

Generate enum with values when using protoc-gen-openapi

Open
#255 3 comments 7 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.3k
Forks
279
PR merge metrics
No merged PRs in 30d

Description

Thanks for this helpful tool.

I come across this issue when I'm using protoc-gen-openapi plugin to generate OpenAPI3 specification from protobuf definition.

I have a State type and fields of State type are marked with `enum` format.

```protobuf
enum State {
state1 = 0;
state2 = 1;
state3 = 2;
}
```

```yaml
state:
type: integer
format: enum
```

However, for `enum` in OpenAPI3 should be

```yaml
state:
type: integer
enum:
- 0
- 1
- 2
```

Is there any feature that we can configure to generate `enum` schema?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.