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

Apply a schema to the holding model #880

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Apply a schema to the holding model #880

wants to merge 1 commit into from

Conversation

jcoyne
Copy link
Contributor

@jcoyne jcoyne commented May 16, 2023

This helps us enforce the shape of the data and highlights the fields we think are important.

This helps us enforce the shape of the data and highlights the fields we think are important.
@cbeer
Copy link
Member

cbeer commented May 18, 2023

I'm pretty -0 to this. It feels like a pretty complicated solution where either not using fetch or providing a default argument would seem to do just as well.

I also think there's value in keeping our code pretty close to the FOLIO data structure for talking to our colleagues in libsys + metadata about where/how we're mapping data. The abstraction seems like forces a deeper understading of the code, doesn't it?

@jcoyne
Copy link
Contributor Author

jcoyne commented May 18, 2023

I also think there's value in keeping our code pretty close to the FOLIO data structure for talking to our colleagues in libsys + metadata about where/how we're mapping data.

Indeed. I did this by looking at the RAMLs that folio publishes. These data structures are derived from that definition.

quicktype -s schema ramls/holdingsrecord.json --namespace FolioTypes -o types.rb

@cbeer
Copy link
Member

cbeer commented May 18, 2023

Interesting. I feel like I need to know more about what it's doing.. the camel case -> snake case is fine, but suppressFromDiscovery turning into discovery_suppress, location/effectiveLocation getting collapsed, etc surprise me.

@jcoyne
Copy link
Contributor Author

jcoyne commented May 18, 2023

suppressFromDiscovery was not in the raml model. That is something we extract from the jsonb in the query, so I had to add that myself. I collapsed effectiveLocation as that is the only location that we're currently using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants