google / google/gnostic

Register custom message as schema rather than reference

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

Description

It seems that for "well known" types, such as `google.protobuf.Timestamp`, the generated OpenAPI 3.0 document contains a inline schema (format date-time) instead of a reference, which is a nice feature.

I was wondering, if the same is possible for custom defined messages? Background: We are using our own `Timestamp` implementation (which is basically a wrapper around `google.protobuf.Timestamp`) because we need to implement `sql.Valuer` and `sql.Scanner` on it. When I use it, it always gets generated as a separate schema with a reference, in which clients think that the field contains an object, whereas it only should contain a `date-time` formatted strings.

Seems somehow related to #351, although #351 refers to another "well-known" type.

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.