Skip to content

Revert SchemaGenerator description value from tuple to str #1138

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

Merged
merged 2 commits into from
Mar 13, 2023
Merged

Revert SchemaGenerator description value from tuple to str #1138

merged 2 commits into from
Mar 13, 2023

Conversation

arttuperala
Copy link
Contributor

@arttuperala arttuperala commented Mar 10, 2023

Description of the Change

Fixes a schema issue introduced in 9ced3be that would result in broken YAML schema.

components:
  schemas:
    error:
      properties:
        source:
          properties:
            pointer:
              description: !!python/tuple
              - A [JSON Pointer](https://tools.ietf.org/html/rfc6901) to the associated
                entity in the request document [e.g. `/data` for a primary data object,
                or `/data/attributes/title` for a specific attribute.

Only present on the main branch so I didn't update the changelog.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@sliverc
Copy link
Member

sliverc commented Mar 10, 2023

Great catch. I am confused though that our test_openapi.py did not catch this. Could you have a brief look at the test and see whether it is easy to adjust it so it covers this part of the schema as well?

@arttuperala
Copy link
Contributor Author

Converted the existing schema construction test to a snapshot one. Do you think that'll suffice?

Copy link
Member

@sliverc sliverc left a comment

Choose a reason for hiding this comment

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

Awesome. Thanks, Yep, makes most sense to have this schema test as a snapshot test. Like this, it would have caught this error.

@sliverc sliverc merged commit 3b9661e into django-json-api:main Mar 13, 2023
@arttuperala arttuperala deleted the schema-tuple-to-str branch March 13, 2023 13:43
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