Can I modify the swagger generator / run it as part of my build process?

Not sure if this is supported. Am considering using VP as part of a large refactoring project where we need to generate swagger off large models.

A couple of questions:

  • we will need control over the swagger generation and the ability to correct defects quickly. Can we modify the generator? is it open source for instance?

  • can we export the model, and run the generator as part of our build processes? that’s very important to us?


Hi Andrew,

  1. Sorry that it is not open source and cannot modify. If you need fully control, you’ll need to develop a plugin to read from models and generate your own code.

  2. No, but we’ll consider to support command line interface.

ah thanks. i’m afraid this rules it out of usage for us - like all large companies, we need to control the generation of code as part of our build process.

Hi Andrew,

This is Rain Wong form Visual Paradigm. Would you please tell me more details about the customization you need to achieve with our swagger generator so that I can discuss with our engineers to see the possibility to achieve this? If you feel not comfortable to disclose in here then you can send the details to Thanks and look forward to hearing from you.

Best regards,
Rain Wong

1 Like

Thanks for the reply. Happy to discuss, although we’ve decided to go with a templating based solution off an EMF model.

Just to preface, a few of our key requirements, which are pretty common for any large engineering org.

a. code gen has to be runnable as part of our build process
-> if that’s via a set of jars, we don’t particularly mind, but it has to be from model to src as part of our processes. standard stuff for repeatable builds. We are happy to do this off an EMF/XMI model, whatever.

b. we have to be in full control of the code gen
-> if we need to make changes, we need to make changes quickly

c. ideally open source
-> the idea of not being able to fix bugs, or relying on an external company to fix bugs or add features doesn’t work for us

We are happy to pay for the modeling tool, but want much more freedom around code gen.

So, with that in mind, the swagger generator we are working towards is as follows. This is very specific to our use cases.

  1. resources are specified as a single entity, and you can specify on this single entity which verbs are supported
  2. the resource itself and its attributes are the main representation
  3. you can have an association to other representations
  4. GET params etc live on the main resource entity

This way, we can encode all of our standards for URL naming etc in the generator, rather than leaving it up to each engineer to specify on each of the verb entities. The current VP swagger generator is flexible, but too flexible for us - it’s quite easy to accidentally get one path for a GET and another for the PUT.