Skip to content

Commit

Permalink
Fix linting (#434)
Browse files Browse the repository at this point in the history
* Fix linting for OpenAPI models
* Fix the way Pydantic version is evaluated
  • Loading branch information
tarsil authored Nov 25, 2024
1 parent cf33b0b commit a18a242
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions esmerald/openapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

class APIKey(SecurityScheme):
type: Literal["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"] = Field(
default=SecuritySchemeType.apiKey,
default=SecuritySchemeType.apiKey.value,
alias="type",
)
param_in: APIKeyIn = Field(alias="in")
Expand All @@ -47,7 +47,7 @@ class APIKey(SecurityScheme):

class HTTPBase(SecurityScheme):
type: Literal["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"] = Field(
default=SecuritySchemeType.http,
default=SecuritySchemeType.http.value,
alias="type",
)
scheme: str
Expand All @@ -64,14 +64,14 @@ class OAuthFlow(OpenOAuthFlow):

class OAuth2(SecurityScheme):
type: Literal["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"] = Field(
default=SecuritySchemeType.oauth2, alias="type"
default=SecuritySchemeType.oauth2.value, alias="type"
)
flows: OAuthFlows


class OpenIdConnect(SecurityScheme):
type: Literal["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"] = Field(
default=SecuritySchemeType.openIdConnect, alias="type"
default=SecuritySchemeType.openIdConnect.value, alias="type"
)
openIdConnectUrl: str

Expand Down
2 changes: 1 addition & 1 deletion tests/routing/test_syntax_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from esmerald import Gateway, JSONResponse, get
from esmerald.testclient import create_client

pydantic_version = __version__[:3]
pydantic_version = ".".join(__version__.split(".")[:2])


class ItemType(str, Enum):
Expand Down

0 comments on commit a18a242

Please sign in to comment.