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

Adding Extensions in Responses (OAS2) #2835

Merged
merged 14 commits into from
Jul 2, 2021
Merged

Conversation

gracekarina
Copy link
Contributor

refs issue #719

public Operation response(int key, Response response) {
this.addResponse(String.valueOf(key), response);
this.addResponse(String.valueOf(key),response);
Copy link
Member

Choose a reason for hiding this comment

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

only add to responseObject

public Operation defaultResponse(Response response) {
this.addResponse("default", response);
this.addResponse("default",response);
Copy link
Member

Choose a reason for hiding this comment

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

only add to responseObject

@@ -209,16 +213,53 @@ public void addParameter(Parameter parameter) {
}
this.parameters.add(parameter);
}

@Deprecated
Copy link
Member

Choose a reason for hiding this comment

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

remove this, as deprecation comes from mixin

public Map<String, Response> getResponses() {
return responses;
}

public Responses getResponsesObject() { return responsesObject; }

@Deprecated
Copy link
Member

Choose a reason for hiding this comment

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

remove this, as deprecation comes from mixin

public Map<String, Response> getResponses() {
return responses;
}

public Responses getResponsesObject() { return responsesObject; }
Copy link
Member

Choose a reason for hiding this comment

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

this needs to return responsesObject (converted to Map) or responses depending on null status of the two. see how this is achieved for responseSchema and schema in response

public void addResponse(String key, Response response) {
if (responses == null) {
Copy link
Member

Choose a reason for hiding this comment

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

only add to responseObject

}
}

@Deprecated
Copy link
Member

Choose a reason for hiding this comment

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

remove deprecation

responsesObject.put(key, response);
}

public void addResponseObject(String key, Response response) {
Copy link
Member

Choose a reason for hiding this comment

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

remove method, not needed

@@ -103,7 +103,7 @@ public Swagger path(String key, Path path) {
return this;
}

public Swagger responses(Map<String, Response> responses) {
public Swagger responses(LinkedHashMap<String, Response> responses) {
Copy link
Member

Choose a reason for hiding this comment

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

why is this? keep it instead as Map

@@ -375,7 +375,7 @@ public void addParameter(String key, Parameter parameter) {
return responses;
}

public void setResponses(Map<String, Response> responses) {
public void setResponses(LinkedHashMap<String, Response> responses) {
Copy link
Member

Choose a reason for hiding this comment

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

why is this? keep it instead as Map

@gracekarina gracekarina changed the title Adding Extensions in Paths and Responses (OAS2) Adding Extensions in Responses (OAS2) Jul 1, 2021
@gracekarina gracekarina merged commit b4b9282 into 1.5 Jul 2, 2021
@gracekarina gracekarina deleted the responses-extensions-OAS2 branch February 23, 2022 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants