PWZER / swagger-ui-py

Swagger UI for Python web framework, such Tornado, Flask and Sanic. https://pwzer.github.io/swagger-ui-py/
https://pypi.org/project/swagger-ui-py
Apache License 2.0
68 stars 31 forks source link

bug: Swagger 3.0.0 datetime #23

Open jitka opened 4 years ago

jitka commented 4 years ago

When I try to create object with date-time I got

Fetch error
Internal Server Error /swagger.json

My simple app:

import falcon
import swagger_ui
from wsgiref import simple_server

app = falcon.API()
swagger_ui.falcon_api_doc(
    app, config_path="./swagger.yaml", url_prefix="/", title="API doc planed",
)

with simple_server.make_server('', 8000, app) as httpd:
    httpd.serve_forever()

specification:

openapi: 3.0.0
info:
  version: 1.0.0
  title: Example
  contact:
    email: jitka@ucw.cz
servers:
  - url: http://localhost:8000
paths:
  "/":
    get:
      summary: Minimal example
      responses:
        "200":
          description: successful operation
components:
  schemas:
    Revision:
      type: object
      properties:
        revisionId:
          type: integer
          description: Monotonic revision ID, starting from zero
          example: 0
        created:
          type: string
          format: date-time
          description: Timestamp of the creation of this section
          example: 2019-02-01T17:23:11.683Z

Without that created property it works fine. I check that swagger.yaml is valid in many tools.