1

I'm wondering is there any tool to generate Java POJO from swagger content/parameters?

My problem is, the request/response is huge in json format. Especially the response and I'm not sure what is the best way to handle them with serialization/de-serialization.

Thanks.

arena
  • 233
  • 3
  • 15

1 Answers1

0

You could use a tool like api-spec-converter from npm to convert swagger to WADL.

Usage:

$ api-spec-converter -h

Usage: api-spec-converter [options] <URL|filename>

Convert API descriptions between popular formats.

Supported formats:
* swagger_1
* swagger_2
* openapi_3
* api_blueprint
* io_docs
* google
* raml
* wadl

Options:

-h, --help              output usage information
-V, --version           output the version number
-f, --from <format>     Specifies format to convert
-t, --to <format>       Specifies output format
-s, --syntax [syntax]   Specifies output data syntax: json or yaml. Defaults to json
-o, --order [sortOrder] Specifies top fields ordering: openapi or alpha. Defaults to openapi
-c, --check             Check if result is valid spec
-d, --dummy             Fill missing required fields with dummy data

Then, you could generate the POJO using the wadl2java CXF maven plugin.

Idriss Neumann
  • 3,760
  • 2
  • 23
  • 32