Align model serialisation to handle api #42
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes the model to closely map the handle API. Json from the handle API could be read/validated with the generated code directly. Please see the
examples
folder for ajson
file that is created with the generatred code. It should match the output of the handle API.@prestonrodrigues we may still need to adapt the type info if it does not match your implementation. For this PR I am using the types as in this table.
The adjusted model is less elegant/minimal. It replaces the
PID4CatRecord
class by several classesHandleAPIRecord
,HandleRecord
andHandleData
that are needed to mimic the handle API. However, I think that having a direct match to the handle API makes the model more useful in practice.The generated pydantic code for the model is currently not correct due to a bug in linkml: linkml/linkml#2459
Other changes:
Closes #30