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

Bug fix json schema #28 (Sourcery refactored) #31

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions sphinxcontrib/autodoc_pydantic/autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ def add_collapsable_schema(self):
logger.warning(error_msg, location="autodoc_pydantic")
elif strategy == OptionsJsonErrorStrategy.RAISE:
raise sphinx.errors.ExtensionError(error_msg)
elif strategy == OptionsJsonErrorStrategy.COERCE:
pass
else:
elif strategy != OptionsJsonErrorStrategy.COERCE:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PydanticModelDocumenter.add_collapsable_schema refactored with the following changes:

raise sphinx.errors.ExtensionError(
f"Invalid option provided for 'show-json-error-strategy'. "
f"Allowed values are f{OptionsJsonErrorStrategy.values()}"
Expand Down