-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Open
Description
Description
We have the following type/object, namely it is a dictionary/map, but it has one custom property, namely 'extras'.
links:
description: Links object
type: object
additionalProperties:
$ref: "#/components/schemas/hrefType"
properties:
extras:
$ref: "#/components/schemas/hrefType"
components:
schemas:
hrefType:
description: Link to a resource
type: string
example: "/test/1234"
The following code will be generated. If we set the property extras via the builder method, it will not be part of the serialized JSON object.
public class Links extends HashMap<String, String> {
@JsonProperty("extras")
private String extras;
public Links extras(String extras) {
this.extras = extras;
return this;
}
// ...
}
openapi-generator version
3.3.1
OpenAPI declaration file content or url
See description.
Command line used for generation
/
Steps to reproduce
/
Related issues/PRs
OpenAPI Generator: #1262
Swagger Code Generator: swagger-api/swagger-codegen#8245
Suggest a fix/enhancement
The generated code, should look like as proposed in the following Stackoverflow answers:
https://stackoverflow.com/a/31321861
https://stackoverflow.com/a/31321821
https://stackoverflow.com/a/44628460
wakedeerwakedeer
Metadata
Metadata
Assignees
Labels
No labels