Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow summary and description alongside $ref #1841

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public Optional<O> 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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public Optional<O> 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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public Optional<O> 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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public Optional<O> 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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public Optional<O> 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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public Optional<O> 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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public Optional<O> 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()));
Expand Down
Loading