Skip to content
Open
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 @@ -60,7 +60,7 @@ List<ParameterDefinition> getParameters() {
List<ParameterDefinition> paramDefinitions = new ArrayList<>();
if (operation.hasParameters()) {
for (UnifiedOpenAPI.Parameter parameter : operation.parameters()) {
if (parameter.in().equals("body")) {
if ("body".equals(parameter.in())) {
continue; // body parameters are handled separately
}

Expand All @@ -70,13 +70,14 @@ List<ParameterDefinition> getParameters() {
}
}

if (openAPI.swaggerVersion().equals(UnifiedOpenAPI.SwaggerVersion.SWAGGER_V2)) {
if (openAPI.swaggerVersion() == UnifiedOpenAPI.SwaggerVersion.SWAGGER_V2
&& operation.parameters() != null) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&& operation.parameters() != null) {
&& operation.hasParameters()) {

operation.parameters().stream()
Comment on lines +73 to 75
.filter(p -> p.in().equals("body"))
.filter(p -> "body".equals(p.in()))
.forEach(
p -> {
UnifiedOpenAPI.Schema schema = p.schema();
if (schema.hasRef()) {
if (schema != null && schema.hasRef()) {
String ref = schema.ref();
schema = openAPI.resolveSchema(ref);
}
Comment thread
fjtirado marked this conversation as resolved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public boolean hasRequestBody() {
}
}

public record Parameter(String name, String in, Boolean required, Schema schema) {}
public record Parameter(String name, String in, boolean required, Schema schema) {}
Comment thread
fjtirado marked this conversation as resolved.

public record RequestBody(Content content) {}

Expand Down
Loading