Skip to content

Commit

Permalink
Merge pull request #1223 from swagger-api/v2-changes-porting
Browse files Browse the repository at this point in the history
V2 changes porting
  • Loading branch information
HugoMario authored Dec 1, 2023
2 parents a0a349a + e3cc21e commit b52a470
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import javax.ws.rs.core.SecurityContext;
{{/jakarta}}
{{#useBeanValidation}}
{{#jakarta}}
import javax.validation.constraints.*;
import jakarta.validation.constraints.*;
{{/jakarta}}
{{^jakarta}}
import javax.validation.constraints.*;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/handlebars/JavaVertXServer/model.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import java.io.Serializable;
{{/serializableModel}}
{{#useBeanValidation}}
{{#jakarta}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
{{/jakarta}}
{{^jakarta}}
import javax.validation.constraints.*;
Expand Down
9 changes: 6 additions & 3 deletions src/main/resources/handlebars/python/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,12 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):

:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
token = ""
if self.username or self.password:
token = urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
return token

def auth_settings(self):
"""Gets Auth Settings dict for api client.
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/handlebars/python/rest.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ class RESTResponse(io.IOBase):

def getheaders(self):
"""Returns a dictionary of the response headers."""
return self.urllib3_response.getheaders()
return self.urllib3_response.headers

def getheader(self, name, default=None):
"""Returns a given response header."""
return self.urllib3_response.getheader(name, default)
return self.urllib3_response.headers.get(name, default)


class RESTClientObject(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class BaseAPI {
* @extends {Error}
*/
export class RequiredError extends Error {
name: "RequiredError"
name = "RequiredError"
constructor(public field: string, msg?: string) {
super(msg);
}
Expand Down

0 comments on commit b52a470

Please sign in to comment.