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

Align model serialisation to handle api #42

Merged
merged 4 commits into from
Jan 16, 2025
Merged

Conversation

dalito
Copy link
Member

@dalito dalito commented Jan 10, 2025

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 a json 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 classes HandleAPIRecord, HandleRecord and HandleData 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

@dalito dalito self-assigned this Jan 10, 2025
@dalito dalito added enhancement New feature or request dependencies Pull requests that update a dependency file labels Jan 10, 2025
@dalito dalito force-pushed the issue30-handle-api-alignment branch from 416842a to 51252ab Compare January 12, 2025 14:20
@dalito dalito force-pushed the issue30-handle-api-alignment branch 4 times, most recently from 4200eeb to 6865cda Compare January 16, 2025 16:08
@dalito dalito marked this pull request as ready for review January 16, 2025 16:41
@dalito dalito force-pushed the issue30-handle-api-alignment branch from e10e3a8 to 4cc2aff Compare January 16, 2025 22:45
@dalito dalito merged commit a0010fd into main Jan 16, 2025
2 checks passed
@dalito dalito deleted the issue30-handle-api-alignment branch January 16, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align model serialisation closer to handle api
1 participant