How to generate a Swagger #definition from sample JSON

后端 未结 3 1379
伪装坚强ぢ
伪装坚强ぢ 2021-01-04 10:37

Take the following #definition from the pet store example. Given a #definition section a JSON structure can be generated

e.g.

Is there something that can do

3条回答
  •  时光说笑
    2021-01-04 11:32

    This works for me:

    Generate Swagger REST-client code (and POJO) from sample JSON:

    1. Go to apistudio.io:

      • Insert -> New Model.
      • CutNpaste your JSON.
      • [The Swagger YML file will be generated]
      • Download -> YAML.
    2. Go to editor.swagger.io:

      • CutNpaste the YML saved from last step.
      • Generate Client -> jaxrs-cxf-client (there are many other options).

提交回复
热议问题