diff --git a/core/src/main/java/io/smallrye/openapi/runtime/io/headers/HeaderIO.java b/core/src/main/java/io/smallrye/openapi/runtime/io/headers/HeaderIO.java index aa7f19591..289538054 100644 --- a/core/src/main/java/io/smallrye/openapi/runtime/io/headers/HeaderIO.java +++ b/core/src/main/java/io/smallrye/openapi/runtime/io/headers/HeaderIO.java @@ -69,6 +69,7 @@ public Optional write(Header model) { return optionalJsonObject(model).map(node -> { if (isReference(model)) { setReference(node, model); + setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); } else { setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); setIfPresent(node, PROP_REQUIRED, jsonIO().toJson(model.getRequired())); diff --git a/core/src/main/java/io/smallrye/openapi/runtime/io/links/LinkIO.java b/core/src/main/java/io/smallrye/openapi/runtime/io/links/LinkIO.java index 57271723b..84fc80ab7 100644 --- a/core/src/main/java/io/smallrye/openapi/runtime/io/links/LinkIO.java +++ b/core/src/main/java/io/smallrye/openapi/runtime/io/links/LinkIO.java @@ -61,6 +61,7 @@ public Optional write(Link model) { return optionalJsonObject(model).map(node -> { if (isReference(model)) { setReference(node, model); + setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); } else { setIfPresent(node, PROP_OPERATION_REF, jsonIO().toJson(model.getOperationRef())); setIfPresent(node, PROP_OPERATION_ID, jsonIO().toJson(model.getOperationId())); diff --git a/core/src/main/java/io/smallrye/openapi/runtime/io/media/ExampleObjectIO.java b/core/src/main/java/io/smallrye/openapi/runtime/io/media/ExampleObjectIO.java index dbabaa0f0..3f42d1cc9 100644 --- a/core/src/main/java/io/smallrye/openapi/runtime/io/media/ExampleObjectIO.java +++ b/core/src/main/java/io/smallrye/openapi/runtime/io/media/ExampleObjectIO.java @@ -56,6 +56,8 @@ public Optional write(Example model) { return optionalJsonObject(model).map(node -> { if (isReference(model)) { setReference(node, model); + setIfPresent(node, PROP_SUMMARY, jsonIO().toJson(model.getSummary())); + setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); } else { setIfPresent(node, PROP_SUMMARY, jsonIO().toJson(model.getSummary())); setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); diff --git a/core/src/main/java/io/smallrye/openapi/runtime/io/parameters/ParameterIO.java b/core/src/main/java/io/smallrye/openapi/runtime/io/parameters/ParameterIO.java index 4f8790790..35e38a2ba 100644 --- a/core/src/main/java/io/smallrye/openapi/runtime/io/parameters/ParameterIO.java +++ b/core/src/main/java/io/smallrye/openapi/runtime/io/parameters/ParameterIO.java @@ -165,6 +165,7 @@ public Optional write(Parameter model) { return optionalJsonObject(model).map(node -> { if (isReference(model)) { setReference(node, model); + setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); } else { setIfPresent(node, PROP_NAME, jsonIO().toJson(model.getName())); setIfPresent(node, PROP_IN, jsonIO().toJson(model.getIn())); diff --git a/core/src/main/java/io/smallrye/openapi/runtime/io/parameters/RequestBodyIO.java b/core/src/main/java/io/smallrye/openapi/runtime/io/parameters/RequestBodyIO.java index a23f2af08..01ca8937c 100644 --- a/core/src/main/java/io/smallrye/openapi/runtime/io/parameters/RequestBodyIO.java +++ b/core/src/main/java/io/smallrye/openapi/runtime/io/parameters/RequestBodyIO.java @@ -113,6 +113,7 @@ public Optional write(RequestBody model) { return optionalJsonObject(model).map(node -> { if (isReference(model)) { setReference(node, model); + setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); } else { setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); setIfPresent(node, PROP_CONTENT, contentIO().write(model.getContent())); diff --git a/core/src/main/java/io/smallrye/openapi/runtime/io/responses/APIResponseIO.java b/core/src/main/java/io/smallrye/openapi/runtime/io/responses/APIResponseIO.java index f4e3d92c1..737c97b36 100644 --- a/core/src/main/java/io/smallrye/openapi/runtime/io/responses/APIResponseIO.java +++ b/core/src/main/java/io/smallrye/openapi/runtime/io/responses/APIResponseIO.java @@ -118,6 +118,7 @@ public Optional write(APIResponse model) { return optionalJsonObject(model).map(node -> { if (isReference(model)) { setReference(node, model); + setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); } else { setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); setIfPresent(node, PROP_HEADERS, headerIO().write(model.getHeaders())); diff --git a/core/src/main/java/io/smallrye/openapi/runtime/io/security/SecuritySchemeIO.java b/core/src/main/java/io/smallrye/openapi/runtime/io/security/SecuritySchemeIO.java index 0dc97999b..d98b3cc94 100644 --- a/core/src/main/java/io/smallrye/openapi/runtime/io/security/SecuritySchemeIO.java +++ b/core/src/main/java/io/smallrye/openapi/runtime/io/security/SecuritySchemeIO.java @@ -74,6 +74,7 @@ public Optional write(SecurityScheme model) { return optionalJsonObject(model).map(node -> { if (isReference(model)) { setReference(node, model); + setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription())); } else { setIfPresent(node, PROP_TYPE, jsonIO().toJson(model.getType())); setIfPresent(node, PROP_DESCRIPTION, jsonIO().toJson(model.getDescription()));