openapi-generator/modules/openapi-generator-gradle-plugin/samples/local-spec
Jim Schubert 77df3d6770 Validate spec on generation by default (#251)
* Validate spec on generation by default

Adds a validation parameter to CodegenConfigurator, and passes through
options from CLI, Maven Plugin and Gradle Plugin to that property.

Default is to validate the spec during generation. If spec has errors,
we will output errors as well as warnings to the user.

Option can be disabled by passing false to validateSpec (Maven/Gradle)
or --validate-spec (CLI).

* Prepare version 3.1.1-SNAPSHOT

* fix version

* Use last prod version for the sample

* Update README.md

Fix

* [cli] Option parser does not support true/false for boolean options
2018-07-26 17:36:08 +08:00
..
.gitignore [gradle-plugin] Initial implementation (#162) 2018-05-31 19:23:05 +08:00
build.gradle Validate spec on generation by default (#251) 2018-07-26 17:36:08 +08:00
gradle.properties Release 3.1.2 (#647) 2018-07-25 18:09:52 +02:00
petstore-v3.0-invalid.yaml [gradle-plugin] Initial implementation (#162) 2018-05-31 19:23:05 +08:00
petstore-v3.0.yaml [gradle-plugin] Initial implementation (#162) 2018-05-31 19:23:05 +08:00
README.md Validate spec on generation by default (#251) 2018-07-26 17:36:08 +08:00
settings.gradle [gradle-plugin] Initial implementation (#162) 2018-05-31 19:23:05 +08:00

Local Spec Sample

This example assumes you have Gradle 4.7+ installed. No gradle wrapper is provided in samples.

First, publish the openapi-generator-gradle-plugin locally via ./gradlew assemble install in the module directory.

Then, run the following tasks in this example directory.

gradle openApiGenerate
gradle openApiMeta
gradle openApiValidate
gradle buildGoSdk
gradle generateGoWithInvalidSpec

The samples can be tested against other versions of the plugin using the openApiGeneratorVersion property. For example:

gradle -PopenApiGeneratorVersion=3.1.2 openApiValidate