Specify if the server supports HTTP/2 connection. Optionality: mandatory Recommendation: Https should be used in any official environment for security reason Note: when Https is enabled, Http will automatically be disabled Specify if the server listens to https port. The port number of Https listener if enableHttps is true. Optionality: mandatory Recommendation: Http should be enabled in dev Specify if the server listens to http port. The port number of Http listener if enableHttp is true Optionality: mandatory Optionality: mandatory Recommendation: set to false to prevent the model classes being overwrittenĬontrols whether you wish to generate only the model classes Optionality: optional Recommendation: to be used by teams consuming an API and who wish to generate the model classes only Default: falseĬontrols whether you wish to regenerate only the model and handler classes, while skipping the underlying scripts, pom.xml and other files Optionality: optional Recommendation: to be used when there are changes in the model and teams wish to regenerate only artifacts affected by the change: model, handler classes, and handler.yml Default: falseĬontrols whether a values.yml is to be generated, with commonly changed values across test and production environments Default: false Optionality: mandatoryĬontrols if you want to overwrite generated models. Optionality: mandatory Recommendation: set to false if you only want to upgrade the framework to another minor version and don’t want to overwrite handlersĬontrols if you want to overwrite handler test cases. Optionality: mandatoryĬontrols if you want to overwrite handler when regenerating the same project into the same folder. The Java package for all generated models or POJOs. The Java package for all generated handlers. Root package name for your project and it will normally be your domain plug project name. Used in generated pom.xml for project artifactId Optionality: mandatory Used in generated pom.xml for project groupId Optionality: mandatory Used in generated pom.xml for project version Optionality: mandatory Used in generated prom.xml for project name Optionality: mandatory Here is a reference table for the example config.json below: Field Name OpenAPI Bundler - A command line tool to combine multiple yaml specifications into one Swagger Editor - A online tool to create OpenAPI specification Note: we only support OpenAPI 3.0 specification for Kotlin. Also, validation needs to be done to make sure that the openapi.yaml or openapi.json is valid against JSON schema of OpenAPI 3.0 specification. Before leverage it in the light-rest-4j framework, all YAML files need to be bundled to a single file in YAML or JSON format to be consumed by the framework and generator. When editing it, it usually will be in YAML format with separate files for readability and flexibility. In light-rest-4j framework generator, the model that drives code generation is the OpenAPI 3.0 specification previously named Swagger specification. The only issue I can see is the entire toolchains around Swagger 2.0 are not migrated to OpenAPI 3.0 yet, and we have to build our own openapi-parser for parsing and validation. OpenAPI adds a number of features as well. In my opinion, it is much easier to use, and the implementation is much simpler then Swagger 2.0. It has some significant changes to enhance the spec definition and simply validate with only JSON schema. This generator is based on the OpenAPI 3.0 specification, and it is a new specification that is supposed to replace the Swagger 2.0 specification. Gson may have some generic's way of accomplishing this like here. If the json changes I don't care, I only care if my 5 elements are no longer in the same shape. What I'd really like as well is something like: I want to take in this Json from some service I don't control, I care about these 5 elements, here's the static structure of this json response. I'm sure there's some way to get the best of both worlds. Json is definitely somewhere that groovy's parser seems to win in my opinion. I like the benefits of Kotlin more than the dynamic parts of Groovy. I'm sure there's alternatives in Kotlin (if so let me know as there's some use cases I have for it) but if you want full dynamic typing with Json groovy has a really nice Json parser.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |