[Python][Flask] Handles UUID format - Fixes #7469 (#7507)

This commit is contained in:
Aykut Akin 2018-02-08 07:57:46 +01:00 committed by William Cheng
parent 62a930223f
commit 62b93fc5cb

View File

@ -19,12 +19,17 @@ def {{operationId}}({{#allParams}}{{paramName}}{{^required}}=None{{/required}}{{
{{#isPrimitiveType}} {{#isPrimitiveType}}
:type {{paramName}}: {{>param_type}} :type {{paramName}}: {{>param_type}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{#isUuid}}
:type {{paramName}}: {{>param_type}}
{{/isUuid}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{#isFile}} {{#isFile}}
:type {{paramName}}: werkzeug.datastructures.FileStorage :type {{paramName}}: werkzeug.datastructures.FileStorage
{{/isFile}} {{/isFile}}
{{^isFile}} {{^isFile}}
{{^isUuid}}
:type {{paramName}}: dict | bytes :type {{paramName}}: dict | bytes
{{/isUuid}}
{{/isFile}} {{/isFile}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isContainer}} {{/isContainer}}
@ -62,8 +67,10 @@ def {{operationId}}({{#allParams}}{{paramName}}{{^required}}=None{{/required}}{{
{{/isDateTime}} {{/isDateTime}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{^isFile}} {{^isFile}}
{{^isUuid}}
if connexion.request.is_json: if connexion.request.is_json:
{{paramName}} = {{baseType}}.from_dict(connexion.request.get_json()) # noqa: E501 {{paramName}} = {{baseType}}.from_dict(connexion.request.get_json()) # noqa: E501
{{/isUuid}}
{{/isFile}} {{/isFile}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isContainer}} {{/isContainer}}