-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #448 from bcgov/feature/pydantic2Update
Updated version of FastAPI (migrate to Pydantic2 and others)
- Loading branch information
Showing
13 changed files
with
67 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
from typing import List, Optional | ||
from pydantic import BaseModel, Field | ||
from pydantic import BaseModel, ConfigDict, Field | ||
|
||
|
||
class ServiceDecorator(BaseModel): | ||
# https://github.com/hyperledger/aries-rfcs/tree/main/features/0056-service-decorator | ||
recipient_keys: Optional[List[str]] = Field(alias="recipientKeys") | ||
routing_keys: Optional[List[str]] = Field(alias="routingKeys") | ||
service_endpoint: Optional[str] = Field(alias="serviceEndpoint") | ||
recipient_keys: Optional[List[str]] = Field(default=None, alias="recipientKeys") | ||
routing_keys: Optional[List[str]] = Field(default=None, alias="routingKeys") | ||
service_endpoint: Optional[str] = Field(default=None, alias="serviceEndpoint") | ||
|
||
class Config: | ||
allow_population_by_field_name = True | ||
model_config = ConfigDict(populate_by_name=True) | ||
|
||
|
||
class OOBServiceDecorator(ServiceDecorator): | ||
# ServiceDecorator | ||
recipient_keys: Optional[List[str]] | ||
recipient_keys: Optional[List[str]] = None | ||
routing_keys: Optional[List[str]] = Field(default=[]) | ||
service_endpoint: Optional[str] | ||
service_endpoint: Optional[str] = None | ||
id: str = Field(default="did:vc-authn-oidc:123456789zyxwvutsr#did-communication") | ||
type: str = Field(default="did-communication") | ||
priority: int = 0 | ||
|
||
class Config: | ||
allow_population_by_field_name = True | ||
model_config = ConfigDict(populate_by_name=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.