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

V2 changes porting #1223

Merged
merged 5 commits into from
Dec 1, 2023
Merged
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 @@ -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