How to generate Swagger 2.0 Json from any custom input? -
i looking generating swagger 2.0 json custom json api metadata.
i have noticed can achieved when input jax-rs or spring, ( swagger maven plugin ). want derive swagger json custom json input.
when doing bbc's nitro api used combination of creating unchanging swagger boilerplate string converted json object using json.parse(), , iterating through source api spec json object attaching various properties swagger object. see initswagger() function , way properties added swagger object in linked example.
then serialise swagger object json.stringify() save swagger document in json format.
an alternative use transform such jsont or number of regexes convert source api json swagger object, depending on how closely source specification maps swagger way of doing things.
Comments
Post a Comment