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

fix: makes populating instance variables accessible to subclasses #4434

Merged
merged 2 commits into from
Jun 23, 2023
Merged
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 @@ -97,27 +97,36 @@ public class Reader implements OpenApiReader {
private static final String OPTIONS_METHOD = "options";

public Reader() {
this.openAPI = new OpenAPI();
paths = new Paths();
openApiTags = new LinkedHashSet<>();
components = new Components();
setConfiguration(new SwaggerConfiguration().openAPI(openAPI));

this(new OpenAPI(), new Paths(), new LinkedHashSet<>(), new Components());
}

public Reader(OpenAPI openAPI) {
this();
setConfiguration(new SwaggerConfiguration().openAPI(openAPI));
this(openAPI, new Paths(), new LinkedHashSet<>(), new Components());
}

public Reader(OpenAPIConfiguration openApiConfiguration) {
this();
this(new OpenAPI(), new Paths(), new LinkedHashSet<>(), new Components(), openApiConfiguration);
}

protected Reader(OpenAPI openAPI, Paths paths, Set<Tag> openApiTags, Components components) {
this(openAPI, paths, openApiTags, components, new SwaggerConfiguration().openAPI(openAPI));
}

protected Reader(OpenAPI openAPI, Paths paths, Set<Tag> openApiTags, Components components, OpenAPIConfiguration openApiConfiguration) {
this.openAPI = openAPI;
this.paths = paths;
this.openApiTags = openApiTags;
this.components = components;
setConfiguration(openApiConfiguration);
}


public OpenAPI getOpenAPI() {
return openAPI;
}
protected Set<Tag> getOpenApiTags() { return openApiTags; }
protected Components getComponents() { return components; }
protected Paths getPaths() { return paths; }

/**
* Scans a single class for Swagger annotations - does not invoke ReaderListeners
Expand Down Expand Up @@ -1306,7 +1315,7 @@ private void setPathItemOperation(PathItem pathItemObject, String method, Operat
}
}

private void setOperationObjectFromApiOperationAnnotation(
protected void setOperationObjectFromApiOperationAnnotation(
Operation operation,
io.swagger.v3.oas.annotations.Operation apiOperation,
Produces methodProduces,
Expand Down
Loading