pmlopes / slush-vertx

36 stars 4 forks source link

pretty print generated spec (swagger.json) #8

Open javathought opened 6 years ago

javathought commented 6 years ago

Context

While generating a project from a yaml spec (swagger.yaml), the generated spec in project is in json format if on a single line and so is not human readable

Steps to reproduce

  1. run slush vertx
  2. choose Vert.x Web Server OpenAPI project
  3. open the schema under src/main/resources/swagger.json

Extra

Perhaps, just copy the schema (yaml or json) used to generate the project, as it should be correct if the project has been generated

slinkydeveloper commented 6 years ago

My idea was to generate a schema bundled and ready to be deployed to an endpoint. The schema loading in fact:

What if I create a version of the schema like now and another one pretty-printed (but converted and bundled as is now)?

javathought commented 6 years ago

Ok for the bundled pretty-printed one : I agree to have one ready to be exposed on a endpoint.

The question I have is where do we make updates and how do we apply them :

slinkydeveloper commented 6 years ago

If you want to make an update to the schemas you can simply load all your schemas inside the resources dir of your generated project and vertx-web-api-contract solves everything (ok now it's bugged but it will work :smile:) This project only does a first time code scaffolding, no more. A maven plugin is more suitable for that work (for oas 2 there are tons of plugins for gulp that do that work) that at every build it bundles the schema. Maybe we can work together on it, contact me if you are interested!