-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Represent SafeString as plain string on schema rendering. #8429
Conversation
18581ae
to
ac6f84e
Compare
I tried running Should we wait for the fix, or can we merge it first? |
The source of error: mkdocs/mkdocs#2799 |
ac6f84e
to
ed3baea
Compare
The error should be fixed in #8433. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
d05e111
to
20f7671
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have much depth regarding yaml. will be waiting for more eyes into this. on a side note, can you add more relevant tests for the changes?
@auvipy I think the test is sufficient. As long as it can render SafeString, I think it's good enough. Or could you elaborate on what kind of test I should add? |
I have requested review from another OpenAPI specialist |
Btw, here's the section in PyYAML that discuss about representing custom object: https://pyyaml.org/wiki/PyYAMLDocumentation#constructors-representers-resolvers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that works. It is key that the yaml does not contain !!
type injections, which are valid in newer YAML versions, but upstream tools mostly choke on them.
But just as a sidenote: there are a bunch more objects (e.g uuid
, datetime
, etc) that solicit this kind of behavior: https://github.com/tfranzel/drf-spectacular/blob/03677b6bb86b2076a97b70b918ed3b3b528edaa4/drf_spectacular/renderers.py#L52
Oops, you're right. I just read the discussion #8453, but wasn't aware with the |
@hashlash, yes. everything that does not belong to the schema interface itself will be retired and removed eventually. |
Note: Before submitting this pull request, please review our contributing guidelines.
Description
Fix #8428.