How to generate JSON-Schema from Swagger API Declaration

前端 未结 4 1040
伪装坚强ぢ
伪装坚强ぢ 2021-01-29 21:15

I have Swagger API Declaration for services using Swagger v 1.2

My original feeling about Swagger was, that it is very close to JSON Schema (Draft 3 and lately Draft 4)

4条回答
  •  后悔当初
    2021-01-29 21:49

    There is a python tool to do the same by the name openapi2jsonschema. You can simply install it using pip.

    The readme for openapi2 shows the simplest way to use it:

    openapi2jsonschema https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json
    

    Hope this helps.

提交回复
热议问题