-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Go template for oneOfs with primitive types
A recent enhancement to the template made these primitive types usable as property names, but a small section of the template wasn't updated, leading to compilation problems.
- Loading branch information
Showing
3 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
modules/openapi-generator/src/test/resources/3_0/oneOf_primitive.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
openapi: 3.0.1 | ||
info: | ||
version: 1.0.0 | ||
title: Example | ||
license: | ||
name: MIT | ||
servers: | ||
- url: http://api.example.xyz/v1 | ||
paths: | ||
/example: | ||
get: | ||
operationId: list | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Example" | ||
components: | ||
schemas: | ||
Child: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
Example: | ||
oneOf: | ||
- $ref: '#/components/schemas/Child' | ||
- type: integer | ||
format: int32 |