From 46b32e32cdf28b02659bcb3f816b5bd75857815b Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Sun, 2 Feb 2025 20:38:24 -0800 Subject: [PATCH] Add test case --- openapi3gen/openapi3gen_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openapi3gen/openapi3gen_test.go b/openapi3gen/openapi3gen_test.go index 4d9c1e20..c6c3ad38 100644 --- a/openapi3gen/openapi3gen_test.go +++ b/openapi3gen/openapi3gen_test.go @@ -407,7 +407,8 @@ func ExampleSchemaCustomizer() { InnerFieldWithTag int `mymintag:"-1" mymaxtag:"50"` NestedInnerBla } - Enum2Field string `json:"enum2" myenumtag:"c,d"` + Enum2Field string `json:"enum2" myenumtag:"c,d"` + JsonField json.RawMessage `json:"rawmsg" myjsontag:"raw"` } type Bla struct { @@ -435,6 +436,9 @@ func ExampleSchemaCustomizer() { schema.Enum = append(schema.Enum, s) } } + if tag.Get("myjsontag") != "" { + schema.Description = "description" + } return nil }) @@ -487,6 +491,9 @@ func ExampleSchemaCustomizer() { // "f" // ], // "type": "string" + // }, + // "rawmsg": { + // "description": "description" // } // }, // "type": "object"