-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/mx-1702 update types and schemas (#291)
# PR Context - prep for robert-koch-institut/mex-editor#158 # Added - add pattern constants for vocabs, emails, urls and ids to types module - add regex pattern to json schema of identifier fields - automatically add examples and useScheme to json schema of enum fields # Changes - BREAKING: use `identifier` instead of `stableTargetId` to get merged item from backend - ensure identifier unions are typed to generic `Identifier` instead of the first match - to signal that we don't actually know which of the union types is correct - unify pydantic schema configuration for all types - consistently parse emails, identifiers and temporals in models to their type, not str - consistently serialize emails, ids and temporals in models to str, not their type - make instances of Link type hashable, to harmonize them with Text models # Removed - drop manual examples from enum fields, because they are autogenerated now - BREAKING: remove `MEX_ID_PATTERN` from types, in favor of `IDENTIFIER_PATTERN` - BREAKING: make public `MEX_ID_ALPHABET` constant from identifier module private - BREAKING: remove `__str__` methods from Text and Link classes - BREAKING: drop support for parsing UUIDs as Identifiers, this was unused - BREAKING: drop support for parsing Links from markdown syntax, this was unused - BREAKING: remove pydantic1-style `validate` methods from all type models - BREAKING: `BackendApiConnector.post_models` in favor of `post_extracted_items` --------- Signed-off-by: Nicolas Drebenstedt <[email protected]> Co-authored-by: rababerladuseladim <[email protected]>
- Loading branch information
1 parent
a0f1389
commit 23982bd
Showing
27 changed files
with
415 additions
and
470 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# XXX this is a forward-compatibility hint for feature/model-update-v3: | ||
# when this gets merged with model v3, remove the | ||
# `Annotated[..., Field(examples=["https://mex..."])]` from all enum fields |
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.