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

Fix handling of metadata when using OAS 3.1 #1139

Merged
merged 2 commits into from
Jan 6, 2024
Merged

Fix handling of metadata when using OAS 3.1 #1139

merged 2 commits into from
Jan 6, 2024

Conversation

Viicos
Copy link
Contributor

@Viicos Viicos commented Jan 3, 2024

Following #1133, still failing if there's some metadata set.

I don't know much about the internals of drf-spectacular, let me know if anything needs to be changed.

Copy link
Owner

@tfranzel tfranzel left a comment

Choose a reason for hiding this comment

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

great! I'll try to think of other cases too.

just one comment there.

@@ -3266,7 +3266,7 @@ def view_func(request, format=None):
@mock.patch('drf_spectacular.settings.spectacular_settings.OAS_VERSION', '3.1.0')
def test_basic_oas_3_1_nullable_cases(no_warnings, django_transforms):
class M14(models.Model):
field_json = models.JSONField(null=True) # case 1
field_json = models.JSONField(null=True, help_text="field_json desc") # case 1
Copy link
Owner

Choose a reason for hiding this comment

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

would you mind adding a new field instead of changing the existing one. we'll get more coverage that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for fixing it, hadn't had time to do it

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c53b677) 98.63% compared to head (1e28d3e) 98.63%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1139   +/-   ##
=======================================
  Coverage   98.63%   98.63%           
=======================================
  Files          71       71           
  Lines        8698     8698           
=======================================
  Hits         8579     8579           
  Misses        119      119           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tfranzel added a commit that referenced this pull request Jan 6, 2024
@tfranzel tfranzel merged commit 1e28d3e into tfranzel:master Jan 6, 2024
35 checks passed
@Viicos Viicos deleted the fix-meta-31 branch January 6, 2024 13:29
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