Skip to content

include date and date-time format in coreapi schema generation #5511

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 20, 2017

Conversation

zbyte64
Copy link
Contributor

@zbyte64 zbyte64 commented Oct 17, 2017

This adds the proper format when translating serializers.DateField & DateTimeField to coreapi/coreschema

Helps down the line with swagger:
marcgibbons/django-rest-swagger#703

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

This seems reasonable yes.

@tomchristie Can I just ask you to comment on the format magic string values here? They seem reasonable but is there a canonical list of accepted values?

@zbyte64
Copy link
Contributor Author

zbyte64 commented Oct 19, 2017

The format is from OpenAPI v2: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types

Maybe also relevant; python-coreschema has format validating "email" & "uri": https://github.com/core-api/python-coreschema/blob/master/tests/test_string.py

@carltongibson carltongibson added this to the 3.7.2 milestone Oct 20, 2017
@carltongibson
Copy link
Collaborator

@zbyte64 Good follow-up. Exactly right.

Give the TODO on CoreSchema we'll take this as-is for now and revisit (hopefully with named constants or such) when that gets tightened up.

Thanks for the input!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants