Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

pretty print generated spec (swagger.json) #8

Open
javathought opened this issue Nov 15, 2017 · 3 comments
Open

pretty print generated spec (swagger.json) #8

javathought opened this issue Nov 15, 2017 · 3 comments

Comments

@javathought
Copy link

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
Copy link
Collaborator

slinkydeveloper commented Nov 15, 2017

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

  • resolves all external schemas
  • bundles all inside one schema
  • converts oas 2 to oas 3

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

@javathought
Copy link
Author

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 :

  • on initial one and regenerated all the project
  • what if we only modify schema validations attribute (min, max, min-lengths, ...) : the generated code is not impacted by these mods.

@slinkydeveloper
Copy link
Collaborator

slinkydeveloper commented Nov 16, 2017

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 😄)
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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants