gnostic icon indicating copy to clipboard operation
gnostic copied to clipboard

OpenAPI V3 schema default type should support any

Open Jefftree opened this issue 3 years ago • 2 comments

I noticed in the code generator for Schema.default, the only acceptable types are bool, string, float, and int. https://github.com/google/gnostic/blob/master/generate-gnostic/generate-compiler.go#L233-L257

The OpenAPI 3.0 schema defines that the default value can be anything (https://github.com/OAI/OpenAPI-Specification/blob/main/schemas/v3.0/schema.json#L513-L514) and does not specify this oneOf clause present in gnostic.

We should be able to support Any for the default

cc @timburks

Jefftree avatar Mar 29 '22 03:03 Jefftree

Makes sense, agreed.

timburks avatar Mar 29 '22 17:03 timburks

have some plan?

dobet avatar Mar 25 '24 09:03 dobet