-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
I'm probably doing something wrong.... #1577
Labels
Comments
I have the feeling that I need to cross reference several other objects ... somehow... |
Thank you for creating the issue.
|
Thank you for looking at this!
Yes.
They have this weird API mode 'qualifier' (called frame¹) that returns valid (according to the schema) JSON, but I don't understand how you're supposed to 'follow the refs' from, for example, the biosample_ontology string to the full underlying object, specified by the biosample_type²
schema document...
¹ `frame=object` will always give you all of the properties, with embedded objects referred to by an identifier. https://www.encodeproject.org/help/rest-api/#search-features
² https://www.encodeproject.org/profiles/biosample_type
Is there some sort of 'lazy load' API xref that can be assigned to that field by the schema?
What's the API definition language?
Actually their documentation shows an example, I'm just not sure how to match the embedded objects referred to by an identifier with the right schema, and _then_ put that in the model as a lazy load...
Anyway, thanks again for your help.
Cheers,
Dan
…On Wed, 4 Oct 2023, 5:47 pm Koudai Aono, ***@***.***> wrote:
Thank you for creating the issue.
I have checked the data and the schema.
I think biosample_ontology should be string. But, the actual type is an
object?
{
"title": "Biosample ontology",
"description": "An embeded property for linking to biosample type which describes the ontology of the biosample.",
"comment": "See biosample_type.json for available identifiers.",
"type": "string",
"linkTo": "BiosampleType"
}
"biosample_ontology": {"status": "released",
—
Reply to this email directly, view it on GitHub
<#1577 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA7NEZQEWLN7RPCRSSU2WTX5WHJRAVCNFSM6AAAAAA5JPDR6GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBXGI4DCMRRGE>
.
You are receiving this because you authored the thread.
Message ID: <koxudaxi/datamodel-code-generator/issues/1577/1747281211@
github.com>
|
BTW, Do I need to worry about these warnings?
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The JSON Schema is here:
https://www.encodeproject.org/profiles/experiment#raw
I'm calling:
datamodel-codegen --input experiment.json --input-file-type jsonschema --output models/experiment.py --output-model-type pydantic_v2.BaseModel
The model is loaded perfectly by pydantic, but my specific data fails to validate:
Here is the code of my simple validator script:
The experiment JSON can be downloaded here:
https://www.encodeproject.org/experiments/ENCSR545YBD/?format=json
I guess it's to do with the complex data types not being strings, and being represented as $refs, but I don't know what I@m doing 😅
The text was updated successfully, but these errors were encountered: