-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Conversation
public Operation response(int key, Response response) { | ||
this.addResponse(String.valueOf(key), response); | ||
this.addResponse(String.valueOf(key),response); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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; } |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
…o responses-extensions-OAS2
refs issue #719