-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
A compilation error occurs in the generated code when using the oneof field.
By checking the template, we found that the corresponding complextype is empty.
As you can see from the picture below, something was missing.
openapi-generator version
7.4.0 (7.3.0 also tried)
OpenAPI declaration file content or url
openapi: 3.0.1
info:
title: SDK API
description: SDK API
version: 1.0.0
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://test.com:443
paths:
/sdk/test:
get:
tags:
- test
summary: test
description: test
operationId: test
responses:
'200':
$ref: '#/components/responses/TestResponse'
components:
responses:
TestResponse:
description: test return
content:
application/json:
schema:
allOf:
- type: object
properties:
data:
type: object
description: test
properties:
rule_config:
type: object
description: test
properties:
operator:
oneOf:
- type: array
items:
type: string
- type: string
example: 'gt'
description: test operatorGeneration Details
Target Language: Java
Config.yaml:
additionalProperties:
withAWSV4Signature: true
library: okhttp-gson
useBeanValidation: true
useSingleRequestParameter: true
apiPackage: com.sdk.v2018
modelPackage: com.sdk.v2018.model
artifactDescription: SDK for Java
artifactId: sdk2018
artifactVersion: 1.0.0
useOneOfInterfaces: trueSteps to reproduce
- generate sdk using openapi-generator-cli
- pack sdk code to jar using maven
Related issues/PRs
Suggest a fix
I guess there may be a problem with the template or a problem with complextype processing in the children of the oneOf filed.
the anyof filed probably has the same problem.
