You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
There is a schema of type number and an attribute uses such schema and set a default. The type number is casted to BigDecimal, but the default is not and compilation fails.
openapi-generator version
Tested with 7.7.0 and 7.8.0-SNAPSHOT (latest docker image)
OpenAPI declaration file content or url
openapi: 3.0.3info:
title: Example API v1description: A reference APIcontact: {}version: 2.0.0paths: {}components:
schemas:
Length:
description: Distance in meters between the beginning and end of a roadway or sub-segment.type: numberminimum: 0.0MySchema:
type: objectproperties:
length:
allOf:
- $ref: "#/components/schemas/Length"default: 0.0
Generation Details
language: java
library: tested without setting library or jersey2
Steps to reproduce
Create the file openapi-example.yml with the content above in the current directory
Bug Report Checklist
Description
There is a schema of type number and an attribute uses such schema and set a default. The type number is casted to BigDecimal, but the default is not and compilation fails.
openapi-generator version
Tested with 7.7.0 and 7.8.0-SNAPSHOT (latest docker image)
OpenAPI declaration file content or url
Generation Details
language: java
library: tested without setting library or jersey2
Steps to reproduce
docker run -v `pwd`:/temp -it openapitools/openapi-generator-cli:latest generate -g java -i /temp/src/main/resources/apis/ols/intermodal/openapi-example.yml -o /temp/build/
Expected:
Actual:
Related issues/PRs
Maybe #12883
Suggest a fix
Not a fix, but the work arounds I found so far:
1: repeat the type in the parameter:
or set
format: double
in the Length schemaThe text was updated successfully, but these errors were encountered: