-
Notifications
You must be signed in to change notification settings - Fork 11
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
A problem with big struct #4
Comments
Your example is a bit confusing to me. What is your precise syntax? i.e. is it actually |
Thanks, @ozzyst. That's really helpful. 😄 It looks like pydantic-sphinx can't parse custom types that generated by Pydantic objects. I'll need to do a deeper dive into this when I get time. For reference, the JSON that's returned by {
"title": "Struct",
"type": "object",
"properties": {
"data": {
"title": "Data",
"type": "array",
"items": {
"$ref": "#/definitions/InnerStruct"
}
}
},
"definitions": {
"InnerStruct": {
"title": "InnerStruct",
"type": "object",
"properties": {
"first": {
"title": "First",
"type": "string"
},
"second": {
"title": "Second",
"type": "boolean"
},
"third": {
"title": "Third",
"type": "integer"
}
},
"required": [
"first",
"second",
"third"
]
}
}
} Looks like sphinx-pydantic will need to provide a way to handle JSON objects with reference to "outside" JSON schemas/ Pydantic objects. It will have to parse the If you'd be interested in exploring this further and submitting a PR, that would be awesome! I'm a bit short on time right now, so I likely can't work on this for the next couple of weeks. |
Thank you so much for your answer! If I can to fix it I will create PR |
Hi! I had the same issue and I want to share the workaround that I am using, in case someone finds it useful. Adding the reference to the label of the warning suppressed the warning and created a link to the pydantic's sub-model instead of the I am not allowed to share anything from my project, but I think that the @ozzyst's second example should work if the .rst is modified as follows:
|
I love this package! I just started using it, and I am also having the same issue. |
I was able to resolve this with the workaround suggested by @danieljmv01 . Thanks :-) |
Hello! I have some struct if I try to create doc I have warning
:1: WARNING: undefined label: #/definitions/inner_struct (if the link has no caption the label must precede a section header)
I have this error on all inner structs. Do you have any ideas?
My rest look like as this
And my struct:
The text was updated successfully, but these errors were encountered: