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

use_kwargs with fields.DateTime is parsed as string #227

Open
thebino opened this issue Sep 22, 2021 · 1 comment
Open

use_kwargs with fields.DateTime is parsed as string #227

thebino opened this issue Sep 22, 2021 · 1 comment

Comments

@thebino
Copy link

thebino commented Sep 22, 2021

When using fields.DateTime in a use_kwargs it is rendered as string in swagger/openapi.

@use_kwargs(
    {
        'from': fields.DateTime(
            format="rfc",
            default=datetime.datetime.now(),
            description="The timestamp a vehicle should be available from"
        )
    }, location='query')

Screenshot 2021-09-22 at 21 42 33

When using it inside the swagger editor, it is rendered as string($date-time)

Screenshot 2021-09-22 at 21 43 11

This is more conclusive for developers since the string has a specific format.

@thebino
Copy link
Author

thebino commented Sep 23, 2021

More precisely it only happens when using openapi_version='3.0.0' when switching to version 2.0.0 it looks normal.

app.config['APISPEC_SPEC'] = apispec.APISpec(
    title='Vehicles booking API',
    version='1.0.0',
    openapi_version='3.0.0',

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

No branches or pull requests

1 participant