GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — A oneOf/anyOf branch that is an array of an inline enum gets the same type name as its items · Issue #2640 · oapi-codegen/oapi-codegen Open DescriptionWhen a union branch is an array whose items are an inline enum, the branch's type and the items' enum type get the same name ( "A string or a list of strings" ( Reproduction
openapi: 3.0.3 info: {title: t, version: "1"} paths: /items: post: requestBody: content: application/json: schema: type: object properties: roles: oneOf: - {type: string} - {type: array, items: {type: string, enum: [admin, viewer]}} responses: "204": {description: ok} $ oapi-codegen -generate types -package api -o api.gen.go openapi.yaml $ go build ./... ./api.gen.go:21:6: invalid recursive type: PostItemsJSONBodyRoles1 refers to itself ./api.gen.go:24:6: PostItemsJSONBodyRoles1 redeclared in this block ./api.gen.go:21:6: other declaration of PostItemsJSONBodyRoles1 No configuration file; the module requires // PostItemsJSONBodyRoles1 defines parameters for PostItems. type PostItemsJSONBodyRoles1 = []PostItemsJSONBodyRoles1 // PostItemsJSONBodyRoles1 defines parameters for PostItems. type PostItemsJSONBodyRoles1 string On The same It also happens with a single-branch ExpectedTwo distinct types, for example Versionsv2.8.1 and Likely causeAn array's items are generated at the array's own path ( Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |