-
-
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
The oneOf & anyOf models for the java-client generator are broken because of missing import class for complex data type
openapi-generator version
The version 6.1.x and the latest master branch (6.2.0)
OpenAPI declaration file content or url
openapi: 3.0.0
info:
title: oneOf schemas
version: "1.0.0"
paths:
/:
get:
summary: Empty Route
responses:
"200":
description: Good Request.
content:
application/json:
schema:
$ref: '#/components/schemas/ReturnValue'
"400":
description: Bad Request.
components:
schemas:
ReturnValue:
oneOf:
- type: string
- type: string
format: date-time
- type: integerGeneration Details
Command line used for generation
openapi-generator-cli generate \
-g java --library native \
-i name_of_file.yaml \
-o myApiSteps to reproduce
- Issues in the generated client:
public class ReturnValue extends AbstractOpenApiSchema {
...
// deserialize OffsetDateTime
...
deserialized = tree.traverse(jp.getCodec()).readValueAs(OffsetDateTime.class);
...
}- Maven build failed "illegal start of type"
Related issues/PRs
Suggest a fix
Should add import java.time.OffsetDateTime; for OffsetDateTime
Reactions are currently unavailable