diff --git a/bin/configs/java-micronaut-client.yaml b/bin/configs/java-micronaut-client.yaml
index 3172294392..bf0720a691 100644
--- a/bin/configs/java-micronaut-client.yaml
+++ b/bin/configs/java-micronaut-client.yaml
@@ -7,3 +7,4 @@ additionalProperties:
configureAuth: "false"
build: "all"
test: "spock"
+ requiredPropertiesInConstructor: "false"
diff --git a/bin/configs/java-micronaut-server.yaml b/bin/configs/java-micronaut-server.yaml
new file mode 100644
index 0000000000..d0c4df9ac5
--- /dev/null
+++ b/bin/configs/java-micronaut-server.yaml
@@ -0,0 +1,10 @@
+generatorName: java-micronaut-server
+outputDir: samples/server/petstore/java-micronaut-server/
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+additionalProperties:
+ artifactId: petstore-micronaut-server
+ hideGenerationTimestamp: "true"
+ build: "all"
+ test: "spock"
+ requiredPropertiesInConstructor: "true"
+ useAuth: "false"
diff --git a/docs/generators.md b/docs/generators.md
index dc04b6f745..afd41cba7e 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -99,6 +99,7 @@ The following generators are available:
* [haskell-yesod (beta)](generators/haskell-yesod.md)
* [java-camel](generators/java-camel.md)
* [java-inflector](generators/java-inflector.md)
+* [java-micronaut-server (beta)](generators/java-micronaut-server.md)
* [java-msf4j](generators/java-msf4j.md)
* [java-pkmst](generators/java-pkmst.md)
* [java-play-framework](generators/java-play-framework.md)
diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md
index 00bb283b8c..c1ba0089f6 100644
--- a/docs/generators/java-micronaut-client.md
+++ b/docs/generators/java-micronaut-client.md
@@ -29,7 +29,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|build|Specify for which build tool to generate files|
**gradle** Gradle configuration is generated for the project **all** Both Gradle and Maven configurations are generated **maven** Maven configuration is generated for the project |all|
-|configPackage|Configuration package for generated code| |org.openapitools.configuration|
|configureAuth|Configure all the authorization methods as specified in the file| |false|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
@@ -49,12 +48,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|**true** The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. **false** The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. |true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
+|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.2.6|
|modelPackage|package for generated models| |org.openapitools.model|
|openApiNullable|Enable OpenAPI Jackson Nullable library| |true|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
+|requiredPropertiesInConstructor|Allow only to create models with all the required properties provided in constructor| |true|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
@@ -64,7 +65,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/main/java|
|test|Specify which test tool to generate files for|**junit** Use JUnit as test tool **spock** Use Spock as test tool |junit|
-|title|Client service name| |OpenAPI Micronaut Client|
+|title|Client service name| |null|
|useBeanValidation|Use BeanValidation API annotations| |true|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md
new file mode 100644
index 0000000000..b99834e7c6
--- /dev/null
+++ b/docs/generators/java-micronaut-server.md
@@ -0,0 +1,314 @@
+---
+title: Documentation for the java-micronaut-server Generator
+---
+
+## METADATA
+
+| Property | Value | Notes |
+| -------- | ----- | ----- |
+| generator name | java-micronaut-server | pass this to the generate command after -g |
+| generator stability | BETA | |
+| generator type | SERVER | |
+| generator language | Java | |
+| helpTxt | Generates a Java Micronaut Server. | |
+
+## CONFIG OPTIONS
+These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
+
+| Option | Description | Values | Default |
+| ------ | ----------- | ------ | ------- |
+|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null|
+|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
+|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
+|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
+|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-micronaut|
+|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
+|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
+|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
+|booleanGetterPrefix|Set booleanGetterPrefix| |get|
+|build|Specify for which build tool to generate files|**gradle** Gradle configuration is generated for the project **all** Both Gradle and Maven configurations are generated **maven** Maven configuration is generated for the project |all|
+|controllerPackage|The package in which controllers will be generated| |org.openapitools.api|
+|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
+|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
+|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
+|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
+|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
+|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|**false** The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. **true** Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |true|
+|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
+|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
+|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
+|generateControllerAsAbstract|Generate an abstract class for controller to be extended. (apiPackage is then used for the abstract class, and controllerPackage is used for implementation that extends it.)| |false|
+|generateControllerFromExamples|Generate the implementation of controller and tests from parameter and return examples that will verify that the api works as desired (for testing)| |false|
+|groupId|groupId in generated pom.xml| |org.openapitools|
+|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
+|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
+|invokerPackage|root package for generated code| |org.openapitools|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|**true** Use Java 8 classes such as Base64 **false** Various third party libraries as needed |true|
+|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|**true** The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. **false** The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. |true|
+|licenseName|The name of the license| |Unlicense|
+|licenseUrl|The URL of the license| |http://unlicense.org|
+|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.2.6|
+|modelPackage|package for generated models| |org.openapitools.model|
+|openApiNullable|Enable OpenAPI Jackson Nullable library| |true|
+|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
+|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
+|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
+|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
+|requiredPropertiesInConstructor|Allow only to create models with all the required properties provided in constructor| |true|
+|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
+|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
+|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
+|serializableModel|boolean - toggle "implements Serializable" for generated models| |false|
+|snapshotVersion|Uses a SNAPSHOT version.|**true** Use a SnapShot Version **false** Use a Release Version |null|
+|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
+|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
+|sourceFolder|source folder for generated code| |src/main/java|
+|test|Specify which test tool to generate files for|**junit** Use JUnit as test tool **spock** Use Spock as test tool |junit|
+|title|Client service name| |null|
+|useAuth|Whether to import authorization and to annotate controller methods accordingly| |true|
+|useBeanValidation|Use BeanValidation API annotations| |true|
+|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
+
+## IMPORT MAPPING
+
+| Type/Alias | Imports |
+| ---------- | ------- |
+|Array|java.util.List|
+|ArrayList|java.util.ArrayList|
+|BigDecimal|java.math.BigDecimal|
+|CompletedFileUpload|io.micronaut.http.multipart.CompletedFileUpload|
+|Date|java.util.Date|
+|DateTime|org.joda.time.*|
+|File|java.io.File|
+|HashMap|java.util.HashMap|
+|LinkedHashSet|java.util.LinkedHashSet|
+|List|java.util.*|
+|LocalDate|org.joda.time.*|
+|LocalDateTime|org.joda.time.*|
+|LocalTime|org.joda.time.*|
+|Map|java.util.Map|
+|Set|java.util.*|
+|Timestamp|java.sql.Timestamp|
+|URI|java.net.URI|
+|UUID|java.util.UUID|
+
+
+## INSTANTIATION TYPES
+
+| Type/Alias | Instantiated By |
+| ---------- | --------------- |
+|array|ArrayList|
+|map|HashMap|
+|set|LinkedHashSet|
+
+
+## LANGUAGE PRIMITIVES
+
+
+Boolean
+Double
+Float
+Integer
+Long
+Object
+String
+boolean
+byte[]
+
+
+## RESERVED WORDS
+
+
+abstract
+apiclient
+apiexception
+apiresponse
+application
+assert
+authorization
+body
+boolean
+break
+byte
+case
+catch
+char
+class
+client
+configuration
+const
+continue
+cookie
+default
+do
+double
+else
+enum
+extends
+file
+final
+finally
+float
+for
+format
+goto
+header
+if
+implements
+import
+instanceof
+int
+interface
+list
+localreturntype
+localvaraccept
+localvaraccepts
+localvarauthnames
+localvarcollectionqueryparams
+localvarcontenttype
+localvarcontenttypes
+localvarcookieparams
+localvarformparams
+localvarheaderparams
+localvarpath
+localvarpostbody
+localvarqueryparams
+long
+native
+new
+null
+object
+package
+pathvariable
+private
+protected
+public
+queryparam
+queryvalue
+return
+short
+static
+strictfp
+stringutil
+super
+switch
+synchronized
+this
+throw
+throws
+transient
+try
+void
+volatile
+while
+
+
+## FEATURE SET
+
+
+### Client Modification Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|BasePath|✓|ToolingExtension
+|Authorizations|✗|ToolingExtension
+|UserAgent|✗|ToolingExtension
+|MockServer|✗|ToolingExtension
+
+### Data Type Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Custom|✗|OAS2,OAS3
+|Int32|✓|OAS2,OAS3
+|Int64|✓|OAS2,OAS3
+|Float|✓|OAS2,OAS3
+|Double|✓|OAS2,OAS3
+|Decimal|✓|ToolingExtension
+|String|✓|OAS2,OAS3
+|Byte|✓|OAS2,OAS3
+|Binary|✓|OAS2,OAS3
+|Boolean|✓|OAS2,OAS3
+|Date|✓|OAS2,OAS3
+|DateTime|✓|OAS2,OAS3
+|Password|✓|OAS2,OAS3
+|File|✓|OAS2
+|Array|✓|OAS2,OAS3
+|Maps|✓|ToolingExtension
+|CollectionFormat|✓|OAS2
+|CollectionFormatMulti|✓|OAS2
+|Enum|✓|OAS2,OAS3
+|ArrayOfEnum|✓|ToolingExtension
+|ArrayOfModel|✓|ToolingExtension
+|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
+|ArrayOfCollectionOfModel|✓|ToolingExtension
+|ArrayOfCollectionOfEnum|✓|ToolingExtension
+|MapOfEnum|✓|ToolingExtension
+|MapOfModel|✓|ToolingExtension
+|MapOfCollectionOfPrimitives|✓|ToolingExtension
+|MapOfCollectionOfModel|✓|ToolingExtension
+|MapOfCollectionOfEnum|✓|ToolingExtension
+
+### Documentation Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Readme|✓|ToolingExtension
+|Model|✓|ToolingExtension
+|Api|✓|ToolingExtension
+
+### Global Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Host|✓|OAS2,OAS3
+|BasePath|✓|OAS2,OAS3
+|Info|✓|OAS2,OAS3
+|Schemes|✗|OAS2,OAS3
+|PartialSchemes|✓|OAS2,OAS3
+|Consumes|✓|OAS2
+|Produces|✓|OAS2
+|ExternalDocumentation|✓|OAS2,OAS3
+|Examples|✓|OAS2,OAS3
+|XMLStructureDefinitions|✗|OAS2,OAS3
+|MultiServer|✗|OAS3
+|ParameterizedServer|✗|OAS3
+|ParameterStyling|✗|OAS3
+|Callbacks|✗|OAS3
+|LinkObjects|✗|OAS3
+
+### Parameter Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Path|✓|OAS2,OAS3
+|Query|✓|OAS2,OAS3
+|Header|✓|OAS2,OAS3
+|Body|✓|OAS2
+|FormUnencoded|✓|OAS2
+|FormMultipart|✓|OAS2
+|Cookie|✓|OAS3
+
+### Schema Support Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Simple|✓|OAS2,OAS3
+|Composite|✓|OAS2,OAS3
+|Polymorphism|✗|OAS2,OAS3
+|Union|✗|OAS3
+
+### Security Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|BasicAuth|✓|OAS2,OAS3
+|ApiKey|✓|OAS2,OAS3
+|OpenIDConnect|✓|OAS3
+|BearerToken|✗|OAS3
+|OAuth2_Implicit|✓|OAS2,OAS3
+|OAuth2_Password|✓|OAS2,OAS3
+|OAuth2_ClientCredentials|✓|OAS2,OAS3
+|OAuth2_AuthorizationCode|✓|OAS2,OAS3
+
+### Wire Format Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|JSON|✓|OAS2,OAS3
+|XML|✓|OAS2,OAS3
+|PROTOBUF|✗|ToolingExtension
+|Custom|✗|OAS2,OAS3
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java
new file mode 100644
index 0000000000..b8b8506e8f
--- /dev/null
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java
@@ -0,0 +1,511 @@
+package org.openapitools.codegen.languages;
+
+import org.apache.commons.lang3.StringUtils;
+import org.openapitools.codegen.*;
+import org.openapitools.codegen.languages.features.BeanValidationFeatures;
+import org.openapitools.codegen.meta.features.DocumentationFeature;
+import org.openapitools.codegen.meta.features.SecurityFeature;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static org.openapitools.codegen.CodegenConstants.INVOKER_PACKAGE;
+
+public abstract class JavaMicronautAbstractCodegen extends AbstractJavaCodegen implements BeanValidationFeatures {
+ public static final String OPT_TITLE = "title";
+ public static final String OPT_BUILD = "build";
+ public static final String OPT_BUILD_GRADLE = "gradle";
+ public static final String OPT_BUILD_MAVEN = "maven";
+ public static final String OPT_BUILD_ALL = "all";
+ public static final String OPT_TEST = "test";
+ public static final String OPT_TEST_JUNIT = "junit";
+ public static final String OPT_TEST_SPOCK = "spock";
+ public static final String OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR = "requiredPropertiesInConstructor";
+ public static final String OPT_MICRONAUT_VERSION = "micronautVersion";
+ public static final String OPT_USE_AUTH = "useAuth";
+
+ protected String title;
+ protected boolean useBeanValidation;
+ protected String buildTool;
+ protected String testTool;
+ protected boolean requiredPropertiesInConstructor = true;
+ protected String micronautVersion = "3.2.6";
+
+ public static final String CONTENT_TYPE_APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded";
+ public static final String CONTENT_TYPE_APPLICATION_JSON = "application/json";
+ public static final String CONTENT_TYPE_MULTIPART_FORM_DATA = "multipart/form-data";
+ public static final String CONTENT_TYPE_ANY = "*/*";
+
+ public JavaMicronautAbstractCodegen() {
+ super();
+
+ // Set all the fields
+ useBeanValidation = true;
+ buildTool = OPT_BUILD_ALL;
+ testTool = OPT_TEST_JUNIT;
+ outputFolder = "generated-code/java-micronaut-client";
+ templateDir = "java-micronaut/client";
+ apiPackage = "org.openapitools.api";
+ modelPackage = "org.openapitools.model";
+ invokerPackage = "org.openapitools";
+ artifactId = "openapi-micronaut";
+ embeddedTemplateDir = templateDir = "java-micronaut";
+ apiDocPath = "docs/apis";
+ modelDocPath = "docs/models";
+
+ // Set implemented features for user information
+ modifyFeatureSet(features -> features
+ .includeDocumentationFeatures(
+ DocumentationFeature.Readme
+ )
+ .securityFeatures(EnumSet.of(
+ SecurityFeature.ApiKey,
+ SecurityFeature.BasicAuth,
+ SecurityFeature.OAuth2_Implicit,
+ SecurityFeature.OAuth2_AuthorizationCode,
+ SecurityFeature.OAuth2_ClientCredentials,
+ SecurityFeature.OAuth2_Password,
+ SecurityFeature.OpenIDConnect
+ ))
+ );
+
+ // Set additional properties
+ additionalProperties.put("jackson", "true");
+ additionalProperties.put("openbrace", "{");
+ additionalProperties.put("closebrace", "}");
+
+ // Set client options that will be presented to user
+ updateOption(INVOKER_PACKAGE, this.getInvokerPackage());
+ updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
+ updateOption(CodegenConstants.API_PACKAGE, apiPackage);
+ updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
+
+ cliOptions.add(new CliOption(OPT_TITLE, "Client service name").defaultValue(title));
+ cliOptions.add(new CliOption(OPT_MICRONAUT_VERSION, "Micronaut version, only >=3.0.0 versions are supported").defaultValue(micronautVersion));
+ cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations", useBeanValidation));
+ cliOptions.add(CliOption.newBoolean(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "Allow only to create models with all the required properties provided in constructor", requiredPropertiesInConstructor));
+
+ CliOption buildToolOption = new CliOption(OPT_BUILD, "Specify for which build tool to generate files").defaultValue(buildTool);
+ buildToolOption.setEnum(new HashMap() {{
+ put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project");
+ put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project");
+ put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated");
+ }});
+ cliOptions.add(buildToolOption);
+
+ CliOption testToolOption = new CliOption(OPT_TEST, "Specify which test tool to generate files for").defaultValue(testTool);
+ testToolOption.setEnum(new HashMap() {{
+ put(OPT_TEST_JUNIT, "Use JUnit as test tool");
+ put(OPT_TEST_SPOCK, "Use Spock as test tool");
+ }});
+ cliOptions.add(testToolOption);
+
+ // Remove the date library option
+ cliOptions.stream().filter(o -> o.getOpt().equals("dateLibrary")).findFirst()
+ .ifPresent(v -> cliOptions.remove(v));
+
+ // Add reserved words
+ String[] reservedWordsArray = {
+ "client", "format", "queryvalue", "queryparam", "pathvariable", "header", "cookie",
+ "authorization", "body", "application"
+ };
+ reservedWords.addAll(Arrays.asList(reservedWordsArray));
+ }
+
+ @Override
+ public void processOpts() {
+ super.processOpts();
+
+ // Get properties
+ if (additionalProperties.containsKey(OPT_TITLE)) {
+ this.title = (String) additionalProperties.get(OPT_TITLE);
+ }
+
+ if (additionalProperties.containsKey(INVOKER_PACKAGE)) {
+ invokerPackage = (String) additionalProperties.get(INVOKER_PACKAGE);
+ } else {
+ additionalProperties.put(INVOKER_PACKAGE, invokerPackage);
+ }
+
+ if (additionalProperties.containsKey(OPT_MICRONAUT_VERSION)) {
+ micronautVersion = (String) additionalProperties.get(OPT_MICRONAUT_VERSION);
+ } else {
+ additionalProperties.put(OPT_MICRONAUT_VERSION, micronautVersion);
+ }
+
+ // Get boolean properties
+ if (additionalProperties.containsKey(USE_BEANVALIDATION)) {
+ this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION));
+ }
+ writePropertyBack(USE_BEANVALIDATION, useBeanValidation);
+
+ if (additionalProperties.containsKey(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR)) {
+ this.requiredPropertiesInConstructor = convertPropertyToBoolean(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR);
+ }
+ writePropertyBack(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, requiredPropertiesInConstructor);
+
+ // Get enum properties
+ if (additionalProperties.containsKey(OPT_BUILD)) {
+ switch ((String) additionalProperties.get(OPT_BUILD)) {
+ case OPT_BUILD_GRADLE:
+ case OPT_BUILD_MAVEN:
+ case OPT_BUILD_ALL:
+ this.buildTool = (String) additionalProperties.get(OPT_BUILD);
+ break;
+ default:
+ throw new RuntimeException("Build tool \"" + additionalProperties.get(OPT_BUILD) + "\" is not supported or misspelled.");
+ }
+ }
+ additionalProperties.put(OPT_BUILD, buildTool);
+
+ if (additionalProperties.containsKey(OPT_TEST)) {
+ switch ((String) additionalProperties.get(OPT_TEST)) {
+ case OPT_TEST_JUNIT:
+ case OPT_TEST_SPOCK:
+ this.testTool = (String) additionalProperties.get(OPT_TEST);
+ break;
+ default:
+ throw new RuntimeException("Test tool \"" + additionalProperties.get(OPT_TEST) + "\" is not supported or misspelled.");
+ }
+ }
+ additionalProperties.put(OPT_TEST, testTool);
+ if (testTool.equals(OPT_TEST_JUNIT)) {
+ additionalProperties.put("isTestJunit", true);
+ } else if (testTool.equals(OPT_TEST_SPOCK)) {
+ additionalProperties.put("isTestSpock", true);
+ }
+
+ // Add all the supporting files
+ String resourceFolder = projectFolder + "/resources";
+ supportingFiles.add(new SupportingFile("common/configuration/application.yml.mustache", resourceFolder, "application.yml").doNotOverwrite());
+ supportingFiles.add(new SupportingFile("common/configuration/logback.xml.mustache", resourceFolder, "logback.xml").doNotOverwrite());
+
+ if (buildTool.equals(OPT_BUILD_GRADLE) || buildTool.equals(OPT_BUILD_ALL)) {
+ // Gradle files
+ supportingFiles.add(new SupportingFile("common/configuration/gradle/build.gradle.mustache", "", "build.gradle").doNotOverwrite());
+ supportingFiles.add(new SupportingFile("common/configuration/gradle/settings.gradle.mustache", "", "settings.gradle").doNotOverwrite());
+ supportingFiles.add(new SupportingFile("common/configuration/gradle/gradle.properties.mustache", "", "gradle.properties").doNotOverwrite());
+
+ // Gradlew files
+ final String gradleWrapperFolder = "gradle/wrapper";
+ supportingFiles.add(new SupportingFile("common/configuration/gradlew/gradlew.mustache", "", "gradlew"));
+ supportingFiles.add(new SupportingFile("common/configuration/gradlew/gradlew.bat.mustache", "", "gradlew.bat"));
+ supportingFiles.add(new SupportingFile("common/configuration/gradlew/gradle-wrapper.properties.mustache", gradleWrapperFolder, "gradle-wrapper.properties"));
+ supportingFiles.add(new SupportingFile("common/configuration/gradlew/gradle-wrapper.jar", gradleWrapperFolder, "gradle-wrapper.jar"));
+ }
+
+ if (buildTool.equals(OPT_BUILD_MAVEN) || buildTool.equals(OPT_BUILD_ALL)) {
+ // Maven files
+ supportingFiles.add(new SupportingFile("common/configuration/pom.xml.mustache", "", "pom.xml").doNotOverwrite());
+
+ // Maven wrapper files
+ supportingFiles.add(new SupportingFile("common/configuration/mavenw/mvnw.mustache", "", "mvnw"));
+ supportingFiles.add(new SupportingFile("common/configuration/mavenw/mvnw.bat.mustache", "", "mvnw.bat"));
+ supportingFiles.add(new SupportingFile("common/configuration/mavenw/MavenWrapperDownloader.java.mustache", ".mvn/wrapper", "MavenWrapperDownloader.java"));
+ supportingFiles.add(new SupportingFile("common/configuration/mavenw/maven-wrapper.jar.mustache", ".mvn/wrapper", "maven-wrapper.jar"));
+ supportingFiles.add(new SupportingFile("common/configuration/mavenw/maven-wrapper.properties.mustache", ".mvn/wrapper", "maren-wrapper.properties"));
+ }
+
+ // Git files
+ supportingFiles.add(new SupportingFile("common/configuration/git/gitignore.mustache", "", ".gitignore").doNotOverwrite());
+
+ // Use the default java LocalDate
+ typeMapping.put("date", "LocalDate");
+ typeMapping.put("DateTime", "LocalDateTime");
+ importMapping.put("LocalDate", "java.time.LocalDate");
+ importMapping.put("LocalDateTime", "java.time.LocalDateTime");
+
+ // Add documentation files
+ modelDocTemplateFiles.clear();
+ modelDocTemplateFiles.put("common/doc/model_doc.mustache", ".md");
+
+ // Add model files
+ modelTemplateFiles.clear();
+ modelTemplateFiles.put("common/model/model.mustache", ".java");
+
+ // Add test files
+ modelTestTemplateFiles.clear();
+ if (testTool.equals(OPT_TEST_JUNIT)) {
+ modelTestTemplateFiles.put("common/test/model_test.mustache", ".java");
+ } else if (testTool.equals(OPT_TEST_SPOCK)) {
+ modelTestTemplateFiles.put("common/test/model_test.groovy.mustache", ".groovy");
+ }
+
+ // Set properties for documentation
+ final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/");
+ final String apiFolder = (sourceFolder + '/' + apiPackage()).replace('.', '/');
+ final String modelFolder = (sourceFolder + '/' + modelPackage()).replace('.', '/');
+ additionalProperties.put("invokerFolder", invokerFolder);
+ additionalProperties.put("resourceFolder", resourceFolder);
+ additionalProperties.put("apiFolder", apiFolder);
+ additionalProperties.put("modelFolder", modelFolder);
+ }
+
+ @Override
+ public String apiTestFileFolder() {
+ if (testTool.equals(OPT_TEST_SPOCK)) {
+ return getOutputDir() + "/src/test/groovy/" + apiPackage().replaceAll("\\.", "/");
+ }
+ return getOutputDir() + "/src/test/java/" + apiPackage().replaceAll("\\.", "/");
+ }
+
+ @Override
+ public String modelTestFileFolder() {
+ if (testTool.equals(OPT_TEST_SPOCK)) {
+ return getOutputDir() + "/src/test/groovy/" + modelPackage().replaceAll("\\.", "/");
+ }
+ return getOutputDir() + "/src/test/java/" + modelPackage().replaceAll("\\.", "/");
+ }
+
+ @Override
+ public String toApiTestFilename(String name) {
+ if (testTool.equals(OPT_TEST_SPOCK)) {
+ return toApiName(name) + "Spec";
+ }
+ return toApiName(name) + "Test";
+ }
+
+ @Override
+ public String toModelTestFilename(String name) {
+ if (testTool.equals(OPT_TEST_SPOCK)) {
+ return toModelName(name) + "Spec";
+ }
+ return toModelName(name) + "Test";
+ }
+
+ @Override
+ public void setUseBeanValidation(boolean useBeanValidation) {
+ this.useBeanValidation = useBeanValidation;
+ }
+
+ @Override
+ public String toApiVarName(String name) {
+ String apiVarName = super.toApiVarName(name);
+ if (reservedWords.contains(apiVarName)) {
+ apiVarName = escapeReservedWord(apiVarName);
+ }
+ return apiVarName;
+ }
+
+ public boolean isUseBeanValidation() {
+ return useBeanValidation;
+ }
+
+ @Override
+ public Map postProcessOperationsWithModels(Map objs, List allModels) {
+ objs = super.postProcessOperationsWithModels(objs, allModels);
+
+ Map models = allModels.stream()
+ .map(v -> ((Map) v).get("model"))
+ .collect(Collectors.toMap(v -> v.classname, v -> v));
+ Map operations = (Map) objs.get("operations");
+ List operationList = (List) operations.get("operation");
+
+ for (CodegenOperation op : operationList) {
+ // Set whether body is supported in request
+ op.vendorExtensions.put("methodAllowsBody",
+ op.httpMethod.equals("PUT") || op.httpMethod.equals("POST") || op.httpMethod.equals("PATCH"));
+
+ // Set response example
+ if (op.returnType != null) {
+ String example;
+ String groovyExample;
+ if (models.containsKey(op.returnType)) {
+ CodegenModel m = models.get(op.returnType);
+ List allowableValues = null;
+ if (m.allowableValues != null && m.allowableValues.containsKey("values")) {
+ allowableValues = (List) m.allowableValues.get("values");
+ }
+ example = getExampleValue(m.defaultValue, null, m.classname, true,
+ allowableValues, null, null, m.requiredVars, false);
+ groovyExample = getExampleValue(m.defaultValue, null, m.classname, true,
+ allowableValues, null, null, m.requiredVars, true);
+ } else {
+ example = getExampleValue(null, null, op.returnType, false, null,
+ op.returnBaseType, null, null, false);
+ groovyExample = getExampleValue(null, null, op.returnType, false, null,
+ op.returnBaseType, null, null, true);
+ }
+ op.vendorExtensions.put("example", example);
+ op.vendorExtensions.put("groovyExample", groovyExample);
+ }
+
+ // Remove the "*/*" contentType from operations as it is ambiguous
+ if (CONTENT_TYPE_ANY.equals(op.vendorExtensions.get("x-contentType"))) {
+ op.vendorExtensions.put("x-contentType", CONTENT_TYPE_APPLICATION_JSON);
+ }
+ op.consumes = op.consumes == null ? null : op.consumes.stream()
+ .filter(contentType -> !CONTENT_TYPE_ANY.equals(contentType.get("mediaType")))
+ .collect(Collectors.toList());
+ op.produces = op.produces == null ? null : op.produces.stream()
+ .filter(contentType -> !CONTENT_TYPE_ANY.equals(contentType.get("mediaType")))
+ .collect(Collectors.toList());
+
+ // Force form parameters are only set if the content-type is according
+ // formParams correspond to urlencoded type
+ // bodyParams correspond to multipart body
+ if (CONTENT_TYPE_APPLICATION_FORM_URLENCODED.equals(op.vendorExtensions.get("x-contentType"))) {
+ op.formParams.addAll(op.bodyParams);
+ op.bodyParams.forEach(p -> {
+ p.isBodyParam = false;
+ p.isFormParam = true;
+ });
+ op.bodyParams.clear();
+ } else if (CONTENT_TYPE_MULTIPART_FORM_DATA.equals(op.vendorExtensions.get("x-contentType"))) {
+ op.bodyParams.addAll(op.formParams);
+ op.formParams.forEach(p -> {
+ p.isBodyParam = true;
+ p.isFormParam = false;
+ });
+ op.formParams.clear();
+ }
+ }
+
+ return objs;
+ }
+
+ @Override
+ public Map postProcessAllModels(Map objs) {
+ objs = super.postProcessAllModels(objs);
+
+ for (String modelName: objs.keySet()) {
+ CodegenModel model = ((Map>>) objs.get(modelName))
+ .get("models").get(0).get("model");
+ if (model.getParentModel() != null) {
+ model.vendorExtensions.put("requiredParentVars", model.getParentModel().requiredVars);
+ }
+
+ List requiredVars = model.vars.stream().filter(v -> v.required).collect(Collectors.toList());
+ model.vendorExtensions.put("requiredVars", requiredVars);
+ }
+
+ return objs;
+ }
+
+ @Override
+ public void setParameterExampleValue(CodegenParameter p) {
+ p.vendorExtensions.put("groovyExample", getParameterExampleValue(p, true));
+ p.example = getParameterExampleValue(p, false);
+ }
+
+ protected String getParameterExampleValue(CodegenParameter p, boolean groovy) {
+ List allowableValues = p.allowableValues == null ? null : (List) p.allowableValues.get("values");
+
+ return getExampleValue(p.defaultValue, p.example, p.dataType, p.isModel, allowableValues,
+ p.items == null ? null : p.items.dataType,
+ p.items == null ? null : p.items.defaultValue,
+ p.requiredVars, groovy);
+ }
+
+ protected String getPropertyExampleValue(CodegenProperty p, boolean groovy) {
+ List allowableValues = p.allowableValues == null ? null : (List) p.allowableValues.get("values");
+
+ return getExampleValue(p.defaultValue, p.example, p.dataType, p.isModel, allowableValues,
+ p.items == null ? null : p.items.dataType,
+ p.items == null ? null : p.items.defaultValue,
+ null, groovy);
+ }
+
+ public String getExampleValue(
+ String defaultValue, String example, String dataType, Boolean isModel, List allowableValues,
+ String itemsType, String itemsExample, List requiredVars, boolean groovy
+ ) {
+ example = defaultValue != null ? defaultValue : example;
+ String containerType = dataType == null ? null : dataType.split("<")[0];
+
+ if ("String".equals(dataType)) {
+ if (groovy) {
+ example = example != null ? "'" + escapeTextGroovy(example) + "'" : "'example'";
+ } else {
+ example = example != null ? "\"" + escapeText(example) + "\"" : "\"example\"";
+ }
+ } else if ("Integer".equals(dataType) || "Short".equals(dataType)) {
+ example = example != null ? example : "56";
+ } else if ("Long".equals(dataType)) {
+ example = StringUtils.appendIfMissingIgnoreCase(example != null ? example : "56", "L");
+ } else if ("Float".equals(dataType)) {
+ example = StringUtils.appendIfMissingIgnoreCase(example != null ? example : "3.4", "F");
+ } else if ("Double".equals(dataType)) {
+ example = StringUtils.appendIfMissingIgnoreCase(example != null ? example : "3.4", "D");
+ } else if ("Boolean".equals(dataType)) {
+ example = example != null ? example : "false";
+ } else if ("File".equals(dataType)) {
+ example = null;
+ } else if ("LocalDate".equals(dataType)) {
+ example = "LocalDate.of(2001, 2, 3)";
+ } else if ("LocalDateTime".equals(dataType)) {
+ example = "LocalDateTime.of(2001, 2, 3, 4, 5)";
+ } else if ("BigDecimal".equals(dataType)) {
+ example = "new BigDecimal(78)";
+ } else if (allowableValues != null && !allowableValues.isEmpty()) {
+ // This is an enum
+ Object value = example;
+ if (value == null || !allowableValues.contains(value)) {
+ value = allowableValues.get(0);
+ }
+ example = dataType + ".fromValue(\"" + value + "\")";
+ } else if ((isModel != null && isModel) || (isModel == null && !languageSpecificPrimitives.contains(dataType))) {
+ if (requiredVars == null) {
+ example = null;
+ } else {
+ if (requiredPropertiesInConstructor) {
+ StringBuilder builder = new StringBuilder();
+ builder.append("new ").append(dataType).append("(");
+ for (int i = 0; i < requiredVars.size(); ++i) {
+ if (i != 0) {
+ builder.append(", ");
+ }
+ builder.append(getPropertyExampleValue(requiredVars.get(i), groovy));
+ }
+ builder.append(")");
+ example = builder.toString();
+ } else {
+ example = "new " + dataType + "()";
+ }
+ }
+ }
+
+ if ("List".equals(containerType)) {
+ String innerExample;
+ if ("String".equals(itemsType)) {
+ itemsExample = itemsExample != null ? itemsExample : "example";
+ if (groovy) {
+ innerExample = "'" + escapeTextGroovy(itemsExample) + "'";
+ } else {
+ innerExample = "\"" + escapeText(itemsExample) + "\"";
+ }
+ } else {
+ innerExample = itemsExample != null ? itemsExample : "";
+ }
+
+ if (groovy) {
+ example = "[" + innerExample + "]";
+ } else {
+ example = "Arrays.asList(" + innerExample + ")";
+ }
+ } else if ("Set".equals(containerType)) {
+ if (groovy) {
+ example = "[].asSet()";
+ } else {
+ example = "new HashSet<>()";
+ }
+ } else if ("Map".equals(containerType)) {
+ if (groovy) {
+ example = "[:]";
+ } else {
+ example = "new HashMap<>()";
+ }
+ } else if (example == null) {
+ example = "null";
+ }
+
+ return example;
+ }
+
+ public String escapeTextGroovy(String text) {
+ if (text == null) {
+ return null;
+ }
+ return escapeText(text).replaceAll("'", "\\'");
+ }
+}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java
index f3d398c8e7..997ecf3172 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java
@@ -1,127 +1,36 @@
package org.openapitools.codegen.languages;
import org.openapitools.codegen.CliOption;
-import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.CodegenType;
import org.openapitools.codegen.SupportingFile;
-import org.openapitools.codegen.languages.features.BeanValidationFeatures;
import org.openapitools.codegen.meta.GeneratorMetadata;
import org.openapitools.codegen.meta.Stability;
-import org.openapitools.codegen.meta.features.DocumentationFeature;
-import org.openapitools.codegen.meta.features.SecurityFeature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
-import static org.openapitools.codegen.CodegenConstants.INVOKER_PACKAGE;
-
-
-public class JavaMicronautClientCodegen extends AbstractJavaCodegen implements BeanValidationFeatures {
+public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen {
private final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class);
- public static final String OPT_TITLE = "title";
- public static final String OPT_CONFIG_PACKAGE = "configPackage";
public static final String OPT_CONFIGURE_AUTH = "configureAuth";
- public static final String OPT_BUILD = "build";
- public static final String OPT_BUILD_GRADLE = "gradle";
- public static final String OPT_BUILD_MAVEN = "maven";
- public static final String OPT_BUILD_ALL = "all";
- public static final String OPT_TEST = "test";
- public static final String OPT_TEST_JUNIT = "junit";
- public static final String OPT_TEST_SPOCK = "spock";
public static final String NAME = "java-micronaut-client";
- protected String title;
- protected String configPackage;
- protected boolean useBeanValidation;
protected boolean configureAuthorization;
- protected String buildTool;
- protected String testTool;
public JavaMicronautClientCodegen() {
super();
title = "OpenAPI Micronaut Client";
- invokerPackage = "org.openapitools";
- configPackage = "org.openapitools.configuration";
- useBeanValidation = true;
configureAuthorization = false;
- buildTool = OPT_BUILD_ALL;
- testTool = OPT_TEST_JUNIT;
-
- modifyFeatureSet(features -> features
- .includeDocumentationFeatures(
- DocumentationFeature.Readme
- )
- .securityFeatures(EnumSet.of(
- SecurityFeature.ApiKey,
- SecurityFeature.BasicAuth,
- SecurityFeature.OAuth2_Implicit,
- SecurityFeature.OAuth2_AuthorizationCode,
- SecurityFeature.OAuth2_ClientCredentials,
- SecurityFeature.OAuth2_Password,
- SecurityFeature.OpenIDConnect
- ))
- );
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.BETA)
.build();
+ additionalProperties.put("client", "true");
- outputFolder = "generated-code/java-micronaut-client";
- embeddedTemplateDir = templateDir = "java-micronaut-client";
- apiPackage = "org.openapitools.api";
- modelPackage = "org.openapitools.model";
- invokerPackage = "org.openapitools";
- artifactId = "openapi-micronaut";
-
- updateOption(INVOKER_PACKAGE, this.getInvokerPackage());
- updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
- updateOption(CodegenConstants.API_PACKAGE, apiPackage);
- updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
-
- apiTestTemplateFiles.clear();
-
- additionalProperties.put("jackson", "true");
- additionalProperties.put("openbrace", "{");
- additionalProperties.put("closebrace", "}");
-
- cliOptions.add(new CliOption(OPT_TITLE, "Client service name").defaultValue(title));
- cliOptions.add(new CliOption(OPT_CONFIG_PACKAGE, "Configuration package for generated code").defaultValue(configPackage));
cliOptions.add(CliOption.newBoolean(OPT_CONFIGURE_AUTH, "Configure all the authorization methods as specified in the file", configureAuthorization));
- cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations", useBeanValidation));
-
- CliOption buildToolOption = new CliOption(OPT_BUILD, "Specify for which build tool to generate files").defaultValue(buildTool);
- Map buildToolOptionMap = new HashMap();
- buildToolOptionMap.put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project");
- buildToolOptionMap.put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project");
- buildToolOptionMap.put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated");
- buildToolOption.setEnum(buildToolOptionMap);
- cliOptions.add(buildToolOption);
-
- CliOption testToolOption = new CliOption(OPT_TEST, "Specify which test tool to generate files for").defaultValue(testTool);
- Map testToolOptionMap = new HashMap();
- testToolOptionMap.put(OPT_TEST_JUNIT, "Use JUnit as test tool");
- testToolOptionMap.put(OPT_TEST_SPOCK, "Use Spock as test tool");
- testToolOption.setEnum(testToolOptionMap);
- cliOptions.add(testToolOption);
-
- // Remove the date library option
- cliOptions.stream().filter(o -> o.getOpt().equals("dateLibrary")).findFirst()
- .ifPresent(v -> cliOptions.remove(v));
-
- // Add reserved words
- String[] reservedWordsArray = {
- "client", "format", "queryvalue", "queryparam", "pathvariable", "header", "cookie",
- "authorization", "body", "application"
- };
- reservedWords.addAll(Arrays.asList(reservedWordsArray));
}
@Override
@@ -139,202 +48,53 @@ public class JavaMicronautClientCodegen extends AbstractJavaCodegen implements B
return "Generates a Java Micronaut Client.";
}
+ public boolean isConfigureAuthorization() {
+ return configureAuthorization;
+ }
+
@Override
public void processOpts() {
super.processOpts();
- // Get properties
- if (additionalProperties.containsKey(OPT_TITLE)) {
- this.title = (String) additionalProperties.get(OPT_TITLE);
- }
-
- if (additionalProperties.containsKey(OPT_CONFIG_PACKAGE)) {
- configPackage = (String) additionalProperties.get(OPT_CONFIG_PACKAGE);
- } else {
- additionalProperties.put(OPT_CONFIG_PACKAGE, configPackage);
- }
-
- if (additionalProperties.containsKey(INVOKER_PACKAGE)) {
- invokerPackage = (String) additionalProperties.get(INVOKER_PACKAGE);
- } else {
- additionalProperties.put(INVOKER_PACKAGE, invokerPackage);
- }
-
- // Get boolean properties
- if (additionalProperties.containsKey(USE_BEANVALIDATION)) {
- this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION));
- }
- writePropertyBack(USE_BEANVALIDATION, useBeanValidation);
-
if (additionalProperties.containsKey(OPT_CONFIGURE_AUTH)) {
this.configureAuthorization = convertPropertyToBoolean(OPT_CONFIGURE_AUTH);
}
writePropertyBack(OPT_CONFIGURE_AUTH, configureAuthorization);
- // Get enum properties
- if (additionalProperties.containsKey(OPT_BUILD)) {
- switch ((String) additionalProperties.get(OPT_BUILD)) {
- case OPT_BUILD_GRADLE:
- case OPT_BUILD_MAVEN:
- case OPT_BUILD_ALL:
- this.buildTool = (String) additionalProperties.get(OPT_BUILD);
- break;
- default:
- throw new RuntimeException("Build tool \"" + additionalProperties.get(OPT_BUILD) + "\" is not supported or misspelled.");
- }
- }
- additionalProperties.put(OPT_BUILD, buildTool);
-
- if (additionalProperties.containsKey(OPT_TEST)) {
- switch ((String) additionalProperties.get(OPT_TEST)) {
- case OPT_TEST_JUNIT:
- case OPT_TEST_SPOCK:
- this.testTool = (String) additionalProperties.get(OPT_TEST);
- break;
- default:
- throw new RuntimeException("Test tool \"" + additionalProperties.get(OPT_TEST) + "\" is not supported or misspelled.");
- }
- }
- additionalProperties.put(OPT_TEST, testTool);
- if (testTool.equals(OPT_TEST_JUNIT)) {
- additionalProperties.put("isTestJunit", true);
- } else if (testTool.equals(OPT_TEST_SPOCK)) {
- additionalProperties.put("isTestSpock", true);
- }
+ // Write property that is present in server
+ writePropertyBack(OPT_USE_AUTH, true);
final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/");
- final String apiFolder = (sourceFolder + '/' + apiPackage).replace(".", "/");
-
- // Add all the supporting files
- String resourceFolder = projectFolder + "/resources";
- supportingFiles.add(new SupportingFile("configuration/application.yml.mustache", resourceFolder, "application.yml").doNotOverwrite());
// Authorization files
if (configureAuthorization) {
final String authFolder = invokerFolder + "/auth";
- supportingFiles.add(new SupportingFile("auth/Authorization.mustache", authFolder, "Authorization.java"));
- supportingFiles.add(new SupportingFile("auth/AuthorizationBinder.mustache", authFolder, "AuthorizationBinder.java"));
- supportingFiles.add(new SupportingFile("auth/Authorizations.mustache", authFolder, "Authorizations.java"));
- supportingFiles.add(new SupportingFile("auth/AuthorizationFilter.mustache", authFolder, "AuthorizationFilter.java"));
+ supportingFiles.add(new SupportingFile("client/auth/Authorization.mustache", authFolder, "Authorization.java"));
+ supportingFiles.add(new SupportingFile("client/auth/AuthorizationBinder.mustache", authFolder, "AuthorizationBinder.java"));
+ supportingFiles.add(new SupportingFile("client/auth/Authorizations.mustache", authFolder, "Authorizations.java"));
+ supportingFiles.add(new SupportingFile("client/auth/AuthorizationFilter.mustache", authFolder, "AuthorizationFilter.java"));
final String authConfigurationFolder = authFolder + "/configuration";
- supportingFiles.add(new SupportingFile("auth/configuration/ApiKeyAuthConfiguration.mustache", authConfigurationFolder, "ApiKeyAuthConfiguration.java"));
- supportingFiles.add(new SupportingFile("auth/configuration/ConfigurableAuthorization.mustache", authConfigurationFolder, "ConfigurableAuthorization.java"));
- supportingFiles.add(new SupportingFile("auth/configuration/HttpBasicAuthConfiguration.mustache", authConfigurationFolder, "HttpBasicAuthConfiguration.java"));
+ supportingFiles.add(new SupportingFile("client/auth/configuration/ApiKeyAuthConfiguration.mustache", authConfigurationFolder, "ApiKeyAuthConfiguration.java"));
+ supportingFiles.add(new SupportingFile("client/auth/configuration/ConfigurableAuthorization.mustache", authConfigurationFolder, "ConfigurableAuthorization.java"));
+ supportingFiles.add(new SupportingFile("client/auth/configuration/HttpBasicAuthConfiguration.mustache", authConfigurationFolder, "HttpBasicAuthConfiguration.java"));
}
- // Query files
- final String queryFolder = invokerFolder + "/query";
- supportingFiles.add(new SupportingFile("query/QueryParam.mustache", queryFolder, "QueryParam.java"));
- supportingFiles.add(new SupportingFile("query/QueryParamBinder.mustache", queryFolder, "QueryParamBinder.java"));
-
- if (buildTool.equals(OPT_BUILD_GRADLE) || buildTool.equals(OPT_BUILD_ALL)) {
- // Gradle files
- supportingFiles.add(new SupportingFile("configuration/gradle/build.gradle.mustache", "", "build.gradle").doNotOverwrite());
- supportingFiles.add(new SupportingFile("configuration/gradle/settings.gradle.mustache", "", "settings.gradle").doNotOverwrite());
- supportingFiles.add(new SupportingFile("configuration/gradle/gradle.properties.mustache", "", "gradle.properties").doNotOverwrite());
-
- // Gradlew files
- final String gradleWrapperFolder = "gradle/wrapper";
- supportingFiles.add(new SupportingFile("configuration/gradlew/gradlew.mustache", "", "gradlew"));
- supportingFiles.add(new SupportingFile("configuration/gradlew/gradlew.bat.mustache", "", "gradlew.bat"));
- supportingFiles.add(new SupportingFile("configuration/gradlew/gradle-wrapper.properties.mustache", gradleWrapperFolder, "gradle-wrapper.properties"));
- supportingFiles.add(new SupportingFile("configuration/gradlew/gradle-wrapper.jar", gradleWrapperFolder, "gradle-wrapper.jar"));
- }
-
- if (buildTool.equals(OPT_BUILD_MAVEN) || buildTool.equals(OPT_BUILD_ALL)) {
- // Maven files
- supportingFiles.add(new SupportingFile("configuration/pom.xml.mustache", "", "pom.xml").doNotOverwrite());
-
- // Maven wrapper files
- supportingFiles.add(new SupportingFile("configuration/mavenw/mvnw.mustache", "", "mvnw"));
- supportingFiles.add(new SupportingFile("configuration/mavenw/mvnw.bat.mustache", "", "mvnw.bat"));
- supportingFiles.add(new SupportingFile("configuration/mavenw/MavenWrapperDownloader.java.mustache", ".mvn/wrapper", "MavenWrapperDownloader.java"));
- supportingFiles.add(new SupportingFile("configuration/mavenw/maven-wrapper.jar.mustache", ".mvn/wrapper", "maven-wrapper.jar"));
- supportingFiles.add(new SupportingFile("configuration/mavenw/maven-wrapper.properties.mustache", ".mvn/wrapper", "maren-wrapper.properties"));
- }
-
- // Git files
- supportingFiles.add(new SupportingFile("configuration/git/gitignore.mustache", "", ".gitignore").doNotOverwrite());
-
- // Use the default java Date
- typeMapping.put("date", "LocalDate");
- typeMapping.put("DateTime", "LocalDateTime");
- importMapping.put("LocalDate", "java.time.LocalDate");
- importMapping.put("LocalDateTime", "java.time.LocalDateTime");
-
- // Add documentation files
- supportingFiles.add(new SupportingFile("doc/README.mustache", "", "README.md").doNotOverwrite());
- supportingFiles.add(new SupportingFile("doc/auth.mustache", apiDocPath, "auth.md"));
- modelDocTemplateFiles.put("doc/model_doc.mustache", ".md");
- apiDocTemplateFiles.put("doc/api_doc.mustache", ".md");
- modelDocTemplateFiles.remove("model_doc.mustache");
- apiDocTemplateFiles.remove("api_doc.mustache");
-
- // Add model files
- modelTemplateFiles.remove("model.mustache");
- modelTemplateFiles.put("model/model.mustache", ".java");
+ // Api file
+ apiTemplateFiles.clear();
+ apiTemplateFiles.put("client/api.mustache", ".java");
// Add test files
+ apiTestTemplateFiles.clear();
if (testTool.equals(OPT_TEST_JUNIT)) {
- apiTestTemplateFiles.put("api_test.mustache", ".java");
- modelTestTemplateFiles.put("model_test.mustache", ".java");
+ apiTestTemplateFiles.put("client/test/api_test.mustache", ".java");
} else if (testTool.equals(OPT_TEST_SPOCK)) {
- apiTestTemplateFiles.put("api_test.groovy.mustache", ".groovy");
- modelTestTemplateFiles.put("model_test.groovy.mustache", ".groovy");
+ apiTestTemplateFiles.put("client/test/api_test.groovy.mustache", ".groovy");
}
- }
- @Override
- public String apiTestFileFolder() {
- if (testTool.equals(OPT_TEST_SPOCK)) {
- return getOutputDir() + "/src/test/groovy/" + getInvokerPackage().replaceAll("\\.", "/") + "/api";
- }
- return getOutputDir() + "/src/test/java/" + getInvokerPackage().replaceAll("\\.", "/") + "/api";
- }
-
- @Override
- public String modelTestFileFolder() {
- if (testTool.equals(OPT_TEST_SPOCK)) {
- return getOutputDir() + "/src/test/groovy/" + getInvokerPackage().replaceAll("\\.", "/") + "/model";
- }
- return getOutputDir() + "/src/test/java/" + getInvokerPackage().replaceAll("\\.", "/") + "/model";
- }
-
- @Override
- public String toApiTestFilename(String name) {
- if (testTool.equals(OPT_TEST_SPOCK)) {
- return toApiName(name) + "Spec";
- }
- return toApiName(name) + "Test";
- }
-
- @Override
- public String toModelTestFilename(String name) {
- if (testTool.equals(OPT_TEST_SPOCK)) {
- return toModelName(name) + "Spec";
- }
- return toModelName(name) + "Test";
- }
-
- @Override
- public void setUseBeanValidation(boolean useBeanValidation) {
- this.useBeanValidation = useBeanValidation;
- }
-
- @Override
- public String toApiVarName(String name) {
- String apiVarName = super.toApiVarName(name);
- if (reservedWords.contains(apiVarName)) {
- apiVarName = escapeReservedWord(apiVarName);
- }
- return apiVarName;
- }
-
- public boolean isUseBeanValidation() {
- return useBeanValidation;
- }
-
- public boolean isConfigureAuthorization() {
- return configureAuthorization;
+ // Add documentation files
+ supportingFiles.add(new SupportingFile("client/doc/README.mustache", "", "README.md").doNotOverwrite());
+ supportingFiles.add(new SupportingFile("client/doc/auth.mustache", apiDocPath, "auth.md"));
+ apiDocTemplateFiles.clear();
+ apiDocTemplateFiles.put("client/doc/api_doc.mustache", ".md");
}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautServerCodegen.java
new file mode 100644
index 0000000000..da071b68ec
--- /dev/null
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautServerCodegen.java
@@ -0,0 +1,178 @@
+package org.openapitools.codegen.languages;
+
+import org.openapitools.codegen.*;
+import org.openapitools.codegen.meta.GeneratorMetadata;
+import org.openapitools.codegen.meta.Stability;
+import org.openapitools.codegen.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+
+public class JavaMicronautServerCodegen extends JavaMicronautAbstractCodegen {
+ public static final String OPT_CONTROLLER_PACKAGE = "controllerPackage";
+ public static final String OPT_GENERATE_CONTROLLER_FROM_EXAMPLES = "generateControllerFromExamples";
+ public static final String OPT_GENERATE_CONTROLLER_AS_ABSTRACT = "generateControllerAsAbstract";
+
+ private final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class);
+
+ public static final String NAME = "java-micronaut-server";
+
+ protected String controllerPackage = "org.openapitools.controller";
+ protected boolean generateControllerAsAbstract = false;
+ protected boolean generateControllerFromExamples = false;
+ protected boolean useAuth = true;
+
+ protected String controllerPrefix = "";
+ protected String controllerSuffix = "Controller";
+ protected String apiPrefix = "Abstract";
+ protected String apiSuffix = "Controller";
+
+ public JavaMicronautServerCodegen() {
+ super();
+
+ title = "OpenAPI Micronaut Server";;
+ apiPackage = "org.openapitools.api";
+ apiDocPath = "docs/controllers";
+
+ generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
+ .stability(Stability.BETA)
+ .build();
+ additionalProperties.put("server", "true");
+
+ cliOptions.add(new CliOption(OPT_CONTROLLER_PACKAGE, "The package in which controllers will be generated").defaultValue(apiPackage));
+ cliOptions.removeIf(c -> c.getOpt().equals(CodegenConstants.API_PACKAGE));
+ cliOptions.add(CliOption.newBoolean(OPT_GENERATE_CONTROLLER_FROM_EXAMPLES,
+ "Generate the implementation of controller and tests from parameter and return examples that will verify that the api works as desired (for testing)",
+ generateControllerFromExamples));
+ cliOptions.add(CliOption.newBoolean(OPT_GENERATE_CONTROLLER_AS_ABSTRACT,
+ "Generate an abstract class for controller to be extended. (" + CodegenConstants.API_PACKAGE +
+ " is then used for the abstract class, and " + OPT_CONTROLLER_PACKAGE +
+ " is used for implementation that extends it.)",
+ generateControllerAsAbstract));
+ cliOptions.add(CliOption.newBoolean(OPT_USE_AUTH, "Whether to import authorization and to annotate controller methods accordingly", useAuth));
+
+ // Set the type mappings
+ // It could be also StreamingFileUpload
+ typeMapping.put("file", "CompletedFileUpload");
+ importMapping.put("CompletedFileUpload", "io.micronaut.http.multipart.CompletedFileUpload");
+ }
+
+ @Override
+ public CodegenType getTag() {
+ return CodegenType.SERVER;
+ }
+
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+ @Override
+ public String getHelp() {
+ return "Generates a Java Micronaut Server.";
+ }
+
+ @Override
+ public void processOpts() {
+ // Get all the properties that require to know if user specified them directly
+ if (additionalProperties.containsKey(OPT_GENERATE_CONTROLLER_AS_ABSTRACT)) {
+ generateControllerAsAbstract = convertPropertyToBoolean(OPT_GENERATE_CONTROLLER_AS_ABSTRACT);
+ }
+ writePropertyBack(OPT_GENERATE_CONTROLLER_AS_ABSTRACT, generateControllerAsAbstract);
+
+ if (additionalProperties.containsKey(OPT_CONTROLLER_PACKAGE)) {
+ controllerPackage = (String) additionalProperties.get(OPT_CONTROLLER_PACKAGE);
+ } else if (!generateControllerAsAbstract && additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) {
+ controllerPackage = (String) additionalProperties.get(CodegenConstants.API_PACKAGE);
+ }
+ additionalProperties.put(OPT_CONTROLLER_PACKAGE, controllerPackage);
+
+ if (!generateControllerAsAbstract) {
+ apiPackage = controllerPackage;
+ additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
+ }
+ super.processOpts();
+
+ // Get all the other properties after superclass processed everything
+ if (additionalProperties.containsKey(OPT_GENERATE_CONTROLLER_FROM_EXAMPLES)) {
+ generateControllerFromExamples = convertPropertyToBoolean(OPT_GENERATE_CONTROLLER_FROM_EXAMPLES);
+ }
+ writePropertyBack(OPT_GENERATE_CONTROLLER_FROM_EXAMPLES, generateControllerFromExamples);
+
+ if (additionalProperties.containsKey(OPT_USE_AUTH)) {
+ useAuth = convertPropertyToBoolean(OPT_USE_AUTH);
+ }
+ writePropertyBack(OPT_USE_AUTH, useAuth);
+
+ // Api file
+ apiTemplateFiles.clear();
+ if (generateControllerAsAbstract) {
+ setApiNamePrefix(apiPrefix);
+ setApiNameSuffix(apiSuffix);
+ } else {
+ setApiNamePrefix(controllerPrefix);
+ setApiNameSuffix(controllerSuffix);
+ }
+ apiTemplateFiles.put("server/controller.mustache", ".java");
+
+ // Add documentation files
+ supportingFiles.add(new SupportingFile("server/doc/README.mustache", "", "README.md").doNotOverwrite());
+ apiDocTemplateFiles.clear();
+ apiDocTemplateFiles.put("server/doc/controller_doc.mustache", ".md");
+
+ // Add test files
+ apiTestTemplateFiles.clear();
+ // Controller Implementation is generated as a test file - so that it is not overwritten
+ if (generateControllerAsAbstract) {
+ apiTestTemplateFiles.put("server/controllerImplementation.mustache", ".java");
+ }
+ if (testTool.equals(OPT_TEST_JUNIT)) {
+ apiTestTemplateFiles.put("server/test/controller_test.mustache", ".java");
+ } else if (testTool.equals(OPT_TEST_SPOCK)) {
+ apiTestTemplateFiles.put("server/test/controller_test.groovy.mustache", ".groovy");
+ }
+
+ // Add Application.java file
+ String invokerFolder = (sourceFolder + '/' + invokerPackage).replace('.', '/');
+ supportingFiles.add(new SupportingFile("common/configuration/Application.mustache", invokerFolder, "Application.java").doNotOverwrite());
+ }
+
+ @Override
+ public String apiTestFilename(String templateName, String tag) {
+ if (generateControllerAsAbstract && templateName.contains("controllerImplementation")) {
+ return (
+ outputFolder + File.separator +
+ sourceFolder + File.separator +
+ controllerPackage.replace('.', File.separatorChar) + File.separator +
+ StringUtils.camelize(controllerPrefix + "_" + tag + "_" + controllerSuffix) + ".java"
+ ).replace('/', File.separatorChar);
+ }
+
+ return super.apiTestFilename(templateName, tag);
+ }
+
+ @Override
+ public void setParameterExampleValue(CodegenParameter p) {
+ super.setParameterExampleValue(p);
+
+ if (p.isFile) {
+ // The CompletedFileUpload cannot be initialized
+ p.example = "null";
+ }
+ }
+
+ @Override
+ public Map postProcessOperationsWithModels(Map objs, List allModels) {
+ objs = super.postProcessOperationsWithModels(objs, allModels);
+
+ // Add the controller classname to operations
+ Map operations = (Map) objs.get("operations");
+ String controllerClassname = StringUtils.camelize(controllerPrefix + "_" + operations.get("pathPrefix") + "_" + controllerSuffix);
+ objs.put("controllerClassname", controllerClassname);
+
+ return objs;
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
index d5911a2139..434911baff 100644
--- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
+++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
@@ -58,6 +58,7 @@ org.openapitools.codegen.languages.JavaClientCodegen
org.openapitools.codegen.languages.JavaCXFClientCodegen
org.openapitools.codegen.languages.JavaInflectorServerCodegen
org.openapitools.codegen.languages.JavaMicronautClientCodegen
+org.openapitools.codegen.languages.JavaMicronautServerCodegen
org.openapitools.codegen.languages.JavaMSF4JServerCodegen
org.openapitools.codegen.languages.JavaPKMSTServerCodegen
org.openapitools.codegen.languages.JavaPlayFrameworkCodegen
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/api.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/api.mustache
deleted file mode 100644
index 4232340e52..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/api.mustache
+++ /dev/null
@@ -1,70 +0,0 @@
-{{>licenseInfo}}
-package {{package}};
-
-import io.micronaut.http.annotation.*;
-import io.micronaut.core.annotation.*;
-import io.micronaut.http.client.annotation.Client;
-{{#configureAuth}}
-import {{invokerPackage}}.auth.Authorization;
-{{/configureAuth}}
-import {{invokerPackage}}.query.QueryParam;
-import io.micronaut.core.convert.format.Format;
-import reactor.core.publisher.Mono;
-{{#imports}}import {{import}};
-{{/imports}}
-import javax.annotation.Generated;
-{{^fullJavaUtil}}
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-{{/fullJavaUtil}}{{#useBeanValidation}}
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-{{/useBeanValidation}}
-
-{{>generatedAnnotation}}
-@Client("${base-path}")
-public interface {{classname}} {
-{{#operations}}{{#operation}}
- /**
- {{#summary}}
- * {{summary}}
- {{/summary}}
- {{#notes}}
- * {{notes}}
- {{/notes}}
- {{^summary}}
- {{^notes}}
- * {{nickname}}
- {{/notes}}
- {{/summary}}
- *
-{{#allParams}}
- * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
-{{/allParams}}
-{{#returnType}}
- * @return {{returnType}}
-{{/returnType}}
-{{#externalDocs}}
- * {{description}}
- * @see {{summary}} Documentation
-{{/externalDocs}}
- */
- @{{#lambda.pascalcase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.pascalcase}}(uri="{{{path}}}")
- {{#vendorExtensions.x-contentType}}
- @Produces(value={"{{vendorExtensions.x-contentType}}"})
- {{/vendorExtensions.x-contentType}}
- @Consumes(value={"{{vendorExtensions.x-accepts}}"})
- {{!auth methods}}
- {{#configureAuth}}
- {{#authMethods}}
- @Authorization(name="{{{name}}}"{{!scopes}}{{#isOAuth}}, scopes={{=< >=}}{<={{ }}=>{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}{{=< >=}}}<={{ }}=>{{/isOAuth}})
- {{/authMethods}}
- {{/configureAuth}}
- {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}({{^allParams}});{{/allParams}}{{#allParams}}
- {{>params/queryParams}}{{>params/pathParams}}{{>params/headerParams}}{{>params/bodyParams}}{{>params/formParams}}{{>params/cookieParams}}{{^-last}}, {{/-last}}{{#-last}}
- );{{/-last}}{{/allParams}}
- {{/operation}}
-{{/operations}}
-}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/gradle.properties.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/gradle.properties.mustache
deleted file mode 100644
index 4804e04901..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/gradle.properties.mustache
+++ /dev/null
@@ -1 +0,0 @@
-micronautVersion=3.0.0-M5
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/model_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/model_doc.mustache
deleted file mode 100644
index 3f14f65358..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/model_doc.mustache
+++ /dev/null
@@ -1,4 +0,0 @@
-{{#models}}{{#model}}
-
-{{#isEnum}}{{>doc/enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>doc/pojo_doc}}{{/isEnum}}
-{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/beanValidation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/beanValidation.mustache
deleted file mode 100644
index bbc797247e..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/beanValidation.mustache
+++ /dev/null
@@ -1,52 +0,0 @@
-{{#useBeanValidation}}{{!
-validate all pojos and enums
-}}{{^isContainer}}{{#isModel}} @Valid
-{{/isModel}}{{/isContainer}}{{!
-nullable & nonnull
-}}{{#required}}{{#isNullable}} @Nullable
-{{/isNullable}}{{^isNullable}} @NotNull
-{{/isNullable}}{{/required}}{{^required}} @Nullable
-{{/required}}{{!
-pattern
-}}{{#pattern}}{{^isByteArray}} @Pattern(regexp="{{{pattern}}}")
-{{/isByteArray}}{{/pattern}}{{!
-both minLength && maxLength
-}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}}, max={{maxLength}})
-{{/maxLength}}{{/minLength}}{{!
-just minLength
-}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}})
-{{/maxLength}}{{/minLength}}{{!
-just maxLength
-}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}})
-{{/maxLength}}{{/minLength}}{{!
-@Size: both minItems && maxItems
-}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}}, max={{maxItems}})
-{{/maxItems}}{{/minItems}}{{!
-@Size: just minItems
-}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}})
-{{/maxItems}}{{/minItems}}{{!
-@Size: just maxItems
-}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}})
-{{/maxItems}}{{/minItems}}{{!
-@Email
-}}{{#isEmail}} @Email
-{{/isEmail}}{{!
-check for integer or long / all others=decimal type with @Decimal*
-isInteger set
-}}{{#isInteger}}{{#minimum}} @Min({{minimum}})
-{{/minimum}}{{#maximum}} @Max({{maximum}})
-{{/maximum}}{{/isInteger}}{{!
-isLong set
-}}{{#isLong}}{{#minimum}} @Min({{minimum}}L)
-{{/minimum}}{{#maximum}} @Max({{maximum}}L)
-{{/maximum}}{{/isLong}}{{!
-Not Integer, not Long => we have a decimal value!
-}}{{^isInteger}}{{^isLong}}{{!
-minimum for decimal value
-}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}}, inclusive=false{{/exclusiveMinimum}})
-{{/minimum}}{{!
-maximal for decimal value
-}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}}, inclusive=false{{/exclusiveMaximum}})
-{{/maximum}}{{!
-close decimal values
-}}{{/isLong}}{{/isInteger}}{{/useBeanValidation}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/jackson_annotations.mustache
deleted file mode 100644
index b7f047ee54..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/jackson_annotations.mustache
+++ /dev/null
@@ -1,26 +0,0 @@
-{{!
- If this is map and items are nullable, make sure that nulls are included.
- To determine what JsonInclude.Include method to use, consider the following:
- * If the field is required, always include it, even if it is null.
- * Else use custom behaviour, IOW use whatever is defined on the object mapper
- }}
- @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
- @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
- {{#withXml}}
- {{^isContainer}}
- @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- {{/isContainer}}
- {{#isContainer}}
- {{#isXmlWrapped}}
- // items.xmlName={{items.xmlName}}
- @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}")
- {{/isXmlWrapped}}
- {{/isContainer}}
- {{/withXml}}
- {{#isDateTime}}
- @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX")
- {{/isDateTime}}
- {{#isDate}}
- @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
- {{/isDate}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelEnum.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelEnum.mustache
deleted file mode 100644
index 3bb6622f08..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelEnum.mustache
+++ /dev/null
@@ -1,61 +0,0 @@
-{{#jackson}}
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-{{/jackson}}
-
-/**
- * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
- */
-{{#additionalEnumTypeAnnotations}}
-{{{.}}}
-{{/additionalEnumTypeAnnotations}}{{#useBeanValidation}}@Introspected
-{{/useBeanValidation}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
- {{#allowableValues}}
- {{#enumVars}}
- {{#enumDescription}}
- /**
- * {{enumDescription}}
- */
- {{/enumDescription}}
- {{#withXml}}
- @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}})
- {{/withXml}}
- {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
- {{/enumVars}}
- {{/allowableValues}}
-
- private {{{dataType}}} value;
-
- {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) {
- this.value = value;
- }
-
- {{#jackson}}
- @JsonValue
- {{/jackson}}
- public {{{dataType}}} getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- {{#jackson}}
- @JsonCreator
- {{/jackson}}
- public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) {
- for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- {{#isNullable}}
- return null;
- {{/isNullable}}
- {{^isNullable}}
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- {{/isNullable}}
- }
-}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache
deleted file mode 100644
index e643ca051c..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache
+++ /dev/null
@@ -1,332 +0,0 @@
-/**
- * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
- */
-{{#description}}
-@ApiModel(description = "{{{description}}}")
-{{/description}}
-{{#jackson}}
-@JsonPropertyOrder({
- {{#vars}}
- {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}}
- {{/vars}}
-})
-@JsonTypeName("{{name}}")
-{{/jackson}}
-{{#additionalModelTypeAnnotations}}
-{{{.}}}
-{{/additionalModelTypeAnnotations}}
-{{>generatedAnnotation}}{{#discriminator}}{{>model/typeInfoAnnotation}}{{/discriminator}}{{>model/xmlAnnotation}}{{#useBeanValidation}}
-@Introspected
-{{/useBeanValidation}}{{!
-Declare the class with extends and implements
-}}public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{
- {{#serializableModel}}
- private static final long serialVersionUID = 1L;
-
- {{/serializableModel}}
- {{#vars}}
- {{#isEnum}}
- {{^isContainer}}
-{{>model/modelInnerEnum}}
- {{/isContainer}}
- {{#isContainer}}
- {{#mostInnerItems}}
-{{>model/modelInnerEnum}}
- {{/mostInnerItems}}
- {{/isContainer}}
- {{/isEnum}}
- public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
- {{#withXml}}
- {{#isXmlAttribute}}
- @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"
- {{/isXmlAttribute}}
- {{^isXmlAttribute}}
- {{^isContainer}}
- @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- {{/isContainer}}
- {{#isContainer}}
- // Is a container wrapped={{isXmlWrapped}}
- {{#items}}
- // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
- // items.example={{example}} items.type={{dataType}}
- @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- {{/items}}
- {{#isXmlWrapped}}
- @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
- {{/isXmlWrapped}}
- {{/isContainer}}
- {{/isXmlAttribute}}
- {{/withXml}}
- {{#vendorExtensions.x-is-jackson-optional-nullable}}
- {{#isContainer}}
- private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined();
- {{/isContainer}}
- {{^isContainer}}
- private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
- {{/isContainer}}
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- {{^vendorExtensions.x-is-jackson-optional-nullable}}
- {{#isContainer}}
- private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}};
- {{/isContainer}}
- {{^isContainer}}
- {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
- {{/isContainer}}
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
-
- {{/vars}}
- {{#parcelableModel}}
- public {{classname}}() {
- {{#parent}}
- super();
- {{/parent}}
- }
-
- {{/parcelableModel}}
- {{#vars}}
- {{^isReadOnly}}
- public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
- {{#vendorExtensions.x-is-jackson-optional-nullable}}
- this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- {{^vendorExtensions.x-is-jackson-optional-nullable}}
- this.{{name}} = {{name}};
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- return this;
- }
-
- {{#isArray}}
- public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
- {{#vendorExtensions.x-is-jackson-optional-nullable}}
- if (this.{{name}} == null || !this.{{name}}.isPresent()) {
- this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}});
- }
- try {
- this.{{name}}.get().add({{name}}Item);
- } catch (java.util.NoSuchElementException e) {
- // this can never happen, as we make sure above that the value is present
- }
- return this;
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- {{^vendorExtensions.x-is-jackson-optional-nullable}}
- {{^required}}
- if (this.{{name}} == null) {
- this.{{name}} = {{{defaultValue}}};
- }
- {{/required}}
- this.{{name}}.add({{name}}Item);
- return this;
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- }
-
- {{/isArray}}
- {{#isMap}}
- public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
- {{#vendorExtensions.x-is-jackson-optional-nullable}}
- if (this.{{name}} == null || !this.{{name}}.isPresent()) {
- this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}});
- }
- try {
- this.{{name}}.get().put(key, {{name}}Item);
- } catch (java.util.NoSuchElementException e) {
- // this can never happen, as we make sure above that the value is present
- }
- return this;
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- {{^vendorExtensions.x-is-jackson-optional-nullable}}
- {{^required}}
- if (this.{{name}} == null) {
- this.{{name}} = {{{defaultValue}}};
- }
- {{/required}}
- this.{{name}}.put(key, {{name}}Item);
- return this;
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- }
-
- {{/isMap}}
- {{/isReadOnly}}
- /**
- {{#description}}
- * {{description}}
- {{/description}}
- {{^description}}
- * Get {{name}}
- {{/description}}
- {{#minimum}}
- * minimum: {{minimum}}
- {{/minimum}}
- {{#maximum}}
- * maximum: {{maximum}}
- {{/maximum}}
- * @return {{name}}
- **/
-{{>model/beanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
- {{#vendorExtensions.x-extra-annotation}}
- {{{vendorExtensions.x-extra-annotation}}}
- {{/vendorExtensions.x-extra-annotation}}
- {{#vendorExtensions.x-is-jackson-optional-nullable}}
-{{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} @JsonIgnore
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- {{^vendorExtensions.x-is-jackson-optional-nullable}}
- {{#jackson}}
-{{>model/jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() {
- {{#vendorExtensions.x-is-jackson-optional-nullable}}
- {{#isReadOnly}}
-{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} if ({{name}} == null) {
- {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
- }
- {{/isReadOnly}}
- return {{name}}.orElse(null);
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- {{^vendorExtensions.x-is-jackson-optional-nullable}}
- return {{name}};
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- }
-
- {{#vendorExtensions.x-is-jackson-optional-nullable}}
-{{>model/jackson_annotations}}
- public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() {
- return {{name}};
- }
-
- @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
- {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
- {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} this.{{name}} = {{name}};
- }
-
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- {{^isReadOnly}}
- {{#jackson}}
- {{^vendorExtensions.x-is-jackson-optional-nullable}}
-{{>model/jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}}{{#vendorExtensions.x-setter-extra-annotation}}
- {{{vendorExtensions.x-setter-extra-annotation}}}
-{{/vendorExtensions.x-setter-extra-annotation}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
- {{#vendorExtensions.x-is-jackson-optional-nullable}}
- this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- {{^vendorExtensions.x-is-jackson-optional-nullable}}
- this.{{name}} = {{name}};
- {{/vendorExtensions.x-is-jackson-optional-nullable}}
- }
-
- {{/isReadOnly}}
- {{/vars}}
- @Override
- public boolean equals(Object o) {
- {{#useReflectionEqualsHashCode}}
- return EqualsBuilder.reflectionEquals(this, o, false, null, true);
- {{/useReflectionEqualsHashCode}}
- {{^useReflectionEqualsHashCode}}
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- {{#hasVars}}
- {{classname}} {{classVarName}} = ({{classname}}) o;
- return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} &&
- {{/-last}}{{/vars}}{{#parent}} &&
- super.equals(o){{/parent}};
- {{/hasVars}}
- {{^hasVars}}
- return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};
- {{/hasVars}}
- {{/useReflectionEqualsHashCode}}
- }
-
- @Override
- public int hashCode() {
- {{#useReflectionEqualsHashCode}}
- return HashCodeBuilder.reflectionHashCode(this);
- {{/useReflectionEqualsHashCode}}
- {{^useReflectionEqualsHashCode}}
- return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}});
- {{/useReflectionEqualsHashCode}}
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class {{classname}} {\n");
- {{#parent}}
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- {{/parent}}
- {{#vars}}
- sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n");
- {{/vars}}
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-
- {{#parcelableModel}}
- public void writeToParcel(Parcel out, int flags) {
- {{#model}}
- {{#isArray}}
- out.writeList(this);
- {{/isArray}}
- {{^isArray}}
- {{#parent}}
- super.writeToParcel(out, flags);
- {{/parent}}
- {{#vars}}
- out.writeValue({{name}});
- {{/vars}}
- {{/isArray}}
- {{/model}}
- }
-
- {{classname}}(Parcel in) {
- {{#isArray}}
- in.readTypedList(this, {{arrayModelType}}.CREATOR);
- {{/isArray}}
- {{^isArray}}
- {{#parent}}
- super(in);
- {{/parent}}
- {{#vars}}
- {{#isPrimitiveType}}
- {{name}} = ({{{datatypeWithEnum}}})in.readValue(null);
- {{/isPrimitiveType}}
- {{^isPrimitiveType}}
- {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader());
- {{/isPrimitiveType}}
- {{/vars}}
- {{/isArray}}
- }
-
- public int describeContents() {
- return 0;
- }
-
- public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() {
- public {{classname}} createFromParcel(Parcel in) {
- {{#model}}
- {{#isArray}}
- {{classname}} result = new {{classname}}();
- result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader()));
- return result;
- {{/isArray}}
- {{^isArray}}
- return new {{classname}}(in);
- {{/isArray}}
- {{/model}}
- }
- public {{classname}}[] newArray(int size) {
- return new {{classname}}[size];
- }
- };
- {{/parcelableModel}}
-}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/bodyParams.mustache
deleted file mode 100644
index b111ea9e05..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/bodyParams.mustache
+++ /dev/null
@@ -1 +0,0 @@
-{{#isBodyParam}}@Body {{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isBodyParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/cookieParams.mustache
deleted file mode 100644
index fab940b746..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/cookieParams.mustache
+++ /dev/null
@@ -1 +0,0 @@
-{{#isCookieParam}}@CookieValue(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{defaultValue}}"{{/defaultValue}}) {{>params/beanValidationCore}}{{>params/type}} {{paramName}}{{/isCookieParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/formParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/formParams.mustache
deleted file mode 100644
index e41f37e421..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/formParams.mustache
+++ /dev/null
@@ -1 +0,0 @@
-{{#isFormParam}}{{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isFormParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/headerParams.mustache
deleted file mode 100644
index 9aab83b546..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/headerParams.mustache
+++ /dev/null
@@ -1 +0,0 @@
-{{#isHeaderParam}}@Header(name="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isHeaderParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/pathParams.mustache
deleted file mode 100644
index c67b97ed3f..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/pathParams.mustache
+++ /dev/null
@@ -1 +0,0 @@
-{{#isPathParam}}@PathVariable(name="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isPathParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/queryParams.mustache
deleted file mode 100644
index 7ef4450058..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/queryParams.mustache
+++ /dev/null
@@ -1 +0,0 @@
-{{#isQueryParam}}@QueryParam(name="{{{baseName}}}"{{!default value}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{!multi format}}{{#isCollectionFormatMulti}}, format=QueryParam.Format.MULTI{{/isCollectionFormatMulti}}{{!deep object}}{{#isDeepObject}}, format=QueryParam.Format.DEEP_OBJECT{{/isDeepObject}}{{!other collection formats}}{{^isCollectionFormatMulti}}{{^isDeepObject}}{{#collectionFormat}}, format=QueryParam.Format.{{#lambda.uppercase}}{{collectionFormat}}{{/lambda.uppercase}}{{/collectionFormat}}{{/isDeepObject}}{{/isCollectionFormatMulti}}) {{!validation and type}}{{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isQueryParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParam.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParam.mustache
deleted file mode 100644
index 4c3e845a1b..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParam.mustache
+++ /dev/null
@@ -1,78 +0,0 @@
-{{>licenseInfo}}
-package {{invokerPackage}}.query;
-
-import io.micronaut.context.annotation.AliasFor;
-import io.micronaut.core.bind.annotation.Bindable;
-import javax.annotation.Generated;
-import java.lang.annotation.*;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-
-/**
- * Indicates that the parameter is a query parameter
- */
-{{>generatedAnnotation}}
-@Documented
-@Retention(RUNTIME)
-@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
-@Bindable
-@Inherited
-public @interface QueryParam {
-
- /**
- * @return The name of the parameter
- */
- @AliasFor(annotation = Bindable.class, member = "value")
- String value() default "";
-
- /**
- * @return The name of the parameter
- */
- @AliasFor(annotation = Bindable.class, member = "value")
- String name() default "";
-
- /**
- * @see Bindable#defaultValue()
- * @return The default value
- */
- @AliasFor(annotation = Bindable.class, member = "defaultValue")
- String defaultValue() default "";
-
- /**
- * @return The format of the given values in the URL
- */
- Format format() default Format.CSV;
-
- /**
- * The possible formats of the query parameter in the URL.
- * The conversion of various types is according to openapi v3 specification:
- * @see openapi v3 specification
- * Values are serialized using Jackson object mapper
- */
- public static enum Format {
- /**
- * The values of iterator are comma-delimited.
- * Ambiguity can arise if values of Iterator contain commas inside themselves. In such case, the MULTI format
- * should be preferred.
- * Null values are not supported and will be removed during the conversion process.
- */
- CSV,
- /**
- * The values are space-delimited, similarly to comma-delimited format.
- */
- SSV,
- /**
- * The values a delimited by pipes "|", similarly to comma-delimited format.
- */
- PIPES,
- /**
- * The values are repeated as separate parameters, e.g.: color=blue&color=black&color=brown.
- */
- MULTI,
- /**
- * The format supports 1-depth recursion into objects with setting each attribute as a separate parameter, e.g.:
- * 'color[R]=100&color[G]=200&color[B]=150'.
- */
- DEEP_OBJECT
- }
-}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParamBinder.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParamBinder.mustache
deleted file mode 100644
index 2a90b8b665..0000000000
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParamBinder.mustache
+++ /dev/null
@@ -1,164 +0,0 @@
-{{>licenseInfo}}
-package {{invokerPackage}}.query;
-
-import io.micronaut.core.annotation.NonNull;
-import io.micronaut.core.beans.BeanProperty;
-import io.micronaut.core.beans.BeanWrapper;
-import io.micronaut.core.convert.ArgumentConversionContext;
-import io.micronaut.core.convert.ConversionContext;
-import io.micronaut.core.convert.ConversionService;
-import io.micronaut.core.util.StringUtils;
-import io.micronaut.http.MutableHttpRequest;
-import io.micronaut.http.client.bind.AnnotatedClientArgumentRequestBinder;
-import io.micronaut.http.client.bind.ClientRequestUriContext;
-
-import java.util.Collection;
-import java.util.Optional;
-import jakarta.inject.Singleton;
-import javax.annotation.Generated;
-
-
-{{>generatedAnnotation}}
-@Singleton
-public class QueryParamBinder implements AnnotatedClientArgumentRequestBinder {
- private static final Character COMMA_DELIMITER = ',';
- private static final Character PIPE_DELIMITER = '|';
- private static final Character SPACE_DELIMITER = ' ';
-
- private final ConversionService> conversionService;
-
- public QueryParamBinder(ConversionService> conversionService) {
- this.conversionService = conversionService;
- }
-
- @NonNull
- @Override
- public Class getAnnotationType() {
- return QueryParam.class;
- }
-
- @Override
- public void bind(@NonNull ArgumentConversionContext context,
- @NonNull ClientRequestUriContext uriContext,
- @NonNull Object value,
- @NonNull MutableHttpRequest> request
- ) {
- String key = context.getAnnotationMetadata().stringValue(QueryParam.class)
- .filter(StringUtils::isNotEmpty)
- .orElse(context.getArgument().getName());
-
- QueryParam.Format format = context.getAnnotationMetadata()
- .enumValue(QueryParam.class, "format", QueryParam.Format.class)
- .orElse(QueryParam.Format.CSV);
-
- if (format == QueryParam.Format.DEEP_OBJECT) {
- addDeepObjectParameters(context, value, key, uriContext);
- } else if (format == QueryParam.Format.MULTI) {
- addMultiParameters(context, value, key, uriContext);
- } else {
- Character delimiter = ' ';
- switch (format) {
- case SSV:
- delimiter = SPACE_DELIMITER;
- break;
- case PIPES:
- delimiter = PIPE_DELIMITER;
- break;
- case CSV:
- delimiter = COMMA_DELIMITER;
- break;
- default:
- }
- createSeparatedQueryParam(context, value, delimiter)
- .ifPresent(v -> uriContext.addQueryParameter(key, v));
- }
- }
-
- private void addMultiParameters(
- ArgumentConversionContext context, Object value, String key, ClientRequestUriContext uriContext
- ) {
- if (value instanceof Iterable) {
- // noinspection unchecked
- Iterable> iterable = (Iterable>) value;
-
- for (Object item : iterable) {
- convertToString(context, item).ifPresent(v -> uriContext.addQueryParameter(key, v));
- }
- } else {
- convertToString(context, value).ifPresent(v -> uriContext.addQueryParameter(key, v));
- }
- }
-
- private void addDeepObjectParameters(
- ArgumentConversionContext context, Object value, String key, ClientRequestUriContext uriContext
- ) {
- if (value instanceof Iterable) {
- StringBuilder builder = new StringBuilder(key);
-
- Iterable> iterable = (Iterable>) value;
-
- int i = 0;
- for (Object item: iterable) {
- if (item == null) {
- continue;
- }
- String index = String.valueOf(i);
-
- builder.append('[');
- builder.append(index);
- builder.append(']');
-
- convertToString(context, item).ifPresent(v -> uriContext.addQueryParameter(builder.toString(), v));
- builder.delete(builder.length() - index.length() - 2, builder.length());
- i++;
- }
- } else if (value != null) {
- StringBuilder builder = new StringBuilder(key);
- BeanWrapper wrapper = BeanWrapper.getWrapper(value);
- Collection> properties = wrapper.getBeanProperties();
- for (BeanProperty property: properties) {
- Object item = property.get(value);
- if (item == null) {
- continue;
- }
- builder.append('[');
- builder.append(property.getName());
- builder.append(']');
-
- convertToString(context, item).ifPresent(v -> uriContext.addQueryParameter(builder.toString(), v));
- builder.delete(builder.length() - property.getName().length() - 2, builder.length());
- }
- }
- }
-
- private Optional createSeparatedQueryParam(
- ArgumentConversionContext context, Object value, Character delimiter
- ) {
- if (value instanceof Iterable) {
- StringBuilder builder = new StringBuilder();
- // noinspection unchecked
- Iterable> iterable = (Iterable>) value;
-
- boolean first = true;
- for (Object item : iterable) {
- Optional opt = convertToString(context, item);
- if (opt.isPresent()) {
- if (!first) {
- builder.append(delimiter);
- }
- first = false;
- builder.append(opt.get());
- }
- }
-
- return Optional.of(builder.toString());
- } else {
- return convertToString(context, value);
- }
- }
-
- private Optional convertToString(ArgumentConversionContext context, Object value) {
- return conversionService.convert(value, ConversionContext.STRING.with(context.getAnnotationMetadata()))
- .filter(StringUtils::isNotEmpty);
- }
-}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache
new file mode 100644
index 0000000000..871eb59dfe
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache
@@ -0,0 +1,71 @@
+{{>common/licenseInfo}}
+package {{package}};
+
+import io.micronaut.http.annotation.*;
+import io.micronaut.core.annotation.*;
+import io.micronaut.http.client.annotation.Client;
+{{#configureAuth}}
+import {{invokerPackage}}.auth.Authorization;
+{{/configureAuth}}
+import io.micronaut.core.convert.format.Format;
+import reactor.core.publisher.Mono;
+{{#imports}}import {{import}};
+{{/imports}}
+import javax.annotation.Generated;
+{{^fullJavaUtil}}
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+{{/fullJavaUtil}}{{#useBeanValidation}}
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+{{/useBeanValidation}}
+
+{{>common/generatedAnnotation}}
+@Client("${base-path}")
+public interface {{classname}} {
+{{#operations}}
+ {{#operation}}
+ /**
+ {{#summary}}
+ * {{summary}}
+ {{/summary}}
+ {{#notes}}
+ * {{notes}}
+ {{/notes}}
+ {{^summary}}
+ {{^notes}}
+ * {{nickname}}
+ {{/notes}}
+ {{/summary}}
+ *
+ {{#allParams}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
+ {{/allParams}}
+ {{#returnType}}
+ * @return {{returnType}}
+ {{/returnType}}
+ {{#externalDocs}}
+ * {{description}}
+ * @see {{summary}} Documentation
+{{/externalDocs}}
+ */
+ @{{#lambda.pascalcase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.pascalcase}}(uri="{{{path}}}")
+ {{#vendorExtensions.x-contentType}}
+ @Produces(value={"{{vendorExtensions.x-contentType}}"})
+ {{/vendorExtensions.x-contentType}}
+ @Consumes(value={"{{vendorExtensions.x-accepts}}"})
+ {{!auth methods}}
+ {{#configureAuth}}
+ {{#authMethods}}
+ @Authorization(name="{{{name}}}"{{!scopes}}{{#isOAuth}}, scopes={{openbrace}}{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}{{closebrace}}{{/isOAuth}})
+ {{/authMethods}}
+ {{/configureAuth}}
+ {{!the method definition}}
+ {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}({{^allParams}});{{/allParams}}{{#allParams}}
+ {{>client/params/queryParams}}{{>client/params/pathParams}}{{>client/params/headerParams}}{{>client/params/bodyParams}}{{>client/params/formParams}}{{>client/params/cookieParams}}{{^-last}}, {{/-last}}{{#-last}}
+ );{{/-last}}{{/allParams}}
+ {{/operation}}
+{{/operations}}
+}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorization.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorization.mustache
similarity index 94%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorization.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorization.mustache
index ac5f7f979f..e805e24db6 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorization.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorization.mustache
@@ -1,4 +1,4 @@
-{{>licenseInfo}}
+{{>common/licenseInfo}}
package {{invokerPackage}}.auth;
import io.micronaut.context.annotation.AliasFor;
@@ -14,7 +14,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
import javax.annotation.Generated;
-{{>generatedAnnotation}}
+{{>common/generatedAnnotation}}
@Documented
@Retention(RUNTIME)
@Target(METHOD)
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationBinder.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationBinder.mustache
similarity index 97%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationBinder.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationBinder.mustache
index fad44af0f0..7dc1814c23 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationBinder.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationBinder.mustache
@@ -1,4 +1,4 @@
-{{>licenseInfo}}
+{{>common/licenseInfo}}
package {{invokerPackage}}.auth;
import io.micronaut.aop.MethodInvocationContext;
@@ -15,7 +15,7 @@ import java.util.List;
import javax.annotation.Generated;
-{{>generatedAnnotation}}
+{{>common/generatedAnnotation}}
@Singleton
public class AuthorizationBinder implements AnnotatedClientRequestBinder {
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationFilter.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache
similarity index 99%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationFilter.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache
index 021a5425d3..3bd7a3562d 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationFilter.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache
@@ -1,4 +1,4 @@
-{{>licenseInfo}}
+{{>common/licenseInfo}}
package {{invokerPackage}}.auth;
import io.micronaut.context.BeanContext;
@@ -36,7 +36,7 @@ import java.util.stream.Stream;
import javax.annotation.Generated;
-{{>generatedAnnotation}}
+{{>common/generatedAnnotation}}
@Filter(Filter.MATCH_ALL_PATTERN)
public class AuthorizationFilter implements HttpClientFilter {
private static final Logger LOG = LoggerFactory.getLogger(ClientCredentialsHttpClientFilter.class);
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorizations.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorizations.mustache
similarity index 89%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorizations.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorizations.mustache
index 1ee37c7c1d..7d3fb75cda 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorizations.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorizations.mustache
@@ -1,4 +1,4 @@
-{{>licenseInfo}}
+{{>common/licenseInfo}}
package {{invokerPackage}}.auth;
import io.micronaut.core.bind.annotation.Bindable;
@@ -11,7 +11,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
import javax.annotation.Generated;
-{{>generatedAnnotation}}
+{{>common/generatedAnnotation}}
@Documented
@Retention(RUNTIME)
@Target(METHOD)
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ApiKeyAuthConfiguration.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ApiKeyAuthConfiguration.mustache
similarity index 97%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ApiKeyAuthConfiguration.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ApiKeyAuthConfiguration.mustache
index 969da02fab..28d1da0655 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ApiKeyAuthConfiguration.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ApiKeyAuthConfiguration.mustache
@@ -1,4 +1,4 @@
-{{>licenseInfo}}
+{{>common/licenseInfo}}
package {{invokerPackage}}.auth.configuration;
import io.micronaut.context.annotation.ConfigurationInject;
@@ -10,7 +10,7 @@ import io.micronaut.http.cookie.Cookie;
import javax.annotation.Generated;
-{{>generatedAnnotation}}
+{{>common/generatedAnnotation}}
@EachProperty("security.api-key-auth")
public class ApiKeyAuthConfiguration implements ConfigurableAuthorization {
private final String name;
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ConfigurableAuthorization.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ConfigurableAuthorization.mustache
similarity index 84%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ConfigurableAuthorization.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ConfigurableAuthorization.mustache
index 2d649c3a3b..ab87ecfc02 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ConfigurableAuthorization.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ConfigurableAuthorization.mustache
@@ -1,4 +1,4 @@
-{{>licenseInfo}}
+{{>common/licenseInfo}}
package {{invokerPackage}}.auth.configuration;
import io.micronaut.core.annotation.NonNull;
@@ -6,7 +6,7 @@ import io.micronaut.http.MutableHttpRequest;
import javax.annotation.Generated;
-{{>generatedAnnotation}}
+{{>common/generatedAnnotation}}
public interface ConfigurableAuthorization {
String getName();
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/HttpBasicAuthConfiguration.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/HttpBasicAuthConfiguration.mustache
similarity index 96%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/HttpBasicAuthConfiguration.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/HttpBasicAuthConfiguration.mustache
index 189613b4f7..6431c2846d 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/HttpBasicAuthConfiguration.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/HttpBasicAuthConfiguration.mustache
@@ -1,4 +1,4 @@
-{{>licenseInfo}}
+{{>common/licenseInfo}}
package {{invokerPackage}}.auth.configuration;
import io.micronaut.context.annotation.ConfigurationInject;
@@ -9,7 +9,7 @@ import io.micronaut.http.MutableHttpRequest;
import javax.annotation.Generated;
-{{>generatedAnnotation}}
+{{>common/generatedAnnotation}}
@EachProperty("security.basic-auth")
public class HttpBasicAuthConfiguration implements ConfigurableAuthorization {
private final String name;
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/README.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/doc/README.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/README.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/doc/README.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/api_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/doc/api_doc.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/api_doc.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/doc/api_doc.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/auth.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/doc/auth.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/auth.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/doc/auth.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/bodyParams.mustache
new file mode 100644
index 0000000000..fd6862369f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/bodyParams.mustache
@@ -0,0 +1 @@
+{{#isBodyParam}}@Body {{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isBodyParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/cookieParams.mustache
new file mode 100644
index 0000000000..60c2c377ec
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/cookieParams.mustache
@@ -0,0 +1 @@
+{{#isCookieParam}}@CookieValue(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{defaultValue}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isCookieParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/formParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/formParams.mustache
new file mode 100644
index 0000000000..cfbd00f342
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/formParams.mustache
@@ -0,0 +1 @@
+{{#isFormParam}}{{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isFormParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/headerParams.mustache
new file mode 100644
index 0000000000..f8a5a79ab6
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/headerParams.mustache
@@ -0,0 +1 @@
+{{#isHeaderParam}}@Header(name="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isHeaderParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/pathParams.mustache
new file mode 100644
index 0000000000..64a0be56c6
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/pathParams.mustache
@@ -0,0 +1 @@
+{{#isPathParam}}@PathVariable(name="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isPathParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/queryParams.mustache
new file mode 100644
index 0000000000..aed538a1c3
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/queryParams.mustache
@@ -0,0 +1 @@
+{{#isQueryParam}}@QueryValue(value="{{{baseName}}}"{{!default value}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{!validation and type}}{{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isQueryParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/type.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/type.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/params/type.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/params/type.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.groovy.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.groovy.mustache
similarity index 88%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.groovy.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.groovy.mustache
index af4469421f..a660a5bb11 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.groovy.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.groovy.mustache
@@ -37,7 +37,7 @@ class {{classname}}Spec extends Specification {
{{{dataType}}} {{paramName}} = null
{{/allParams}}
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).block()
- // {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} asyncResponse = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}})
+ // {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} asyncResponse = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}})
expect:
true
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.mustache
similarity index 88%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.mustache
index a3c3e48e44..fc737b4269 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.mustache
@@ -39,7 +39,7 @@ public class {{classname}}Test {
{{{dataType}}} {{paramName}} = null;
{{/allParams}}
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).block();
- // {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} asyncResponse = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
+ // {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} asyncResponse = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
// TODO: test validations
}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model_test.groovy.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/model_test.groovy.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model_test.groovy.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/test/model_test.groovy.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model_test.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/model_test.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model_test.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/client/test/model_test.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/Application.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/Application.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/Application.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/Application.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/application.yml.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache
similarity index 87%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/application.yml.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache
index 4b0dd5f1c2..4e7d6e8449 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/application.yml.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache
@@ -1,5 +1,7 @@
-base-path: "{{{basePath}}}"
-context-path: "{{{contextPath}}}"
+{{!CLIENT CONFIGURATION}}
+{{#client}}
+base-path: "{{{basePath}}}/"
+context-path: "{{{contextPath}}}/"
micronaut:
application:
@@ -51,6 +53,19 @@ micronaut:
username:
password:
{{/isBasic}}{{/authMethods}}{{/configureAuth}}
+{{/client}}
+{{!SERVER CONFIGURATION}}
+{{#server}}
+context-path: "{{{contextPath}}}/"
+
+micronaut:
+ application:
+ name: {{artifactId}}
+ server:
+ port: 8080
+ security:
+ # authentication: bearer | cookie | session | idtoken
+{{/server}}
jackson:
serialization:
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/git/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/git/git_push.sh.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/git/git_push.sh.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/git/git_push.sh.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/git/gitignore.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/git/gitignore.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/git/gitignore.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/git/gitignore.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/build.gradle.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/build.gradle.mustache
similarity index 85%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/build.gradle.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/build.gradle.mustache
index a654fe3713..11ae611708 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/build.gradle.mustache
@@ -2,8 +2,8 @@ plugins {
{{#isTestSpock}}
id("groovy")
{{/isTestSpock}}
- id("com.github.johnrengelman.shadow") version "7.0.0"
- id("io.micronaut.application") version "2.0.3"
+ id("com.github.johnrengelman.shadow") version "7.1.1"
+ id("io.micronaut.application") version "3.1.1"
}
version = "{{artifactVersion}}"
@@ -30,12 +30,16 @@ micronaut {
dependencies {
annotationProcessor("io.micronaut:micronaut-http-validation")
+ {{#useAuth}}
annotationProcessor("io.micronaut.security:micronaut-security-annotations")
+ {{/useAuth}}
implementation("io.micronaut:micronaut-http-client")
implementation("io.micronaut:micronaut-runtime")
implementation("io.micronaut:micronaut-validation")
+ {{#useAuth}}
implementation("io.micronaut.security:micronaut-security")
implementation("io.micronaut.security:micronaut-security-oauth2")
+ {{/useAuth}}
implementation("io.micronaut.reactor:micronaut-reactor")
implementation("io.swagger:swagger-annotations:1.5.9")
runtimeOnly("ch.qos.logback:logback-classic")
@@ -49,3 +53,5 @@ java {
sourceCompatibility = JavaVersion.toVersion("1.8")
targetCompatibility = JavaVersion.toVersion("1.8")
}
+
+graalvmNative.toolchainDetection = false
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/gradle.properties.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/gradle.properties.mustache
new file mode 100644
index 0000000000..b95f66a253
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/gradle.properties.mustache
@@ -0,0 +1 @@
+micronautVersion={{{micronautVersion}}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/settings.gradle.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/settings.gradle.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/settings.gradle.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/settings.gradle.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradle-wrapper.jar b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradle-wrapper.jar
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradle-wrapper.jar
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradle-wrapper.jar
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradle-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradle-wrapper.properties.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradle-wrapper.properties.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradle-wrapper.properties.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradlew.bat.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradlew.bat.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradlew.bat.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradlew.bat.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradlew.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradlew.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradlew.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradlew.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/logback.xml.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/logback.xml.mustache
new file mode 100644
index 0000000000..8221870826
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/logback.xml.mustache
@@ -0,0 +1,15 @@
+
+
+
+ false
+
+
+ %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n
+
+
+
+
+
+
+
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/MavenWrapperDownloader.java.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/MavenWrapperDownloader.java.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/MavenWrapperDownloader.java.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/MavenWrapperDownloader.java.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/maven-wrapper.jar.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/maven-wrapper.jar.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/maven-wrapper.jar.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/maven-wrapper.jar.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/maven-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/maven-wrapper.properties.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/maven-wrapper.properties.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/maven-wrapper.properties.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/mvnw.bat.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/mvnw.bat.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/mvnw.bat.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/mvnw.bat.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/mvnw.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/mvnw.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/mvnw.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/mvnw.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/pom.xml.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/pom.xml.mustache
similarity index 97%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/pom.xml.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/pom.xml.mustache
index 3ef1c44ab3..bf1768a17c 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/pom.xml.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/pom.xml.mustache
@@ -10,7 +10,7 @@
io.micronaut
micronaut-parent
- 3.0.0-M5
+ {{{micronautVersion}}}
@@ -18,7 +18,7 @@
1.8
- 3.0.0-M5
+ {{{micronautVersion}}}
{{groupId}}.Application
netty
1.5.21
@@ -102,6 +102,7 @@
micronaut-reactor
compile
+ {{#useAuth}}
io.micronaut.security
micronaut-security
@@ -112,6 +113,7 @@
micronaut-security-oauth2
compile
+ {{/useAuth}}
ch.qos.logback
logback-classic
@@ -144,11 +146,13 @@
micronaut-http-validation
${micronaut.version}
+ {{#useAuth}}
io.micronaut.security
micronaut-security-annotations
${micronaut.security.version}
+ {{/useAuth}}
-Amicronaut.processing.group={{groupId}}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/enum_outer_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/enum_outer_doc.mustache
similarity index 58%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/enum_outer_doc.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/doc/enum_outer_doc.mustache
index 20c512aaea..3851c2f305 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/enum_outer_doc.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/enum_outer_doc.mustache
@@ -2,6 +2,8 @@
## Enum
+The class is defined in **[{{classname}}.java](../../{{{modelFolder}}}/{{classname}}.java)**
+
{{#allowableValues}}{{#enumVars}}
* `{{name}}` (value: `{{{value}}}`)
{{/enumVars}}{{/allowableValues}}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/model_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/model_doc.mustache
new file mode 100644
index 0000000000..8e6c8dde1c
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/model_doc.mustache
@@ -0,0 +1,4 @@
+{{#models}}{{#model}}
+
+{{#isEnum}}{{>common/doc/enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>common/doc/pojo_doc}}{{/isEnum}}
+{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/pojo_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/pojo_doc.mustache
similarity index 76%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/pojo_doc.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/doc/pojo_doc.mustache
index 0a79703d7a..05d13ee4b5 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/pojo_doc.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/pojo_doc.mustache
@@ -1,7 +1,10 @@
# {{#vendorExtensions.x-is-one-of-interface}}Interface {{/vendorExtensions.x-is-one-of-interface}}{{classname}}
+{{#description}}
-{{#description}}{{&description}}
+{{{description}}}
{{/description}}
+
+The class is defined in **[{{classname}}.java](../../{{{modelFolder}}}/{{classname}}.java)**
{{^vendorExtensions.x-is-one-of-interface}}
## Properties
@@ -10,30 +13,34 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
{{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}`{{baseType}}{{#items}}<{{dataType}}>`{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}`Map<String, {{dataType}}>`{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}`{{dataType}}`{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional property]{{/required}}{{#isReadOnly}} [readonly property]{{/isReadOnly}}
{{/vars}}
+{{#vars}}
-{{#vars}}{{#isEnum}}
-
-## Enum: {{datatypeWithEnum}}
+ {{#isEnum}}
+## {{datatypeWithEnum}}
Name | Value
----- | -----{{#allowableValues}}{{#enumVars}}
-{{name}} | `{{value}}`{{/enumVars}}{{/allowableValues}}
-{{/isEnum}}{{/vars}}
-
+---- | -----
+ {{#allowableValues}}
+ {{#enumVars}}
+{{name}} | `{{{value}}}`
+ {{/enumVars}}
+ {{/allowableValues}}
+ {{/isEnum}}
+{{/vars}}
{{#vendorExtensions.x-implements.0}}
+
## Implemented Interfaces
-{{#vendorExtensions.x-implements}}
+ {{#vendorExtensions.x-implements}}
* `{{{.}}}`
-{{/vendorExtensions.x-implements}}
+ {{/vendorExtensions.x-implements}}
{{/vendorExtensions.x-implements.0}}
{{/vendorExtensions.x-is-one-of-interface}}
-
{{#vendorExtensions.x-is-one-of-interface}}
## Implementing Classes
-{{#oneOf}}
+ {{#oneOf}}
* `{{{.}}}`
-{{/oneOf}}
+ {{/oneOf}}
{{/vendorExtensions.x-is-one-of-interface}}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/generatedAnnotation.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/generatedAnnotation.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/generatedAnnotation.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/licenseInfo.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/licenseInfo.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/licenseInfo.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/beanValidation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/beanValidation.mustache
new file mode 100644
index 0000000000..ecf4809f9e
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/beanValidation.mustache
@@ -0,0 +1,52 @@
+{{#useBeanValidation}}{{!
+validate all pojos and enums
+}}{{^isContainer}}{{#isModel}} @Valid
+{{/isModel}}{{/isContainer}}{{!
+nullable & nonnull
+}}{{#required}}{{#isNullable}} @Nullable
+{{/isNullable}}{{^isNullable}} @NotNull
+{{/isNullable}}{{/required}}{{^required}} @Nullable
+{{/required}}{{!
+pattern
+}}{{#pattern}}{{^isByteArray}} @Pattern(regexp="{{{pattern}}}")
+{{/isByteArray}}{{/pattern}}{{!
+both minLength && maxLength
+}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}}, max={{maxLength}})
+{{/maxLength}}{{/minLength}}{{!
+just minLength
+}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}})
+{{/maxLength}}{{/minLength}}{{!
+just maxLength
+}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}})
+{{/maxLength}}{{/minLength}}{{!
+@Size: both minItems && maxItems
+}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}}, max={{maxItems}})
+{{/maxItems}}{{/minItems}}{{!
+@Size: just minItems
+}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}})
+{{/maxItems}}{{/minItems}}{{!
+@Size: just maxItems
+}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}})
+{{/maxItems}}{{/minItems}}{{!
+@Email
+}}{{#isEmail}} @Email
+{{/isEmail}}{{!
+check for integer or long / all others=decimal type with @Decimal*
+isInteger set
+}}{{#isInteger}}{{#minimum}} @Min({{minimum}})
+{{/minimum}}{{#maximum}} @Max({{maximum}})
+{{/maximum}}{{/isInteger}}{{!
+isLong set
+}}{{#isLong}}{{#minimum}} @Min({{minimum}}L)
+{{/minimum}}{{#maximum}} @Max({{maximum}}L)
+{{/maximum}}{{/isLong}}{{!
+Not Integer, not Long => we have a decimal value!
+}}{{^isInteger}}{{^isLong}}{{!
+minimum for decimal value
+}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}}, inclusive=false{{/exclusiveMinimum}})
+{{/minimum}}{{!
+maximal for decimal value
+}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}}, inclusive=false{{/exclusiveMaximum}})
+{{/maximum}}{{!
+close decimal values
+}}{{/isLong}}{{/isInteger}}{{/useBeanValidation}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache
new file mode 100644
index 0000000000..6421884f47
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache
@@ -0,0 +1,26 @@
+{{!
+ If this is map and items are nullable, make sure that nulls are included.
+ To determine what JsonInclude.Include method to use, consider the following:
+ * If the field is required, always include it, even if it is null.
+ * Else use custom behaviour, IOW use whatever is defined on the object mapper
+ }}
+ @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
+ @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
+ {{#withXml}}
+ {{^isContainer}}
+ @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
+ @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
+ {{/isContainer}}
+ {{#isContainer}}
+ {{#isXmlWrapped}}
+ // items.xmlName={{items.xmlName}}
+ @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}")
+ {{/isXmlWrapped}}
+ {{/isContainer}}
+ {{/withXml}}
+ {{#isDateTime}}
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX")
+ {{/isDateTime}}
+ {{#isDate}}
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
+ {{/isDate}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/model.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/model.mustache
similarity index 91%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/model.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/model.mustache
index d9bf057298..f3119818d3 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/model.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/model.mustache
@@ -1,4 +1,4 @@
-{{>licenseInfo}}
+{{>common/licenseInfo}}
package {{package}};
{{#useReflectionEqualsHashCode}}
@@ -34,14 +34,14 @@ import javax.annotation.Generated;
{{#models}}
{{#model}}
{{#isEnum}}
-{{>model/modelEnum}}
+{{>common/model/modelEnum}}
{{/isEnum}}
{{^isEnum}}
{{#vendorExtensions.x-is-one-of-interface}}
-{{>model/oneof_interface}}
+{{>common/model/oneof_interface}}
{{/vendorExtensions.x-is-one-of-interface}}
{{^vendorExtensions.x-is-one-of-interface}}
-{{>model/pojo}}
+{{>common/model/pojo}}
{{/vendorExtensions.x-is-one-of-interface}}
{{/isEnum}}
{{/model}}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelEnum.mustache
similarity index 52%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelInnerEnum.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelEnum.mustache
index cd49673d01..a2e0f03ade 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelInnerEnum.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelEnum.mustache
@@ -1,14 +1,15 @@
- /**
- * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
- */
-{{#withXml}}
- @XmlType(name="{{datatypeWithEnum}}")
- @XmlEnum({{dataType}}.class)
-{{/withXml}}
+{{#jackson}}
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+{{/jackson}}
+
+/**
+ * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
+ */
{{#additionalEnumTypeAnnotations}}
- {{{.}}}
-{{/additionalEnumTypeAnnotations}}
- public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {
+{{{.}}}
+{{/additionalEnumTypeAnnotations}}{{#useBeanValidation}}@Introspected
+{{/useBeanValidation}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
{{#allowableValues}}
{{#enumVars}}
{{#enumDescription}}
@@ -25,36 +26,36 @@
private {{{dataType}}} value;
- {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) {
- this.value = value;
+ {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) {
+ this.value = value;
}
{{#jackson}}
@JsonValue
{{/jackson}}
public {{{dataType}}} getValue() {
- return value;
+ return value;
}
@Override
public String toString() {
- return String.valueOf(value);
+ return String.valueOf(value);
}
{{#jackson}}
@JsonCreator
{{/jackson}}
public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) {
- for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
- if (b.value.equals(value)) {
- return b;
+ for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
}
- }
{{#isNullable}}
- return null;
+ return null;
{{/isNullable}}
{{^isNullable}}
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
{{/isNullable}}
}
- }
\ No newline at end of file
+}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelInnerEnum.mustache
new file mode 100644
index 0000000000..9a1567a0ca
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelInnerEnum.mustache
@@ -0,0 +1,60 @@
+ /**
+ * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
+ */
+{{#withXml}}
+ @XmlType(name="{{datatypeWithEnum}}")
+ @XmlEnum({{dataType}}.class)
+{{/withXml}}
+{{#additionalEnumTypeAnnotations}}
+ {{{.}}}
+{{/additionalEnumTypeAnnotations}}
+ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {
+ {{#allowableValues}}
+ {{#enumVars}}
+ {{#enumDescription}}
+ /**
+ * {{enumDescription}}
+ */
+ {{/enumDescription}}
+ {{#withXml}}
+ @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}})
+ {{/withXml}}
+ {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
+ {{/enumVars}}
+ {{/allowableValues}}
+
+ private {{{dataType}}} value;
+
+ {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) {
+ this.value = value;
+ }
+
+ {{#jackson}}
+ @JsonValue
+ {{/jackson}}
+ public {{{dataType}}} getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ {{#jackson}}
+ @JsonCreator
+ {{/jackson}}
+ public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) {
+ for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ {{#isNullable}}
+ return null;
+ {{/isNullable}}
+ {{^isNullable}}
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ {{/isNullable}}
+ }
+ }
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/oneof_interface.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/oneof_interface.mustache
similarity index 77%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/oneof_interface.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/oneof_interface.mustache
index ca0a063d6d..33c3d6530f 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/oneof_interface.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/oneof_interface.mustache
@@ -1,7 +1,7 @@
{{#additionalModelTypeAnnotations}}
{{{.}}}
{{/additionalModelTypeAnnotations}}
-{{>generatedAnnotation}}{{>model/typeInfoAnnotation}}{{>model/xmlAnnotation}}
+{{>common/generatedAnnotation}}{{>common/model/typeInfoAnnotation}}{{>common/model/xmlAnnotation}}
public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} {
{{#discriminator}}
public {{propertyType}} {{propertyGetter}}();
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache
new file mode 100644
index 0000000000..8711f3f6dc
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache
@@ -0,0 +1,342 @@
+/**
+ * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
+ */
+{{#description}}
+@ApiModel(description = "{{{description}}}")
+{{/description}}
+{{#jackson}}
+@JsonPropertyOrder({
+ {{#vars}}
+ {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}}
+ {{/vars}}
+})
+@JsonTypeName("{{name}}")
+{{/jackson}}
+{{#additionalModelTypeAnnotations}}
+{{{.}}}
+{{/additionalModelTypeAnnotations}}
+{{>common/generatedAnnotation}}{{#discriminator}}{{>common/model/typeInfoAnnotation}}{{/discriminator}}{{>common/model/xmlAnnotation}}{{#useBeanValidation}}
+@Introspected
+{{/useBeanValidation}}{{!
+Declare the class with extends and implements
+}}public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{
+ {{#serializableModel}}
+ private static final long serialVersionUID = 1L;
+
+ {{/serializableModel}}
+ {{#vars}}
+ {{#isEnum}}
+ {{^isContainer}}
+{{>common/model/modelInnerEnum}}
+ {{/isContainer}}
+ {{#isContainer}}
+ {{#mostInnerItems}}
+{{>common/model/modelInnerEnum}}
+ {{/mostInnerItems}}
+ {{/isContainer}}
+ {{/isEnum}}
+ public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
+ {{#withXml}}
+ {{#isXmlAttribute}}
+ @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"
+ {{/isXmlAttribute}}
+ {{^isXmlAttribute}}
+ {{^isContainer}}
+ @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
+ {{/isContainer}}
+ {{#isContainer}}
+ // Is a container wrapped={{isXmlWrapped}}
+ {{#items}}
+ // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
+ // items.example={{example}} items.type={{dataType}}
+ @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
+ {{/items}}
+ {{#isXmlWrapped}}
+ @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
+ {{/isXmlWrapped}}
+ {{/isContainer}}
+ {{/isXmlAttribute}}
+ {{/withXml}}
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ {{#isContainer}}
+ private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined();
+ {{/isContainer}}
+ {{^isContainer}}
+ private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
+ {{/isContainer}}
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ {{#isContainer}}
+ private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}};
+ {{/isContainer}}
+ {{^isContainer}}
+ {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
+ {{/isContainer}}
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+
+ {{/vars}}
+ {{#requiredPropertiesInConstructor}}
+ public {{classname}}({{#requiredVars}}{{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/requiredVars}}) {
+ {{#parent}}
+ super({{#vendorExtensions.requiredParentVars}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.requiredParentVars}});
+ {{/parent}}
+ {{#vendorExtensions.requiredVars}}
+ this.{{name}} = {{name}};
+ {{/vendorExtensions.requiredVars}}
+ }
+
+ {{/requiredPropertiesInConstructor}}
+ {{^requiredPropertiesInConstructor}}
+ public {{classname}}() {
+ {{#parent}}
+ super();
+ {{/parent}}
+ }
+ {{/requiredPropertiesInConstructor}}
+ {{#vars}}
+ {{^isReadOnly}}
+ public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ this.{{name}} = {{name}};
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ return this;
+ }
+
+ {{#isArray}}
+ public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ if (this.{{name}} == null || !this.{{name}}.isPresent()) {
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}});
+ }
+ try {
+ this.{{name}}.get().add({{name}}Item);
+ } catch (java.util.NoSuchElementException e) {
+ // this can never happen, as we make sure above that the value is present
+ }
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^required}}
+ if (this.{{name}} == null) {
+ this.{{name}} = {{{defaultValue}}};
+ }
+ {{/required}}
+ this.{{name}}.add({{name}}Item);
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ }
+
+ {{/isArray}}
+ {{#isMap}}
+ public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ if (this.{{name}} == null || !this.{{name}}.isPresent()) {
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}});
+ }
+ try {
+ this.{{name}}.get().put(key, {{name}}Item);
+ } catch (java.util.NoSuchElementException e) {
+ // this can never happen, as we make sure above that the value is present
+ }
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^required}}
+ if (this.{{name}} == null) {
+ this.{{name}} = {{{defaultValue}}};
+ }
+ {{/required}}
+ this.{{name}}.put(key, {{name}}Item);
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ }
+
+ {{/isMap}}
+ {{/isReadOnly}}
+ /**
+ {{#description}}
+ * {{description}}
+ {{/description}}
+ {{^description}}
+ * Get {{name}}
+ {{/description}}
+ {{#minimum}}
+ * minimum: {{minimum}}
+ {{/minimum}}
+ {{#maximum}}
+ * maximum: {{maximum}}
+ {{/maximum}}
+ * @return {{name}}
+ **/
+{{>common/model/beanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
+ {{#vendorExtensions.x-extra-annotation}}
+ {{{vendorExtensions.x-extra-annotation}}}
+ {{/vendorExtensions.x-extra-annotation}}
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+{{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} @JsonIgnore
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ {{#jackson}}
+{{>common/model/jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ {{#isReadOnly}}
+{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} if ({{name}} == null) {
+ {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
+ }
+ {{/isReadOnly}}
+ return {{name}}.orElse(null);
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ return {{name}};
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ }
+
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+{{>common/model/jackson_annotations}}
+ public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() {
+ return {{name}};
+ }
+
+ @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
+ {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
+ {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} this.{{name}} = {{name}};
+ }
+
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^isReadOnly}}
+ {{#jackson}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+{{>common/model/jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}}{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}}
+{{/vendorExtensions.x-setter-extra-annotation}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ this.{{name}} = {{name}};
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ }
+
+ {{/isReadOnly}}
+ {{/vars}}
+ @Override
+ public boolean equals(Object o) {
+ {{#useReflectionEqualsHashCode}}
+ return EqualsBuilder.reflectionEquals(this, o, false, null, true);
+ {{/useReflectionEqualsHashCode}}
+ {{^useReflectionEqualsHashCode}}
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ {{#hasVars}}
+ {{classname}} {{classVarName}} = ({{classname}}) o;
+ return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} &&
+ {{/-last}}{{/vars}}{{#parent}} &&
+ super.equals(o){{/parent}};
+ {{/hasVars}}
+ {{^hasVars}}
+ return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};
+ {{/hasVars}}
+ {{/useReflectionEqualsHashCode}}
+ }
+
+ @Override
+ public int hashCode() {
+ {{#useReflectionEqualsHashCode}}
+ return HashCodeBuilder.reflectionHashCode(this);
+ {{/useReflectionEqualsHashCode}}
+ {{^useReflectionEqualsHashCode}}
+ return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}});
+ {{/useReflectionEqualsHashCode}}
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class {{classname}} {\n");
+ {{#parent}}
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ {{/parent}}
+ {{#vars}}
+ sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n");
+ {{/vars}}
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ {{#parcelableModel}}
+ public void writeToParcel(Parcel out, int flags) {
+ {{#model}}
+ {{#isArray}}
+ out.writeList(this);
+ {{/isArray}}
+ {{^isArray}}
+ {{#parent}}
+ super.writeToParcel(out, flags);
+ {{/parent}}
+ {{#vars}}
+ out.writeValue({{name}});
+ {{/vars}}
+ {{/isArray}}
+ {{/model}}
+ }
+
+ {{classname}}(Parcel in) {
+ {{#isArray}}
+ in.readTypedList(this, {{arrayModelType}}.CREATOR);
+ {{/isArray}}
+ {{^isArray}}
+ {{#parent}}
+ super(in);
+ {{/parent}}
+ {{#vars}}
+ {{#isPrimitiveType}}
+ {{name}} = ({{{datatypeWithEnum}}})in.readValue(null);
+ {{/isPrimitiveType}}
+ {{^isPrimitiveType}}
+ {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader());
+ {{/isPrimitiveType}}
+ {{/vars}}
+ {{/isArray}}
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() {
+ public {{classname}} createFromParcel(Parcel in) {
+ {{#model}}
+ {{#isArray}}
+ {{classname}} result = new {{classname}}();
+ result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader()));
+ return result;
+ {{/isArray}}
+ {{^isArray}}
+ return new {{classname}}(in);
+ {{/isArray}}
+ {{/model}}
+ }
+
+ public {{classname}}[] newArray(int size) {
+ return new {{classname}}[size];
+ }
+ };
+ {{/parcelableModel}}
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/typeInfoAnnotation.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/typeInfoAnnotation.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/typeInfoAnnotation.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/xmlAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/xmlAnnotation.mustache
similarity index 100%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/xmlAnnotation.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/xmlAnnotation.mustache
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/beanValidation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/params/beanValidation.mustache
similarity index 82%
rename from modules/openapi-generator/src/main/resources/java-micronaut-client/params/beanValidation.mustache
rename to modules/openapi-generator/src/main/resources/java-micronaut/common/params/beanValidation.mustache
index 6fd7a75b06..8b625ef1b9 100644
--- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/beanValidation.mustache
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/params/beanValidation.mustache
@@ -1,8 +1,11 @@
-{{#useBeanValidation}}{{!
+{{!First handle the nullable - it should be present unless otherwise specified}}
+{{#isNullable}}@Nullable {{/isNullable}}{{^isNullable}}{{^required}}@Nullable {{/required}}{{/isNullable}}{{!
+All the validation
+}}{{#useBeanValidation}}{{!
+nullable overrides required
+}}{{^isNullable}}{{#required}}@NotNull {{/required}}{{/isNullable}}{{!
validate all pojos and enums
}}{{^isContainer}}{{#isModel}}@Valid {{/isModel}}{{/isContainer}}{{!
-nullable & nonnull
-}}{{#required}}@NotNull {{/required}}{{#isNullable}}@Nullable {{/isNullable}}{{!
pattern
}}{{#pattern}}{{^isByteArray}}@Pattern(regexp="{{{pattern}}}") {{/isByteArray}}{{/pattern}}{{!
both minLength && maxLength
@@ -18,7 +21,7 @@ just maxLength
@Size: just maxItems
}}{{^minItems}}{{#maxItems}}@Size(max={{maxItems}}) {{/maxItems}}{{/minItems}}{{!
@Email
-}}{{#isEmail}}@Email{{/isEmail}}{{!
+}}{{#isEmail}}@Email {{/isEmail}}{{!
check for integer or long / all others=decimal type with @Decimal*
isInteger set
}}{{#isInteger}}{{#minimum}}@Min({{minimum}}) {{/minimum}}{{#maximum}}@Max({{maximum}}) {{/maximum}}{{/isInteger}}{{!
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.groovy.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.groovy.mustache
new file mode 100644
index 0000000000..fb94253573
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.groovy.mustache
@@ -0,0 +1,46 @@
+package {{package}}
+
+{{#imports}}import {{import}}
+{{/imports}}
+import io.micronaut.test.extensions.spock.annotation.MicronautTest
+import spock.lang.Specification
+import jakarta.inject.Inject
+{{#fullJavaUtil}}
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+{{/fullJavaUtil}}
+
+/**
+ * Model tests for {{classname}}
+ */
+@MicronautTest
+public class {{classname}}Spec extends Specification {
+ {{#models}}
+ {{#model}}
+ {{^vendorExtensions.x-is-one-of-interface}}
+ {{^isEnum}}
+ private final {{classname}} model = null
+
+ {{/isEnum}}
+ /**
+ * Model tests for {{classname}}
+ */
+ void '{{classname}} test'() {
+ // TODO: test {{classname}}
+ }
+
+ {{#allVars}}
+ /**
+ * Test the property '{{name}}'
+ */
+ void '{{classname}} property {{name}} test'() {
+ // TODO: test {{name}} property of {{classname}}
+ }
+
+ {{/allVars}}
+ {{/vendorExtensions.x-is-one-of-interface}}
+ {{/model}}
+ {{/models}}
+}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.mustache
new file mode 100644
index 0000000000..2a49ac9467
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.mustache
@@ -0,0 +1,49 @@
+package {{package}};
+
+{{#imports}}import {{import}};
+{{/imports}}
+import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Assertions;
+
+{{#fullJavaUtil}}
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+{{/fullJavaUtil}}
+
+/**
+ * Model tests for {{classname}}
+ */
+@MicronautTest
+public class {{classname}}Test {
+ {{#models}}
+ {{#model}}
+ {{^vendorExtensions.x-is-one-of-interface}}
+ {{^isEnum}}
+ private final {{classname}} model = null;
+
+ {{/isEnum}}
+ /**
+ * Model tests for {{classname}}
+ */
+ @Test
+ public void test{{classname}}() {
+ // TODO: test {{classname}}
+ }
+
+ {{#allVars}}
+ /**
+ * Test the property '{{name}}'
+ */
+ @Test
+ public void {{name}}Test() {
+ // TODO: test {{name}}
+ }
+
+ {{/allVars}}
+ {{/vendorExtensions.x-is-one-of-interface}}
+ {{/model}}
+ {{/models}}
+}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/controller.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/controller.mustache
new file mode 100644
index 0000000000..f1affde0c2
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/controller.mustache
@@ -0,0 +1,129 @@
+{{>common/licenseInfo}}
+package {{apiPackage}};
+
+import io.micronaut.http.annotation.*;
+import io.micronaut.core.annotation.Nullable;
+import io.micronaut.core.convert.format.Format;
+{{#useAuth}}
+import io.micronaut.security.annotation.Secured;
+import io.micronaut.security.rules.SecurityRule;
+{{/useAuth}}
+import reactor.core.publisher.Mono;
+{{#imports}}
+import {{import}};
+{{/imports}}
+import javax.annotation.Generated;
+{{^fullJavaUtil}}
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+{{#generateControllerFromExamples}}
+import java.util.Arrays;
+{{/generateControllerFromExamples}}
+{{/fullJavaUtil}}
+{{#useBeanValidation}}
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+{{/useBeanValidation}}
+import io.swagger.annotations.*;
+
+{{>common/generatedAnnotation}}
+{{^generateControllerAsAbstract}}
+@Controller("${context-path}")
+{{/generateControllerAsAbstract}}
+public {{#generateControllerAsAbstract}}abstract {{/generateControllerAsAbstract}}class {{classname}} {
+{{#operations}}
+ {{#operation}}
+ /**
+ {{#summary}}
+ * {{summary}}
+ {{/summary}}
+ {{#notes}}
+ * {{notes}}
+ {{/notes}}
+ {{^summary}}
+ {{^notes}}
+ * {{nickname}}
+ {{/notes}}
+ {{/summary}}
+ *
+ {{#allParams}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
+ {{/allParams}}
+ {{#returnType}}
+ * @return {{returnType}}
+ {{/returnType}}
+ {{#externalDocs}}
+ * {{description}}
+ * @see {{summary}} Documentation
+ {{/externalDocs}}
+ */
+ {{!openapi annotations for info}}
+ @ApiOperation(
+ value = "{{{summary}}}",
+ nickname = "{{{operationId}}}"{{#notes}},
+ notes = "{{{notes}}}"{{/notes}}{{#returnBaseType}},
+ response = {{{returnBaseType}}}.class{{/returnBaseType}}{{#returnContainer}},
+ responseContainer = "{{{returnContainer}}}"{{/returnContainer}},
+ authorizations = {{openbrace}}{{#hasAuthMethods}}
+ {{#authMethods}}
+ {{#isOAuth}}
+ @Authorization(value = "{{name}}"{{#scopes}}{{#-first}}, scopes = {
+ {{#scopes}}
+ @AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}},{{/-last}}
+ {{/scopes}}
+ }{{/-first}}{{/scopes}}){{^-last}},{{/-last}}
+ {{/isOAuth}}
+ {{^isOAuth}}
+ @Authorization(value = "{{name}}"){{^-last}},{{/-last}}
+ {{/isOAuth}}
+ {{/authMethods}}
+ {{/hasAuthMethods}}{{closebrace}},
+ tags={{openbrace}}{{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}}{{closebrace}})
+ {{!openapi annotations for info about responses}}
+ @ApiResponses(value = {{openbrace}}{{#responses}}
+ @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}{{closebrace}})
+ {{!micronaut annotations}}
+ @{{#lambda.pascalcase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.pascalcase}}(uri="{{{path}}}")
+ @Produces(value = {{openbrace}}{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}{{closebrace}})
+ {{#consumes.0}}
+ @Consumes(value = {{openbrace}}{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}{{closebrace}})
+ {{/consumes.0}}
+ {{!security annotations}}
+ {{#useAuth}}
+ {{#hasAuthMethods}}
+ @Secured(SecurityRule.IS_AUTHENTICATED)
+ {{/hasAuthMethods}}
+ {{^hasAuthMethods}}
+ @Secured(SecurityRule.IS_ANONYMOUS)
+ {{/hasAuthMethods}}
+ {{/useAuth}}
+ {{!the method definition}}
+ public {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}{{#generateControllerAsAbstract}}Api{{/generateControllerAsAbstract}}({{#allParams}}
+ {{>server/params/queryParams}}{{>server/params/pathParams}}{{>server/params/headerParams}}{{>server/params/bodyParams}}{{>server/params/formParams}}{{>server/params/cookieParams}}{{^-last}}, {{/-last}}{{#-last}}
+ {{/-last}}{{/allParams}}) {
+ {{^generateControllerAsAbstract}}
+{{>server/controllerOperationBody}} }
+ {{/generateControllerAsAbstract}}
+ {{#generateControllerAsAbstract}}
+ return {{nickname}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
+ }
+ {{/generateControllerAsAbstract}}
+ {{#generateControllerAsAbstract}}
+
+ /**
+ {{#summary}}
+ * {{summary}}
+ {{/summary}}
+ *
+ * This method will be delegated to when the controller gets a request
+ */
+ public abstract {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
+ {{/generateControllerAsAbstract}}
+ {{^-last}}
+
+ {{/-last}}
+ {{/operation}}
+{{/operations}}
+}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerImplementation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerImplementation.mustache
new file mode 100644
index 0000000000..91e582a17b
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerImplementation.mustache
@@ -0,0 +1,34 @@
+{{>common/licenseInfo}}
+package {{controllerPackage}};
+
+import io.micronaut.http.annotation.Controller;
+import reactor.core.publisher.Mono;
+import {{package}}.{{classname}};
+{{#imports}}
+import {{import}};
+{{/imports}}
+{{^fullJavaUtil}}
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+{{#generateControllerFromExamples}}
+import java.util.Arrays;
+{{/generateControllerFromExamples}}
+{{/fullJavaUtil}}
+
+
+@Controller("${context-path}")
+public class {{controllerClassname}} extends {{classname}} {
+{{#operations}}
+ {{#operation}}
+ {{!the method definition}}
+ @Override
+ public {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {
+{{>server/controllerOperationBody}} }
+ {{^-last}}
+
+ {{/-last}}
+ {{/operation}}
+{{/operations}}
+}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerOperationBody.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerOperationBody.mustache
new file mode 100644
index 0000000000..fc374fe099
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerOperationBody.mustache
@@ -0,0 +1,17 @@
+ {{^generateControllerFromExamples}}
+ {{!The body needs to be implemented by user}}
+ // TODO implement {{nickname}}() body;
+ {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} result = Mono.empty();
+ return result;
+ {{/generateControllerFromExamples}}
+ {{#generateControllerFromExamples}}
+ {{!The body is generated to verify that example values are passed correctly}}
+ {{#allParams}}
+ {{^isFile}}
+ {{{dataType}}} {{paramName}}Expected = {{{example}}};
+ assert {{paramName}}.equals({{paramName}}Expected) : "The parameter {{paramName}} was expected to match its example value";
+ {{/isFile}}
+ {{/allParams}}
+
+ return Mono.fromCallable(() -> {{^returnType}}""{{/returnType}}{{#returnType}}{{#vendorExtensions.example}}{{{vendorExtensions.example}}}{{/vendorExtensions.example}}{{^vendorExtensions.example}}null{{/vendorExtensions.example}}{{/returnType}});
+ {{/generateControllerFromExamples}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/README.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/README.mustache
new file mode 100644
index 0000000000..6488748003
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/README.mustache
@@ -0,0 +1,27 @@
+# {{artifactId}}
+
+This is a generated server based on [Micronaut](https://micronaut.io/) framework.
+
+## Configuration
+
+To run the whole application, use [Application.java]({{{invokerFolder}}}/Application.java) as main class.
+
+Read **[Micronaut Guide](https://docs.micronaut.io/latest/guide/#ideSetup)** for detailed description on IDE setup and Micronaut Framework features.
+
+All the properties can be changed in the [application.yml]({{resourceFolder}}/application.yml) file or when creating micronaut application as described in **[Micronaut Guide - Configuration Section](https://docs.micronaut.io/latest/guide/#config)**.
+
+## Controller Guides
+
+Description on how to create Apis is given inside individual api guides:
+
+{{#apiInfo}}
+ {{#apis}}
+* [{{classFilename}}]({{apiDocPath}}/{{classFilename}}.md)
+ {{/apis}}
+{{/apiInfo}}
+
+## Author
+
+{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
+{{/hasMore}}{{/apis}}{{/apiInfo}}
+
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/controller_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/controller_doc.mustache
new file mode 100644
index 0000000000..80d49233c5
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/controller_doc.mustache
@@ -0,0 +1,63 @@
+# {{classname}}{{#description}}
+{{description}}{{/description}}
+
+All URIs are relative to `"{{contextPath}}"`
+
+The controller class is defined in **[{{classname}}.java](../../{{{apiFolder}}}/{{classname}}.java)**
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+{{#operations}}
+ {{#operation}}
+[**{{operationId}}**](#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
+ {{/operation}}
+{{/operations}}
+
+{{#operations}}
+ {{#operation}}
+
+# **{{operationId}}**
+```java
+{{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{classname}}.{{nickname}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
+```
+
+{{summary}}{{#notes}}
+
+{{notes}}{{/notes}}
+
+{{#allParams}}
+ {{#-last}}
+### Parameters
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+{{#allParams}}
+**{{paramName}}** | {{^isPrimitiveType}}[**{{dataType}}**](../../{{modelDocPath}}/{{baseType}}.md){{/isPrimitiveType}}{{#isPrimitiveType}}`{{dataType}}`{{/isPrimitiveType}} | {{description}} |{{^required}} [optional parameter]{{/required}}{{#defaultValue}} [default to `{{defaultValue}}`]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}`{{{.}}}`{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}}
+{{/allParams}}
+ {{/-last}}
+{{/allParams}}
+
+{{#returnType}}
+### Return type
+ {{#returnTypeIsPrimitive}}
+`{{returnType}}`
+ {{/returnTypeIsPrimitive}}
+ {{^returnTypeIsPrimitive}}
+[**{{returnType}}**](../../{{modelDocPath}}/{{returnBaseType}}.md)
+ {{/returnTypeIsPrimitive}}
+{{/returnType}}
+
+{{#authMethods}}
+ {{#-last}}
+### Authorization
+ {{#authMethods}}
+* **{{name}}**{{#scopes}}{{#-last}}, scopes: {{#scopes}}`{{{scope}}}`{{^-last}}, {{/-last}}{{/scopes}}{{/-last}}{{/scopes}}
+ {{/authMethods}}
+ {{/-last}}
+{{/authMethods}}
+
+### HTTP request headers
+ - **Accepts Content-Type**: {{#consumes}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Produces Content-Type**: {{#produces}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
+
+ {{/operation}}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/bodyParams.mustache
new file mode 100644
index 0000000000..80bca1989f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/bodyParams.mustache
@@ -0,0 +1,7 @@
+{{#isBodyParam}}{{!
+Multi part
+}}{{#isMultipart}}@Part("{{baseName}}"){{/isMultipart}}{{!
+Non-multipart body
+}}{{^isMultipart}}@Body{{/isMultipart}}{{!
+The type
+}} {{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isBodyParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/cookieParams.mustache
new file mode 100644
index 0000000000..be25ae2174
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/cookieParams.mustache
@@ -0,0 +1 @@
+{{#isCookieParam}}@CookieValue(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{defaultValue}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isCookieParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/formParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/formParams.mustache
new file mode 100644
index 0000000000..22c02d391b
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/formParams.mustache
@@ -0,0 +1 @@
+{{#isFormParam}}{{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isFormParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/headerParams.mustache
new file mode 100644
index 0000000000..1cb2c90a91
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/headerParams.mustache
@@ -0,0 +1 @@
+{{#isHeaderParam}}@Header(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isHeaderParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/pathParams.mustache
new file mode 100644
index 0000000000..4e2fd4c2e1
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/pathParams.mustache
@@ -0,0 +1 @@
+{{#isPathParam}}@PathVariable(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isPathParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/queryParams.mustache
new file mode 100644
index 0000000000..0ba7b46061
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/queryParams.mustache
@@ -0,0 +1 @@
+{{#isQueryParam}}@QueryValue(value="{{{baseName}}}"{{!default value}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{!validation and type}}{{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isQueryParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/type.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/type.mustache
new file mode 100644
index 0000000000..4d51aec1c9
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/type.mustache
@@ -0,0 +1,7 @@
+{{!
+default type
+}}{{^isDate}}{{^isDateTime}}{{{dataType}}}{{/isDateTime}}{{/isDate}}{{!
+date-time
+}}{{#isDateTime}}@Format("yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") {{{dataType}}}{{/isDateTime}}{{!
+date
+}}{{#isDate}}@Format("yyyy-MM-dd") {{{dataType}}}{{/isDate}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.groovy.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.groovy.mustache
new file mode 100644
index 0000000000..44c0730cb9
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.groovy.mustache
@@ -0,0 +1,185 @@
+package {{package}}
+
+{{#imports}}
+import {{import}}
+{{/imports}}
+import io.micronaut.test.extensions.spock.annotation.MicronautTest
+import io.micronaut.http.client.HttpClient
+import io.micronaut.http.client.annotation.Client
+import io.micronaut.runtime.server.EmbeddedServer
+import io.micronaut.http.HttpStatus
+import io.micronaut.http.HttpRequest
+import io.micronaut.http.MutableHttpRequest;
+import io.micronaut.http.HttpResponse
+import io.micronaut.http.MediaType
+import io.micronaut.http.uri.UriTemplate
+import io.micronaut.http.cookie.Cookie
+import io.micronaut.http.client.multipart.MultipartBody
+import io.micronaut.core.type.Argument
+import jakarta.inject.Inject
+import spock.lang.Specification
+import spock.lang.Ignore
+import reactor.core.publisher.Mono
+import java.io.File
+import java.io.FileReader
+
+
+/**
+ * Controller tests for {{classname}}
+ */
+@MicronautTest
+class {{classname}}Spec extends Specification {
+
+ @Inject
+ EmbeddedServer server
+
+ @Inject
+ @Client('${context-path}')
+ HttpClient client
+
+ @Inject
+ {{classname}} controller
+
+ {{#operations}}
+ {{#operation}}
+ /**
+ * This test is used to validate the implementation of {{operationId}}() method
+ *
+ * The method should: {{summary}}
+ {{#notes}}
+ *
+ * {{notes}}
+ {{/notes}}
+ *
+ * TODO fill in the parameters and test return value.
+ */
+ {{^generateControllerFromExamples}}
+ @Ignore("Not Implemented")
+ {{/generateControllerFromExamples}}
+ def '{{operationId}}() method test'() {
+ given:
+ {{#allParams}}
+ {{{dataType}}} {{paramName}} = {{{vendorExtensions.groovyExample}}}
+ {{/allParams}}
+
+ when:
+ {{#returnType}}{{{returnType}}} result = {{/returnType}}controller.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).block()
+
+ then:
+ {{^generateControllerFromExamples}}
+ true
+ {{/generateControllerFromExamples}}
+ {{#generateControllerFromExamples}}
+ {{^returnType}}
+ true
+ {{/returnType}}
+ {{#returnType}}
+ result == {{{vendorExtensions.groovyExample}}}
+ {{/returnType}}
+ {{/generateControllerFromExamples}}
+ }
+
+ /**
+ * This test is used to check that the api available to client through
+ * '{{{path}}}' to the features of {{operationId}}() works as desired.
+ *
+ * TODO fill in the request parameters and test response.
+ */
+ {{^generateControllerFromExamples}}
+ @Ignore("Not Implemented")
+ {{/generateControllerFromExamples}}
+ def '{{operationId}}() test with client through path {{{path}}}'() {
+ given:
+ {{!Create the body}}
+ {{#bodyParam}}
+ {{{dataType}}} body = {{{vendorExtensions.groovyExample}}}
+ {{/bodyParam}}
+ {{#formParams.0}}
+ var form = [
+ // Fill in the body form parameters
+ {{#formParams}}
+ {{^isFile}}
+ '{{{baseName}}}': {{{vendorExtensions.groovyExample}}}{{^-last}},{{/-last}}
+ {{/isFile}}
+ {{#isFile}}
+ '{{{baseName}}}': new FileReader(File.createTempFile('test', '.tmp')){{^-last}},{{/-last}}
+ {{/isFile}}
+ {{/formParams}}
+ ]
+ {{/formParams.0}}
+ {{#isMultipart}}
+ {{^formParams}}
+ var body = MultipartBody.builder() // Create multipart body
+ {{#bodyParams}}
+ {{^isFile}}
+ .addPart('{{{baseName}}}', {{{vendorExtensions.groovyExample}}}{{^isString}}.toString(){{/isString}})
+ {{/isFile}}
+ {{#isFile}}
+ {{#contentType}}
+ .addPart('{{{baseName}}}', 'filename', MediaType.of('{{{contentType}}}'), File.createTempFile('test', '.tmp'))
+ {{/contentType}}
+ {{^contentType}}
+ .addPart('{{{baseName}}}', 'filename', File.createTempFile('test', '.tmp'))
+ {{/contentType}}
+ {{/isFile}}
+ {{/bodyParams}}
+ .build()
+ {{/formParams}}
+ {{/isMultipart}}
+ {{!Create the uri with path variables}}
+ var uri = UriTemplate.of('{{{path}}}').expand({{^pathParams}}[:]{{/pathParams}}{{#pathParams.0}}[
+ // Fill in the path variables
+ {{#pathParams}}
+ '{{{baseName}}}': {{{vendorExtensions.groovyExample}}}{{^-last}},{{/-last}}
+ {{/pathParams}}
+ ]{{/pathParams.0}})
+ {{!Create the request with body and uri}}
+ MutableHttpRequest request = HttpRequest.{{httpMethod}}{{#vendorExtensions.methodAllowsBody}}{{#bodyParam}}(uri, body){{/bodyParam}}{{#isMultipart}}{{^formParams}}(uri, body){{/formParams}}{{/isMultipart}}{{#formParams.0}}(uri, form){{/formParams.0}}{{^bodyParam}}{{^isMultipart}}{{^formParams}}(uri, null){{/formParams}}{{/isMultipart}}{{/bodyParam}}{{/vendorExtensions.methodAllowsBody}}{{^vendorExtensions.methodAllowsBody}}(uri){{/vendorExtensions.methodAllowsBody}}
+ {{!Fill in all the request parameters}}
+ {{#vendorExtensions.x-contentType}}
+ .contentType('{{vendorExtensions.x-contentType}}')
+ {{/vendorExtensions.x-contentType}}
+ {{#vendorExtensions.x-accepts}}
+ .accept('{{vendorExtensions.x-accepts}}')
+ {{/vendorExtensions.x-accepts}}
+ {{#headerParams}}
+ .header('{{{baseName}}}', {{{vendorExtensions.groovyExample}}}{{^isString}}.toString(){{/isString}})
+ {{/headerParams}}
+ {{#cookieParams}}
+ .cookie(Cookie.of('{{{baseName}}}', {{{vendorExtensions.groovyExample}}}))
+ {{/cookieParams}}
+ {{!Fill in the query parameters}}
+ {{#queryParams.0}}
+ request.getParameters()
+ {{#queryParams}}
+ {{#isCollectionFormatMulti}}
+ .add('{{{baseName}}}', {{{vendorExtensions.groovyExample}}}) // The query format should be multi
+ {{/isCollectionFormatMulti}}
+ {{#isDeepObject}}
+ .add('{{{baseName}}}[property]', 'value') // The query format should be deep-object
+ {{/isDeepObject}}
+ {{^isCollectionFormatMulti}}
+ {{^isDeepObject}}
+ .add('{{{baseName}}}', {{{vendorExtensions.groovyExample}}}{{^isString}}.toString(){{/isString}}){{#collectionFormat}} // The query parameter format should be {{collectionFormat}}{{/collectionFormat}}
+ {{/isDeepObject}}
+ {{/isCollectionFormatMulti}}
+ {{/queryParams}}
+ {{/queryParams.0}}
+
+ when:
+ HttpResponse response = client.toBlocking().exchange(request{{#returnType}}, {{#returnContainer}}Argument.of({{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}.class, {{#isMap}}String.class, {{/isMap}}{{{returnBaseType}}}.class){{/returnContainer}}{{^returnContainer}}{{{returnType}}}.class{{/returnContainer}}{{/returnType}});{{^returnType}} // To retrieve body you must specify required type (e.g. Map.class) as second argument {{/returnType}}
+
+ then:
+ response.status() == HttpStatus.OK
+ {{#generateControllerFromExamples}}
+ {{#returnType}}
+ {{#vendorExtensions.example}}
+ response.body() == {{{vendorExtensions.groovyExample}}}
+ {{/vendorExtensions.example}}
+ {{/returnType}}
+ {{/generateControllerFromExamples}}
+ }
+
+ {{/operation}}
+ {{/operations}}
+}
diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.mustache
new file mode 100644
index 0000000000..2e34bd7212
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.mustache
@@ -0,0 +1,185 @@
+package {{package}};
+
+{{#imports}}
+import {{import}};
+{{/imports}}
+import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
+import io.micronaut.http.client.HttpClient;
+import io.micronaut.http.client.annotation.Client;
+import io.micronaut.runtime.server.EmbeddedServer;
+import io.micronaut.http.HttpStatus;
+import io.micronaut.http.MutableHttpRequest;
+import io.micronaut.http.HttpRequest;
+import io.micronaut.http.HttpResponse;
+import io.micronaut.http.MediaType;
+import io.micronaut.http.uri.UriTemplate;
+import io.micronaut.http.cookie.Cookie;
+import io.micronaut.http.client.multipart.MultipartBody;
+import io.micronaut.core.type.Argument;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Assertions;
+import jakarta.inject.Inject;
+import reactor.core.publisher.Mono;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+{{^fullJavaUtil}}
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.HashSet;
+{{/fullJavaUtil}}
+
+
+/**
+ * API tests for {{classname}}
+ */
+@MicronautTest
+public class {{classname}}Test {
+
+ @Inject
+ EmbeddedServer server;
+
+ @Inject
+ @Client("${context-path}")
+ HttpClient client;
+
+ @Inject
+ {{classname}} controller;
+
+ {{#operations}}
+ {{#operation}}
+ /**
+ * This test is used to validate the implementation of {{operationId}}() method
+ *
+ * The method should: {{summary}}
+ {{#notes}}
+ *
+ * {{notes}}
+ {{/notes}}
+ *
+ * TODO fill in the parameters and test return value.
+ */
+ @Test
+ {{^generateControllerFromExamples}}
+ @Disabled("Not Implemented")
+ {{/generateControllerFromExamples}}
+ void {{operationId}}MethodTest() {
+ // given
+ {{#allParams}}
+ {{{dataType}}} {{paramName}} = {{{example}}};
+ {{/allParams}}
+
+ // when
+ {{#returnType}}{{{returnType}}} result = {{/returnType}}controller.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).block();
+
+ // then
+ {{^generateControllerFromExamples}}
+ Assertions.assertTrue(true);
+ {{/generateControllerFromExamples}}
+ {{#generateControllerFromExamples}}
+ {{#returnType}}
+ {{#vendorExtensions.example}}
+ Assertions.assertEquals(result, {{{vendorExtensions.example}}});
+ {{/vendorExtensions.example}}
+ {{/returnType}}
+ {{/generateControllerFromExamples}}
+ }
+
+ /**
+ * This test is used to check that the api available to client through
+ * '{{{path}}}' to the features of {{operationId}}() works as desired.
+ *
+ * TODO fill in the request parameters and test response.
+ */
+ @Test
+ {{^generateControllerFromExamples}}
+ @Disabled("Not Implemented")
+ {{/generateControllerFromExamples}}
+ void {{operationId}}ClientApiTest() throws IOException {
+ // given
+ {{!Create the body}}
+ {{#bodyParam}}
+ {{{dataType}}} body = {{{example}}};
+ {{/bodyParam}}
+ {{#formParams.0}}
+ Map form = new HashMap(){{openbrace}}{{openbrace}}
+ // Fill in the body form parameters
+ {{#formParams}}
+ {{^isFile}}
+ put("{{{baseName}}}", {{{example}}});
+ {{/isFile}}
+ {{#isFile}}
+ put("{{{baseName}}}", new FileReader(File.createTempFile("test", ".tmp")));
+ {{/isFile}}
+ {{/formParams}}
+ {{closebrace}}{{closebrace}};
+ {{/formParams.0}}
+ {{#isMultipart}}
+ {{^formParams}}
+ MultipartBody body = MultipartBody.builder() // Create multipart body
+ {{#bodyParams}}
+ {{^isFile}}
+ .addPart("{{{baseName}}}", {{^isString}}String.valueOf({{/isString}}{{{example}}}{{^isString}}){{/isString}})
+ {{/isFile}}
+ {{#isFile}}
+ {{#contentType}}
+ .addPart("{{{baseName}}}", "filename", MediaType.of("{{{contentType}}}"), File.createTempFile("test", ".tmp"))
+ {{/contentType}}
+ {{^contentType}}
+ .addPart("{{{baseName}}}", "filename", File.createTempFile("test", ".tmp"))
+ {{/contentType}}
+ {{/isFile}}
+ {{/bodyParams}}
+ .build();
+ {{/formParams}}
+ {{/isMultipart}}
+ {{!Create the uri with path variables}}
+ String uri = UriTemplate.of("{{{path}}}").expand(new HashMap{{^pathParams}}<>(){{/pathParams}}{{#pathParams.0}}(){{openbrace}}{{openbrace}}
+ // Fill in the path variables
+ {{#pathParams}}
+ put("{{{baseName}}}", {{{example}}});
+ {{/pathParams}}
+ {{closebrace}}{{closebrace}}{{/pathParams.0}});
+ {{!Create the request with body and uri}}
+ MutableHttpRequest> request = HttpRequest.{{httpMethod}}{{#vendorExtensions.methodAllowsBody}}{{#bodyParam}}(uri, body){{/bodyParam}}{{#isMultipart}}{{^formParams}}(uri, body){{/formParams}}{{/isMultipart}}{{#formParams.0}}(uri, form){{/formParams.0}}{{^bodyParam}}{{^isMultipart}}{{^formParams}}(uri, null){{/formParams}}{{/isMultipart}}{{/bodyParam}}{{/vendorExtensions.methodAllowsBody}}{{^vendorExtensions.methodAllowsBody}}(uri){{/vendorExtensions.methodAllowsBody}}{{!Fill in all the request parameters}}{{#vendorExtensions.x-contentType}}
+ .contentType("{{vendorExtensions.x-contentType}}"){{/vendorExtensions.x-contentType}}{{#vendorExtensions.x-accepts}}
+ .accept("{{vendorExtensions.x-accepts}}"){{/vendorExtensions.x-accepts}}{{#headerParams}}
+ .header("{{{baseName}}}", {{^isString}}String.valueOf({{/isString}}{{{example}}}{{^isString}}){{/isString}}){{/headerParams}}{{#cookieParams}}
+ .cookie(Cookie.of("{{{baseName}}}", {{{example}}})){{/cookieParams}};
+ {{!Fill in the query parameters}}
+ {{#queryParams.0}}
+ request.getParameters()
+ {{#queryParams}}
+ {{#isCollectionFormatMulti}}
+ .add("{{{baseName}}}", {{{example}}}){{#-last}};{{/-last}} // The query format should be multi
+ {{/isCollectionFormatMulti}}
+ {{#isDeepObject}}
+ .add("{{{baseName}}}[property]", "value"){{#-last}};{{/-last}} // The query format should be deep-object
+ {{/isDeepObject}}
+ {{^isCollectionFormatMulti}}
+ {{^isDeepObject}}
+ .add("{{{baseName}}}", {{^isString}}String.valueOf({{/isString}}{{{example}}}{{^isString}}){{/isString}}){{#-last}};{{/-last}} // The query parameter format should be {{collectionFormat}}
+ {{/isDeepObject}}
+ {{/isCollectionFormatMulti}}
+ {{/queryParams}}
+ {{/queryParams.0}}
+
+ // when
+ HttpResponse> response = client.toBlocking().exchange(request{{#returnType}}, {{#returnContainer}}Argument.of({{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}.class, {{#isMap}}String.class, {{/isMap}}{{{returnBaseType}}}.class){{/returnContainer}}{{^returnContainer}}{{{returnType}}}.class{{/returnContainer}}{{/returnType}});{{^returnType}} // To retrieve body you must specify required type (e.g. Map.class) as second argument {{/returnType}}
+
+ // then
+ Assertions.assertEquals(HttpStatus.OK, response.status());
+ {{#generateControllerFromExamples}}
+ {{#returnType}}
+ Assertions.assertEquals(response.body(), {{{vendorExtensions.example}}});
+ {{/returnType}}
+ {{/generateControllerFromExamples}}
+ }
+
+ {{/operation}}
+ {{/operations}}
+}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/AbstractMicronautCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/AbstractMicronautCodegenTest.java
new file mode 100644
index 0000000000..2241771ef6
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/AbstractMicronautCodegenTest.java
@@ -0,0 +1,125 @@
+package org.openapitools.codegen.java.micronaut;
+
+import io.swagger.parser.OpenAPIParser;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.parser.core.models.ParseOptions;
+import org.openapitools.codegen.ClientOptInput;
+import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.DefaultGenerator;
+import org.openapitools.codegen.languages.JavaMicronautAbstractCodegen;
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.regex.Pattern;
+
+import static org.testng.Assert.*;
+
+
+/**
+ * An abstract class with methods useful for testing
+ */
+public abstract class AbstractMicronautCodegenTest {
+ /**
+ * Path to a common test configuration file
+ */
+ protected final String PETSTORE_PATH = "src/test/resources/petstore.json";
+
+ /**
+ *
+ * @param codegen - the code generator
+ * @param configPath - the path to the config starting from src/test/resources
+ * @param filesToGenerate - which files to generate - can be CodegenConstants.MODELS, APIS, SUPPORTING_FILES, ...
+ * @return - the path to the generated folder
+ */
+ protected String generateFiles(JavaMicronautAbstractCodegen codegen, String configPath, String... filesToGenerate) {
+ File output = null;
+ try {
+ output = Files.createTempDirectory("test").toFile().getCanonicalFile();
+ } catch (IOException e) {
+ fail("Unable to create temporary directory for output");
+ }
+ output.deleteOnExit();
+
+ // Create parser
+ String outputPath = output.getAbsolutePath().replace('\\', '/');
+ OpenAPI openAPI = new OpenAPIParser()
+ .readLocation(configPath, null, new ParseOptions()).getOpenAPI();
+
+ // Configure codegen
+ codegen.setOutputDir(outputPath);
+
+ // Create input
+ ClientOptInput input = new ClientOptInput();
+ input.openAPI(openAPI);
+ input.config(codegen);
+
+ // Generate
+ DefaultGenerator generator = new DefaultGenerator();
+ // by default nothing is generated
+ generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false");
+ generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
+ generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
+ generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false");
+ generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false");
+ generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false");
+ generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false");
+ // set all the files user wants to generate
+ for (String files: filesToGenerate) {
+ generator.setGeneratorPropertyDefault(files, "true");
+ }
+
+ generator.opts(input).generate();
+
+ return outputPath + "/";
+ }
+
+ public static void assertFileContainsRegex(String path, String... regex) {
+ String file = readFile(path);
+ for (String line: regex)
+ assertTrue(Pattern.compile(line.replace(" ", "\\s+")).matcher(file).find());
+ }
+
+ public static void assertFileNotContainsRegex(String path, String... regex) {
+ String file = readFile(path);
+ for (String line: regex)
+ assertFalse(Pattern.compile(line.replace(" ", "\\s+")).matcher(file).find());
+ }
+
+ public static void assertFileContains(String path, String... lines) {
+ String file = linearize(readFile(path));
+ for (String line : lines)
+ assertTrue(file.contains(linearize(line)), "File does not contain line [" + line + "]");
+ }
+
+ public static void assertFileNotContains(String path, String... lines) {
+ String file = linearize(readFile(path));
+ for (String line : lines)
+ assertFalse(file.contains(linearize(line)), "File contains line [" + line + "]");
+ }
+
+ public static void assertFileExists(String path) {
+ assertTrue(Paths.get(path).toFile().exists(), "File \"" + path + "\" should exist");
+ }
+
+ public static void assertFileNotExists(String path) {
+ assertFalse(Paths.get(path).toFile().exists(), "File \"" + path + "\" should not exist");
+ }
+
+ public static String readFile(String path) {
+ String file = null;
+ try {
+ file = new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8);
+ assertNotNull(file, "File \"" + path + "\" does not exist");
+ } catch (IOException e) {
+ fail("Unable to evaluate file " + path);
+ }
+
+ return file;
+ }
+
+ public static String linearize(String target) {
+ return target.replaceAll("\r?\n", "").replaceAll("\\s+", "\\s");
+ }
+}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java
index 452d38f05e..103ae98ab1 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java
@@ -1,31 +1,18 @@
package org.openapitools.codegen.java.micronaut;
-import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
-import io.swagger.v3.parser.core.models.ParseOptions;
import org.openapitools.codegen.CliOption;
-import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.CodegenConstants;
-import org.openapitools.codegen.DefaultGenerator;
import org.openapitools.codegen.languages.JavaMicronautClientCodegen;
import org.testng.Assert;
import org.testng.annotations.Test;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-
import static java.util.stream.Collectors.groupingBy;
import static org.testng.Assert.*;
-import static org.testng.Assert.fail;
-public class MicronautClientCodegenTest {
- private final String PETSTORE_PATH = "src/test/resources/petstore.json";
+public class MicronautClientCodegenTest extends AbstractMicronautCodegenTest {
@Test
public void clientOptsUnicity() {
JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
@@ -55,6 +42,31 @@ public class MicronautClientCodegenTest {
Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools");
}
+ @Test
+ public void testApiAndModelFilesPresent() {
+ JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "org.test.test");
+ codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "org.test.test.model");
+ codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "org.test.test.api");
+ String outputPath = generateFiles(codegen, PETSTORE_PATH,
+ CodegenConstants.SUPPORTING_FILES,
+ CodegenConstants.APIS,
+ CodegenConstants.MODELS);
+
+ String apiFolder = outputPath + "src/main/java/org/test/test/api/";
+ assertFileExists(apiFolder + "PetApi.java");
+ assertFileExists(apiFolder + "StoreApi.java");
+ assertFileExists(apiFolder + "UserApi.java");
+
+ String modelFolder = outputPath + "src/main/java/org/test/test/model/";
+ assertFileExists(modelFolder + "Pet.java");
+ assertFileExists(modelFolder + "User.java");
+ assertFileExists(modelFolder + "Order.java");
+
+ String resources = outputPath + "src/main/resources/";
+ assertFileExists(resources + "application.yml");
+ }
+
@Test
public void doConfigureAuthParam() {
JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
@@ -85,7 +97,7 @@ public class MicronautClientCodegenTest {
@Test
public void doUseValidationParam() {
JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
- codegen.additionalProperties().put(JavaMicronautClientCodegen.OPT_CONFIGURE_AUTH, "false");
+ codegen.additionalProperties().put(JavaMicronautClientCodegen.USE_BEANVALIDATION, "true");
String outputPath = generateFiles(codegen, PETSTORE_PATH,
CodegenConstants.APIS);
@@ -94,6 +106,18 @@ public class MicronautClientCodegenTest {
assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@NotNull");
}
+ @Test
+ public void doNotUseValidationParam() {
+ JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
+ codegen.additionalProperties().put(JavaMicronautClientCodegen.USE_BEANVALIDATION, "false");
+ String outputPath = generateFiles(codegen, PETSTORE_PATH,
+ CodegenConstants.APIS);
+
+ // Files are not generated
+ assertFileNotContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@Valid");
+ assertFileNotContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@NotNull");
+ }
+
@Test
public void doGenerateForMaven() {
JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
@@ -162,89 +186,33 @@ public class MicronautClientCodegenTest {
assertFileContains(outputPath + "src/test/groovy/org/openapitools/api/PetApiSpec.groovy", "PetApiSpec", "@MicronautTest");
}
- /**
- *
- * @param codegen - the code generator
- * @param configPath - the path to the config starting from src/test/resources
- * @param filesToGenerate - which files to generate - can be CodegenConstants.MODELS, APIS, SUPPORTING_FILES, ...
- * @return - the path to the generated folder
- */
- protected String generateFiles(JavaMicronautClientCodegen codegen, String configPath, String... filesToGenerate) {
- File output = null;
- try {
- output = Files.createTempDirectory("test").toFile().getCanonicalFile();
- } catch (IOException e) {
- fail("Unable to create temporary directory for output");
- }
- output.deleteOnExit();
+ @Test
+ public void doGenerateRequiredPropertiesInConstructor() {
+ JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
+ codegen.additionalProperties().put(JavaMicronautClientCodegen.OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "true");
+ String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.MODELS, CodegenConstants.APIS);
- // Create parser
- String outputPath = output.getAbsolutePath().replace('\\', '/');
- OpenAPI openAPI = new OpenAPIParser()
- .readLocation(configPath, null, new ParseOptions()).getOpenAPI();
-
- // Configure codegen
- codegen.setOutputDir(outputPath);
-
- // Create input
- ClientOptInput input = new ClientOptInput();
- input.openAPI(openAPI);
- input.config(codegen);
-
- // Generate
- DefaultGenerator generator = new DefaultGenerator();
- // by default nothing is generated
- generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false");
- generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
- generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
- generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false");
- generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false");
- generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false");
- generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false");
- // set all the files user wants to generate
- for (String files: filesToGenerate) {
- generator.setGeneratorPropertyDefault(files, "true");
- }
-
- generator.opts(input).generate();
-
- return outputPath + "/";
+ // Constructor should have properties
+ String modelPath = outputPath + "src/main/java/org/openapitools/model/";
+ assertFileContains(modelPath + "Pet.java", "public Pet(String name, List photoUrls)");
+ assertFileNotContains(modelPath + "Pet.java", "public Pet()");
+ assertFileContains(modelPath + "User.java", "public User()");
+ assertFileContains(modelPath + "Order.java", "public Order()");
}
- public static void assertFileContains(String path, String... lines) {
- String file = readFile(path);
- for (String line : lines)
- assertTrue(file.contains(linearize(line)), "File does not contain line [" + line + "]");
- }
+ @Test
+ public void doNotGenerateRequiredPropertiesInConstructor() {
+ JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
+ codegen.additionalProperties().put(JavaMicronautClientCodegen.OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "false");
+ String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.MODELS, CodegenConstants.APIS);
- public static void assertFileNotContains(String path, String... lines) {
- String file = readFile(path);
- for (String line : lines)
- assertFalse(file.contains(linearize(line)), "File contains line [" + line + "]");
- }
-
- public static void assertFileExists(String path) {
- assertTrue(Paths.get(path).toFile().exists(), "File \"" + path + "\" should exist");
- }
-
- public static void assertFileNotExists(String path) {
- assertFalse(Paths.get(path).toFile().exists(), "File \"" + path + "\" should not exist");
- }
-
- public static String readFile(String path) {
- String file = null;
- try {
- String generatedFile = new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8);
- file = linearize(generatedFile);
- assertNotNull(file);
- } catch (IOException e) {
- fail("Unable to evaluate file " + path);
- }
-
- return file;
- }
-
- public static String linearize(String target) {
- return target.replaceAll("\r?\n", "").replaceAll("\\s+", "\\s");
+ // Constructor should have properties
+ String modelPath = outputPath + "src/main/java/org/openapitools/model/";
+ assertFileContains(modelPath + "Pet.java", "public Pet()");
+ assertFileNotContainsRegex(modelPath + "Pet.java", "public Pet\\([^)]+\\)");
+ assertFileContains(modelPath + "User.java", "public User()");
+ assertFileNotContainsRegex(modelPath + "User.java", "public User\\([^)]+\\)");
+ assertFileContains(modelPath + "Order.java", "public Order()");
+ assertFileNotContainsRegex(modelPath + "Order.java", "public Order\\([^)]+\\)");
}
}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java
new file mode 100644
index 0000000000..d10d250aab
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java
@@ -0,0 +1,195 @@
+package org.openapitools.codegen.java.micronaut;
+
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.servers.Server;
+import org.openapitools.codegen.CliOption;
+import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.languages.JavaMicronautServerCodegen;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import static java.util.stream.Collectors.groupingBy;
+import static org.testng.Assert.assertEquals;
+
+public class MicronautServerCodegenTest extends AbstractMicronautCodegenTest {
+ @Test
+ public void clientOptsUnicity() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.cliOptions()
+ .stream()
+ .collect(groupingBy(CliOption::getOpt))
+ .forEach((k, v) -> assertEquals(v.size(), 1, k + " is described multiple times"));
+ }
+
+ @Test
+ public void testInitialConfigValues() throws Exception {
+ final JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.processOpts();
+
+ OpenAPI openAPI = new OpenAPI();
+ openAPI.addServersItem(new Server().url("https://one.com/v2"));
+ openAPI.setInfo(new Info());
+ codegen.preprocessOpenAPI(openAPI);
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
+ Assert.assertEquals(codegen.modelPackage(), "org.openapitools.model");
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model");
+ Assert.assertEquals(codegen.apiPackage(), "org.openapitools.controller");
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.controller");
+ Assert.assertEquals(codegen.additionalProperties().get(JavaMicronautServerCodegen.OPT_CONTROLLER_PACKAGE), "org.openapitools.controller");
+ Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools");
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools");
+ }
+
+ @Test
+ public void testApiAndModelFilesPresent() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "org.test.test");
+ codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "org.test.test.model");
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_CONTROLLER_PACKAGE, "org.test.test.controller");
+ String outputPath = generateFiles(codegen, PETSTORE_PATH,
+ CodegenConstants.SUPPORTING_FILES,
+ CodegenConstants.APIS,
+ CodegenConstants.MODELS);
+
+ String invokerFolder = outputPath + "src/main/java/org/test/test/";
+ assertFileExists(invokerFolder + "Application.java");
+
+ String controllerFolder = outputPath + "src/main/java/org/test/test/controller/";
+ assertFileExists(controllerFolder + "PetController.java");
+ assertFileExists(controllerFolder + "StoreController.java");
+ assertFileExists(controllerFolder + "UserController.java");
+
+ String modelFolder = outputPath + "src/main/java/org/test/test/model/";
+ assertFileExists(modelFolder + "Pet.java");
+ assertFileExists(modelFolder + "User.java");
+ assertFileExists(modelFolder + "Order.java");
+
+ String resources = outputPath + "src/main/resources/";
+ assertFileExists(resources + "application.yml");
+ }
+
+ @Test
+ public void doUseValidationParam() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.USE_BEANVALIDATION, "true");
+ String outputPath = generateFiles(codegen, PETSTORE_PATH,
+ CodegenConstants.APIS);
+
+ // Files are not generated
+ assertFileContains(outputPath + "/src/main/java/org/openapitools/controller/PetController.java", "@Valid");
+ assertFileContains(outputPath + "/src/main/java/org/openapitools/controller/PetController.java", "@NotNull");
+ }
+
+ @Test
+ public void doNotUseValidationParam() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.USE_BEANVALIDATION, "false");
+ String outputPath = generateFiles(codegen, PETSTORE_PATH,
+ CodegenConstants.APIS);
+
+ // Files are not generated
+ assertFileNotContains(outputPath + "/src/main/java/org/openapitools/controller/PetController.java", "@Valid");
+ assertFileNotContains(outputPath + "/src/main/java/org/openapitools/controller/PetController.java", "@NotNull");
+ }
+
+ @Test
+ public void doGenerateForMaven() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_BUILD,
+ JavaMicronautServerCodegen.OPT_BUILD_MAVEN);
+ String outputPath = generateFiles(codegen, PETSTORE_PATH,
+ CodegenConstants.SUPPORTING_FILES);
+
+ // Files are not generated
+ assertFileExists(outputPath + "/pom.xml");
+ assertFileNotExists(outputPath + "/build.gradle");
+ }
+
+ @Test
+ public void doGenerateForGradle() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_BUILD,
+ JavaMicronautServerCodegen.OPT_BUILD_GRADLE);
+ String outputPath = generateFiles(codegen, PETSTORE_PATH,
+ CodegenConstants.SUPPORTING_FILES);
+
+ // Files are not generated
+ assertFileExists(outputPath + "/build.gradle");
+ assertFileNotExists(outputPath + "/pom.xml");
+ }
+
+ @Test
+ public void doGenerateForTestJUnit() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_BUILD,
+ JavaMicronautServerCodegen.OPT_BUILD_ALL);
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_TEST,
+ JavaMicronautServerCodegen.OPT_TEST_JUNIT);
+ String outputPath = generateFiles(codegen, PETSTORE_PATH,
+ CodegenConstants.SUPPORTING_FILES,
+ CodegenConstants.API_TESTS, CodegenConstants.APIS, CodegenConstants.MODELS);
+
+ // Files are not generated
+ assertFileContains(outputPath + "build.gradle", "testRuntime(\"junit");
+ assertFileContains(outputPath + "pom.xml", "micronaut-test-junit");
+ assertFileNotContains(outputPath + "build.gradle", "testRuntime(\"spock");
+ assertFileNotContains(outputPath + "pom.xml", "micronaut-test-spock");
+ assertFileExists(outputPath + "src/test/java/");
+ assertFileExists(outputPath + "src/test/java/org/openapitools/controller/PetControllerTest.java");
+ assertFileContains(outputPath + "src/test/java/org/openapitools/controller/PetControllerTest.java", "PetControllerTest", "@MicronautTest");
+ }
+
+ @Test
+ public void doGenerateForTestSpock() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_BUILD,
+ JavaMicronautServerCodegen.OPT_BUILD_ALL);
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_TEST,
+ JavaMicronautServerCodegen.OPT_TEST_SPOCK);
+ String outputPath = generateFiles(codegen, PETSTORE_PATH,
+ CodegenConstants.SUPPORTING_FILES,
+ CodegenConstants.API_TESTS, CodegenConstants.APIS, CodegenConstants.MODELS);
+
+ // Files are not generated
+ assertFileNotContains(outputPath + "build.gradle", "testRuntime(\"junit");
+ assertFileNotContains(outputPath + "pom.xml", "micronaut-test-junit");
+ assertFileContains(outputPath + "build.gradle", "testRuntime(\"spock");
+ assertFileContains(outputPath + "pom.xml", "micronaut-test-spock");
+ assertFileExists(outputPath + "src/test/groovy");
+ assertFileExists(outputPath + "src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy");
+ assertFileContains(outputPath + "src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy", "PetControllerSpec", "@MicronautTest");
+ }
+
+ @Test
+ public void doGenerateRequiredPropertiesInConstructor() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "true");
+ String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.MODELS, CodegenConstants.APIS);
+
+ // Constructor should have properties
+ String modelPath = outputPath + "src/main/java/org/openapitools/model/";
+ assertFileContains(modelPath + "Pet.java", "public Pet(String name, List photoUrls)");
+ assertFileNotContains(modelPath + "Pet.java", "public Pet()");
+ assertFileContains(modelPath + "User.java", "public User()");
+ assertFileContains(modelPath + "Order.java", "public Order()");
+ }
+
+ @Test
+ public void doNotGenerateRequiredPropertiesInConstructor() {
+ JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
+ codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "false");
+ String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.MODELS, CodegenConstants.APIS);
+
+ // Constructor should have properties
+ String modelPath = outputPath + "src/main/java/org/openapitools/model/";
+ assertFileContains(modelPath + "Pet.java", "public Pet()");
+ assertFileNotContainsRegex(modelPath + "Pet.java", "public Pet\\([^)]+\\)");
+ assertFileContains(modelPath + "User.java", "public User()");
+ assertFileNotContainsRegex(modelPath + "User.java", "public User\\([^)]+\\)");
+ assertFileContains(modelPath + "Order.java", "public Order()");
+ assertFileNotContainsRegex(modelPath + "Order.java", "public Order\\([^)]+\\)");
+ }
+}
diff --git a/pom.xml b/pom.xml
index 06f87b9cb4..94336ceb9a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -735,6 +735,18 @@
samples/client/petstore/java-micronaut-client
+
+ java-micronaut-server
+
+
+ env
+ java
+
+
+
+ samples/server/petstore/java-micronaut-server
+
+
java-msf4j-server
diff --git a/samples/client/petstore/java-micronaut-client/.openapi-generator/FILES b/samples/client/petstore/java-micronaut-client/.openapi-generator/FILES
index 22a29a5113..d5036a847b 100644
--- a/samples/client/petstore/java-micronaut-client/.openapi-generator/FILES
+++ b/samples/client/petstore/java-micronaut-client/.openapi-generator/FILES
@@ -4,61 +4,61 @@
.mvn/wrapper/maven-wrapper.jar
README.md
build.gradle
-docs/AdditionalPropertiesAnyType.md
-docs/AdditionalPropertiesArray.md
-docs/AdditionalPropertiesBoolean.md
-docs/AdditionalPropertiesClass.md
-docs/AdditionalPropertiesInteger.md
-docs/AdditionalPropertiesNumber.md
-docs/AdditionalPropertiesObject.md
-docs/AdditionalPropertiesString.md
-docs/Animal.md
-docs/AnotherFakeApi.md
-docs/ArrayOfArrayOfNumberOnly.md
-docs/ArrayOfNumberOnly.md
-docs/ArrayTest.md
-docs/BigCat.md
-docs/BigCatAllOf.md
-docs/Capitalization.md
-docs/Cat.md
-docs/CatAllOf.md
-docs/Category.md
-docs/ClassModel.md
-docs/Dog.md
-docs/DogAllOf.md
-docs/EnumArrays.md
-docs/EnumClass.md
-docs/EnumTest.md
-docs/FakeApi.md
-docs/FakeClassnameTags123Api.md
-docs/FileSchemaTestClass.md
-docs/FormatTest.md
-docs/HasOnlyReadOnly.md
-docs/MapTest.md
-docs/MixedPropertiesAndAdditionalPropertiesClass.md
-docs/Model200Response.md
-docs/ModelApiResponse.md
-docs/ModelClient.md
-docs/ModelFile.md
-docs/ModelList.md
-docs/ModelReturn.md
-docs/Name.md
-docs/NumberOnly.md
-docs/Order.md
-docs/OuterComposite.md
-docs/OuterEnum.md
-docs/Pet.md
-docs/PetApi.md
-docs/ReadOnlyFirst.md
-docs/SpecialModelName.md
-docs/StoreApi.md
-docs/Tag.md
-docs/TypeHolderDefault.md
-docs/TypeHolderExample.md
-docs/User.md
-docs/UserApi.md
-docs/XmlItem.md
-docs/auth.md
+docs/apis/AnotherFakeApi.md
+docs/apis/FakeApi.md
+docs/apis/FakeClassnameTags123Api.md
+docs/apis/PetApi.md
+docs/apis/StoreApi.md
+docs/apis/UserApi.md
+docs/apis/auth.md
+docs/models/AdditionalPropertiesAnyType.md
+docs/models/AdditionalPropertiesArray.md
+docs/models/AdditionalPropertiesBoolean.md
+docs/models/AdditionalPropertiesClass.md
+docs/models/AdditionalPropertiesInteger.md
+docs/models/AdditionalPropertiesNumber.md
+docs/models/AdditionalPropertiesObject.md
+docs/models/AdditionalPropertiesString.md
+docs/models/Animal.md
+docs/models/ArrayOfArrayOfNumberOnly.md
+docs/models/ArrayOfNumberOnly.md
+docs/models/ArrayTest.md
+docs/models/BigCat.md
+docs/models/BigCatAllOf.md
+docs/models/Capitalization.md
+docs/models/Cat.md
+docs/models/CatAllOf.md
+docs/models/Category.md
+docs/models/ClassModel.md
+docs/models/Dog.md
+docs/models/DogAllOf.md
+docs/models/EnumArrays.md
+docs/models/EnumClass.md
+docs/models/EnumTest.md
+docs/models/FileSchemaTestClass.md
+docs/models/FormatTest.md
+docs/models/HasOnlyReadOnly.md
+docs/models/MapTest.md
+docs/models/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/models/Model200Response.md
+docs/models/ModelApiResponse.md
+docs/models/ModelClient.md
+docs/models/ModelFile.md
+docs/models/ModelList.md
+docs/models/ModelReturn.md
+docs/models/Name.md
+docs/models/NumberOnly.md
+docs/models/Order.md
+docs/models/OuterComposite.md
+docs/models/OuterEnum.md
+docs/models/Pet.md
+docs/models/ReadOnlyFirst.md
+docs/models/SpecialModelName.md
+docs/models/Tag.md
+docs/models/TypeHolderDefault.md
+docs/models/TypeHolderExample.md
+docs/models/User.md
+docs/models/XmlItem.md
gradle.properties
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
@@ -122,6 +122,5 @@ src/main/java/org/openapitools/model/TypeHolderDefault.java
src/main/java/org/openapitools/model/TypeHolderExample.java
src/main/java/org/openapitools/model/User.java
src/main/java/org/openapitools/model/XmlItem.java
-src/main/java/org/openapitools/query/QueryParam.java
-src/main/java/org/openapitools/query/QueryParamBinder.java
src/main/resources/application.yml
+src/main/resources/logback.xml
diff --git a/samples/client/petstore/java-micronaut-client/README.md b/samples/client/petstore/java-micronaut-client/README.md
index 9ed69e201d..149073d437 100644
--- a/samples/client/petstore/java-micronaut-client/README.md
+++ b/samples/client/petstore/java-micronaut-client/README.md
@@ -25,12 +25,12 @@ All the properties can be changed in the [application.yml][src/main/resources/ap
Description on how to create Apis is given inside individual api guides:
-* [AnotherFakeApi](docs//AnotherFakeApi.md)
-* [FakeApi](docs//FakeApi.md)
-* [FakeClassnameTags123Api](docs//FakeClassnameTags123Api.md)
-* [PetApi](docs//PetApi.md)
-* [StoreApi](docs//StoreApi.md)
-* [UserApi](docs//UserApi.md)
+* [AnotherFakeApi](docs/apis/AnotherFakeApi.md)
+* [FakeApi](docs/apis/FakeApi.md)
+* [FakeClassnameTags123Api](docs/apis/FakeClassnameTags123Api.md)
+* [PetApi](docs/apis/PetApi.md)
+* [StoreApi](docs/apis/StoreApi.md)
+* [UserApi](docs/apis/UserApi.md)
## Auth methods
diff --git a/samples/client/petstore/java-micronaut-client/build.gradle b/samples/client/petstore/java-micronaut-client/build.gradle
index 856fe2d434..c74021320c 100644
--- a/samples/client/petstore/java-micronaut-client/build.gradle
+++ b/samples/client/petstore/java-micronaut-client/build.gradle
@@ -1,7 +1,7 @@
plugins {
id("groovy")
- id("com.github.johnrengelman.shadow") version "7.0.0"
- id("io.micronaut.application") version "2.0.3"
+ id("com.github.johnrengelman.shadow") version "7.1.1"
+ id("io.micronaut.application") version "3.1.1"
}
version = "1.0.0"
@@ -42,3 +42,5 @@ java {
sourceCompatibility = JavaVersion.toVersion("1.8")
targetCompatibility = JavaVersion.toVersion("1.8")
}
+
+graalvmNative.toolchainDetection = false
diff --git a/samples/client/petstore/java-micronaut-client/docs/AnotherFakeApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/AnotherFakeApi.md
similarity index 100%
rename from samples/client/petstore/java-micronaut-client/docs/AnotherFakeApi.md
rename to samples/client/petstore/java-micronaut-client/docs/apis/AnotherFakeApi.md
diff --git a/samples/client/petstore/java-micronaut-client/docs/FakeApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/FakeApi.md
similarity index 99%
rename from samples/client/petstore/java-micronaut-client/docs/FakeApi.md
rename to samples/client/petstore/java-micronaut-client/docs/apis/FakeApi.md
index 3b9f98a4ed..14cf772369 100644
--- a/samples/client/petstore/java-micronaut-client/docs/FakeApi.md
+++ b/samples/client/petstore/java-micronaut-client/docs/apis/FakeApi.md
@@ -95,7 +95,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: `*/*`
+ - **Accept**: Not defined
# **fakeOuterCompositeSerialize**
@@ -120,7 +120,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: `*/*`
+ - **Accept**: Not defined
# **fakeOuterNumberSerialize**
@@ -145,7 +145,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: `*/*`
+ - **Accept**: Not defined
# **fakeOuterStringSerialize**
@@ -170,7 +170,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: `*/*`
+ - **Accept**: Not defined
# **testBodyWithFileSchema**
diff --git a/samples/client/petstore/java-micronaut-client/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java-micronaut-client/docs/apis/FakeClassnameTags123Api.md
similarity index 100%
rename from samples/client/petstore/java-micronaut-client/docs/FakeClassnameTags123Api.md
rename to samples/client/petstore/java-micronaut-client/docs/apis/FakeClassnameTags123Api.md
diff --git a/samples/client/petstore/java-micronaut-client/docs/PetApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/PetApi.md
similarity index 100%
rename from samples/client/petstore/java-micronaut-client/docs/PetApi.md
rename to samples/client/petstore/java-micronaut-client/docs/apis/PetApi.md
diff --git a/samples/client/petstore/java-micronaut-client/docs/StoreApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/StoreApi.md
similarity index 100%
rename from samples/client/petstore/java-micronaut-client/docs/StoreApi.md
rename to samples/client/petstore/java-micronaut-client/docs/apis/StoreApi.md
diff --git a/samples/client/petstore/java-micronaut-client/docs/UserApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/UserApi.md
similarity index 100%
rename from samples/client/petstore/java-micronaut-client/docs/UserApi.md
rename to samples/client/petstore/java-micronaut-client/docs/apis/UserApi.md
diff --git a/samples/client/petstore/java-micronaut-client/docs/auth.md b/samples/client/petstore/java-micronaut-client/docs/apis/auth.md
similarity index 100%
rename from samples/client/petstore/java-micronaut-client/docs/auth.md
rename to samples/client/petstore/java-micronaut-client/docs/apis/auth.md
diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesAnyType.md
similarity index 57%
rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesAnyType.md
rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesAnyType.md
index fddcd9d8e0..d57b272103 100644
--- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesAnyType.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesAnyType.md
@@ -2,6 +2,7 @@
# AdditionalPropertiesAnyType
+The class is defined in **[AdditionalPropertiesAnyType.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesArray.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesArray.md
similarity index 58%
rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesArray.md
rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesArray.md
index c52113f687..8eb24fe826 100644
--- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesArray.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesArray.md
@@ -2,6 +2,7 @@
# AdditionalPropertiesArray
+The class is defined in **[AdditionalPropertiesArray.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesArray.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesBoolean.md
similarity index 57%
rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesBoolean.md
rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesBoolean.md
index 9d626b4466..6fcfa2a50f 100644
--- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesBoolean.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesBoolean.md
@@ -2,6 +2,7 @@
# AdditionalPropertiesBoolean
+The class is defined in **[AdditionalPropertiesBoolean.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesClass.md
similarity index 86%
rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesClass.md
rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesClass.md
index 84f88e3fdb..4e452d010d 100644
--- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesClass.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesClass.md
@@ -2,6 +2,7 @@
# AdditionalPropertiesClass
+The class is defined in **[AdditionalPropertiesClass.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesClass.java)**
## Properties
@@ -24,3 +25,10 @@ Name | Type | Description | Notes
+
+
+
+
+
+
+
diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesInteger.md
similarity index 57%
rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesInteger.md
rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesInteger.md
index b17edb5565..3f8aee1c87 100644
--- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesInteger.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesInteger.md
@@ -2,6 +2,7 @@
# AdditionalPropertiesInteger
+The class is defined in **[AdditionalPropertiesInteger.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesNumber.md
similarity index 58%
rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesNumber.md
rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesNumber.md
index bd33c906ee..1e8f61b42a 100644
--- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesNumber.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesNumber.md
@@ -2,6 +2,7 @@
# AdditionalPropertiesNumber
+The class is defined in **[AdditionalPropertiesNumber.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesObject.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesObject.md
similarity index 58%
rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesObject.md
rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesObject.md
index a77d38c7b1..a839641e6e 100644
--- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesObject.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesObject.md
@@ -2,6 +2,7 @@
# AdditionalPropertiesObject
+The class is defined in **[AdditionalPropertiesObject.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesObject.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesString.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesString.md
similarity index 58%
rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesString.md
rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesString.md
index 6f1ccd0910..1452d77056 100644
--- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesString.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesString.md
@@ -2,6 +2,7 @@
# AdditionalPropertiesString
+The class is defined in **[AdditionalPropertiesString.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesString.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/Animal.md b/samples/client/petstore/java-micronaut-client/docs/models/Animal.md
similarity index 67%
rename from samples/client/petstore/java-micronaut-client/docs/Animal.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Animal.md
index 4d92e8e7e2..226b3933ac 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Animal.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Animal.md
@@ -2,6 +2,7 @@
# Animal
+The class is defined in **[Animal.java](../../src/main/java/org/openapitools/model/Animal.java)**
## Properties
@@ -13,5 +14,3 @@ Name | Type | Description | Notes
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java-micronaut-client/docs/models/ArrayOfArrayOfNumberOnly.md
similarity index 63%
rename from samples/client/petstore/java-micronaut-client/docs/ArrayOfArrayOfNumberOnly.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ArrayOfArrayOfNumberOnly.md
index 65f6fb827f..3cf3adab1c 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ArrayOfArrayOfNumberOnly.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ArrayOfArrayOfNumberOnly.md
@@ -2,6 +2,7 @@
# ArrayOfArrayOfNumberOnly
+The class is defined in **[ArrayOfArrayOfNumberOnly.java](../../src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java-micronaut-client/docs/models/ArrayOfNumberOnly.md
similarity index 63%
rename from samples/client/petstore/java-micronaut-client/docs/ArrayOfNumberOnly.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ArrayOfNumberOnly.md
index 2909608f6e..fe09bde39c 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ArrayOfNumberOnly.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ArrayOfNumberOnly.md
@@ -2,6 +2,7 @@
# ArrayOfNumberOnly
+The class is defined in **[ArrayOfNumberOnly.java](../../src/main/java/org/openapitools/model/ArrayOfNumberOnly.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/ArrayTest.md b/samples/client/petstore/java-micronaut-client/docs/models/ArrayTest.md
similarity index 78%
rename from samples/client/petstore/java-micronaut-client/docs/ArrayTest.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ArrayTest.md
index ee3f7633b2..3f3ec33c73 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ArrayTest.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ArrayTest.md
@@ -2,6 +2,7 @@
# ArrayTest
+The class is defined in **[ArrayTest.java](../../src/main/java/org/openapitools/model/ArrayTest.java)**
## Properties
@@ -15,4 +16,3 @@ Name | Type | Description | Notes
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/BigCat.md b/samples/client/petstore/java-micronaut-client/docs/models/BigCat.md
similarity index 52%
rename from samples/client/petstore/java-micronaut-client/docs/BigCat.md
rename to samples/client/petstore/java-micronaut-client/docs/models/BigCat.md
index e368f81567..2bc6032da8 100644
--- a/samples/client/petstore/java-micronaut-client/docs/BigCat.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/BigCat.md
@@ -2,6 +2,7 @@
# BigCat
+The class is defined in **[BigCat.java](../../src/main/java/org/openapitools/model/BigCat.java)**
## Properties
@@ -9,18 +10,13 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | [**KindEnum**](#KindEnum) | | [optional property]
-
-
-## Enum: KindEnum
+## KindEnum
Name | Value
---- | -----
-LIONS | `"lions"`
-TIGERS | `"tigers"`
-LEOPARDS | `"leopards"`
-JAGUARS | `"jaguars"`
-
-
-
+LIONS | `"lions"`
+TIGERS | `"tigers"`
+LEOPARDS | `"leopards"`
+JAGUARS | `"jaguars"`
diff --git a/samples/client/petstore/java-micronaut-client/docs/BigCatAllOf.md b/samples/client/petstore/java-micronaut-client/docs/models/BigCatAllOf.md
similarity index 52%
rename from samples/client/petstore/java-micronaut-client/docs/BigCatAllOf.md
rename to samples/client/petstore/java-micronaut-client/docs/models/BigCatAllOf.md
index 869236ae81..6e72649489 100644
--- a/samples/client/petstore/java-micronaut-client/docs/BigCatAllOf.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/BigCatAllOf.md
@@ -2,6 +2,7 @@
# BigCatAllOf
+The class is defined in **[BigCatAllOf.java](../../src/main/java/org/openapitools/model/BigCatAllOf.java)**
## Properties
@@ -9,18 +10,13 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | [**KindEnum**](#KindEnum) | | [optional property]
-
-
-## Enum: KindEnum
+## KindEnum
Name | Value
---- | -----
-LIONS | `"lions"`
-TIGERS | `"tigers"`
-LEOPARDS | `"leopards"`
-JAGUARS | `"jaguars"`
-
-
-
+LIONS | `"lions"`
+TIGERS | `"tigers"`
+LEOPARDS | `"leopards"`
+JAGUARS | `"jaguars"`
diff --git a/samples/client/petstore/java-micronaut-client/docs/Capitalization.md b/samples/client/petstore/java-micronaut-client/docs/models/Capitalization.md
similarity index 80%
rename from samples/client/petstore/java-micronaut-client/docs/Capitalization.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Capitalization.md
index fb5232d52d..c3578bff00 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Capitalization.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Capitalization.md
@@ -2,6 +2,7 @@
# Capitalization
+The class is defined in **[Capitalization.java](../../src/main/java/org/openapitools/model/Capitalization.java)**
## Properties
@@ -19,3 +20,5 @@ Name | Type | Description | Notes
+
+
diff --git a/samples/client/petstore/java-micronaut-client/docs/Cat.md b/samples/client/petstore/java-micronaut-client/docs/models/Cat.md
similarity index 65%
rename from samples/client/petstore/java-micronaut-client/docs/Cat.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Cat.md
index 4a7e1503b1..44b1d8fd3e 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Cat.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Cat.md
@@ -2,6 +2,7 @@
# Cat
+The class is defined in **[Cat.java](../../src/main/java/org/openapitools/model/Cat.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/CatAllOf.md b/samples/client/petstore/java-micronaut-client/docs/models/CatAllOf.md
similarity index 63%
rename from samples/client/petstore/java-micronaut-client/docs/CatAllOf.md
rename to samples/client/petstore/java-micronaut-client/docs/models/CatAllOf.md
index 41f0898e7c..e93b6a351f 100644
--- a/samples/client/petstore/java-micronaut-client/docs/CatAllOf.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/CatAllOf.md
@@ -2,6 +2,7 @@
# CatAllOf
+The class is defined in **[CatAllOf.java](../../src/main/java/org/openapitools/model/CatAllOf.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/Category.md b/samples/client/petstore/java-micronaut-client/docs/models/Category.md
similarity index 65%
rename from samples/client/petstore/java-micronaut-client/docs/Category.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Category.md
index 497a0ce8d4..cab979e1c3 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Category.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Category.md
@@ -2,6 +2,7 @@
# Category
+The class is defined in **[Category.java](../../src/main/java/org/openapitools/model/Category.java)**
## Properties
@@ -13,5 +14,3 @@ Name | Type | Description | Notes
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/ClassModel.md b/samples/client/petstore/java-micronaut-client/docs/models/ClassModel.md
similarity index 68%
rename from samples/client/petstore/java-micronaut-client/docs/ClassModel.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ClassModel.md
index e428f3bc20..c3565b7c92 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ClassModel.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ClassModel.md
@@ -4,6 +4,8 @@
Model for testing model with \"_class\" property
+The class is defined in **[ClassModel.java](../../src/main/java/org/openapitools/model/ClassModel.java)**
+
## Properties
Name | Type | Description | Notes
@@ -12,6 +14,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/Dog.md b/samples/client/petstore/java-micronaut-client/docs/models/Dog.md
similarity index 64%
rename from samples/client/petstore/java-micronaut-client/docs/Dog.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Dog.md
index db403946fc..552e737375 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Dog.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Dog.md
@@ -2,6 +2,7 @@
# Dog
+The class is defined in **[Dog.java](../../src/main/java/org/openapitools/model/Dog.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/DogAllOf.md b/samples/client/petstore/java-micronaut-client/docs/models/DogAllOf.md
similarity index 63%
rename from samples/client/petstore/java-micronaut-client/docs/DogAllOf.md
rename to samples/client/petstore/java-micronaut-client/docs/models/DogAllOf.md
index e89dd64069..6e25529833 100644
--- a/samples/client/petstore/java-micronaut-client/docs/DogAllOf.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/DogAllOf.md
@@ -2,6 +2,7 @@
# DogAllOf
+The class is defined in **[DogAllOf.java](../../src/main/java/org/openapitools/model/DogAllOf.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/EnumArrays.md b/samples/client/petstore/java-micronaut-client/docs/models/EnumArrays.md
similarity index 61%
rename from samples/client/petstore/java-micronaut-client/docs/EnumArrays.md
rename to samples/client/petstore/java-micronaut-client/docs/models/EnumArrays.md
index f905c2dab3..421d6479b0 100644
--- a/samples/client/petstore/java-micronaut-client/docs/EnumArrays.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/EnumArrays.md
@@ -2,6 +2,7 @@
# EnumArrays
+The class is defined in **[EnumArrays.java](../../src/main/java/org/openapitools/model/EnumArrays.java)**
## Properties
@@ -10,24 +11,18 @@ Name | Type | Description | Notes
**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional property]
**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional property]
-
-
-## Enum: JustSymbolEnum
+## JustSymbolEnum
Name | Value
---- | -----
-GREATER_THAN_OR_EQUAL_TO | `">="`
-DOLLAR | `"$"`
+GREATER_THAN_OR_EQUAL_TO | `">="`
+DOLLAR | `"$"`
-
-## Enum: List<ArrayEnumEnum>
+## List<ArrayEnumEnum>
Name | Value
---- | -----
-FISH | `"fish"`
-CRAB | `"crab"`
-
-
-
+FISH | `"fish"`
+CRAB | `"crab"`
diff --git a/samples/client/petstore/java-micronaut-client/docs/EnumClass.md b/samples/client/petstore/java-micronaut-client/docs/models/EnumClass.md
similarity index 51%
rename from samples/client/petstore/java-micronaut-client/docs/EnumClass.md
rename to samples/client/petstore/java-micronaut-client/docs/models/EnumClass.md
index b314590a75..e09084e283 100644
--- a/samples/client/petstore/java-micronaut-client/docs/EnumClass.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/EnumClass.md
@@ -4,6 +4,8 @@
## Enum
+The class is defined in **[EnumClass.java](../../src/main/java/org/openapitools/model/EnumClass.java)**
+
* `_ABC` (value: `"_abc"`)
diff --git a/samples/client/petstore/java-micronaut-client/docs/EnumTest.md b/samples/client/petstore/java-micronaut-client/docs/models/EnumTest.md
similarity index 71%
rename from samples/client/petstore/java-micronaut-client/docs/EnumTest.md
rename to samples/client/petstore/java-micronaut-client/docs/models/EnumTest.md
index d2a2431223..d183eb4d5f 100644
--- a/samples/client/petstore/java-micronaut-client/docs/EnumTest.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/EnumTest.md
@@ -2,6 +2,7 @@
# EnumTest
+The class is defined in **[EnumTest.java](../../src/main/java/org/openapitools/model/EnumTest.java)**
## Properties
@@ -13,35 +14,30 @@ Name | Type | Description | Notes
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional property]
**outerEnum** | `OuterEnum` | | [optional property]
-
-
-## Enum: EnumStringEnum
+## EnumStringEnum
Name | Value
---- | -----
-UPPER | `"UPPER"`
-LOWER | `"lower"`
-EMPTY | `""`
+UPPER | `"UPPER"`
+LOWER | `"lower"`
+EMPTY | `""`
-
-## Enum: EnumStringRequiredEnum
+## EnumStringRequiredEnum
Name | Value
---- | -----
-UPPER | `"UPPER"`
-LOWER | `"lower"`
-EMPTY | `""`
+UPPER | `"UPPER"`
+LOWER | `"lower"`
+EMPTY | `""`
-
-## Enum: EnumIntegerEnum
+## EnumIntegerEnum
Name | Value
---- | -----
NUMBER_1 | `1`
NUMBER_MINUS_1 | `-1`
-
-## Enum: EnumNumberEnum
+## EnumNumberEnum
Name | Value
---- | -----
@@ -50,5 +46,3 @@ NUMBER_MINUS_1_DOT_2 | `-1.2`
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/FileSchemaTestClass.md b/samples/client/petstore/java-micronaut-client/docs/models/FileSchemaTestClass.md
similarity index 69%
rename from samples/client/petstore/java-micronaut-client/docs/FileSchemaTestClass.md
rename to samples/client/petstore/java-micronaut-client/docs/models/FileSchemaTestClass.md
index 4039c94868..0214efd309 100644
--- a/samples/client/petstore/java-micronaut-client/docs/FileSchemaTestClass.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/FileSchemaTestClass.md
@@ -2,6 +2,7 @@
# FileSchemaTestClass
+The class is defined in **[FileSchemaTestClass.java](../../src/main/java/org/openapitools/model/FileSchemaTestClass.java)**
## Properties
@@ -13,5 +14,3 @@ Name | Type | Description | Notes
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/FormatTest.md b/samples/client/petstore/java-micronaut-client/docs/models/FormatTest.md
similarity index 86%
rename from samples/client/petstore/java-micronaut-client/docs/FormatTest.md
rename to samples/client/petstore/java-micronaut-client/docs/models/FormatTest.md
index 74c29bb97b..d7299aaa90 100644
--- a/samples/client/petstore/java-micronaut-client/docs/FormatTest.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/FormatTest.md
@@ -2,6 +2,7 @@
# FormatTest
+The class is defined in **[FormatTest.java](../../src/main/java/org/openapitools/model/FormatTest.java)**
## Properties
@@ -27,3 +28,13 @@ Name | Type | Description | Notes
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/client/petstore/java-micronaut-client/docs/HasOnlyReadOnly.md b/samples/client/petstore/java-micronaut-client/docs/models/HasOnlyReadOnly.md
similarity index 69%
rename from samples/client/petstore/java-micronaut-client/docs/HasOnlyReadOnly.md
rename to samples/client/petstore/java-micronaut-client/docs/models/HasOnlyReadOnly.md
index c53bce80f6..fab72494cf 100644
--- a/samples/client/petstore/java-micronaut-client/docs/HasOnlyReadOnly.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/HasOnlyReadOnly.md
@@ -2,6 +2,7 @@
# HasOnlyReadOnly
+The class is defined in **[HasOnlyReadOnly.java](../../src/main/java/org/openapitools/model/HasOnlyReadOnly.java)**
## Properties
@@ -13,5 +14,3 @@ Name | Type | Description | Notes
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/MapTest.md b/samples/client/petstore/java-micronaut-client/docs/models/MapTest.md
similarity index 75%
rename from samples/client/petstore/java-micronaut-client/docs/MapTest.md
rename to samples/client/petstore/java-micronaut-client/docs/models/MapTest.md
index 8b868a1ae7..f5f96393f1 100644
--- a/samples/client/petstore/java-micronaut-client/docs/MapTest.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/MapTest.md
@@ -2,6 +2,7 @@
# MapTest
+The class is defined in **[MapTest.java](../../src/main/java/org/openapitools/model/MapTest.java)**
## Properties
@@ -13,14 +14,12 @@ Name | Type | Description | Notes
**indirectMap** | `Map<String, Boolean>` | | [optional property]
-
-## Enum: Map<String, InnerEnum>
+## Map<String, InnerEnum>
Name | Value
---- | -----
-UPPER | `"UPPER"`
-LOWER | `"lower"`
-
+UPPER | `"UPPER"`
+LOWER | `"lower"`
diff --git a/samples/client/petstore/java-micronaut-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java-micronaut-client/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md
similarity index 66%
rename from samples/client/petstore/java-micronaut-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md
rename to samples/client/petstore/java-micronaut-client/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md
index 40f3a82eff..b7c29269f1 100644
--- a/samples/client/petstore/java-micronaut-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -2,6 +2,7 @@
# MixedPropertiesAndAdditionalPropertiesClass
+The class is defined in **[MixedPropertiesAndAdditionalPropertiesClass.java](../../src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java)**
## Properties
@@ -15,4 +16,3 @@ Name | Type | Description | Notes
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/Model200Response.md b/samples/client/petstore/java-micronaut-client/docs/models/Model200Response.md
similarity index 71%
rename from samples/client/petstore/java-micronaut-client/docs/Model200Response.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Model200Response.md
index bc8078d0be..7f403913bb 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Model200Response.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Model200Response.md
@@ -4,6 +4,8 @@
Model for testing model name starting with number
+The class is defined in **[Model200Response.java](../../src/main/java/org/openapitools/model/Model200Response.java)**
+
## Properties
Name | Type | Description | Notes
@@ -14,5 +16,3 @@ Name | Type | Description | Notes
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelApiResponse.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelApiResponse.md
similarity index 70%
rename from samples/client/petstore/java-micronaut-client/docs/ModelApiResponse.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ModelApiResponse.md
index 950119dc1f..2d8154e28e 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ModelApiResponse.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelApiResponse.md
@@ -2,6 +2,7 @@
# ModelApiResponse
+The class is defined in **[ModelApiResponse.java](../../src/main/java/org/openapitools/model/ModelApiResponse.java)**
## Properties
@@ -15,4 +16,3 @@ Name | Type | Description | Notes
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelClient.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelClient.md
similarity index 62%
rename from samples/client/petstore/java-micronaut-client/docs/ModelClient.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ModelClient.md
index 74770bad07..3bfcef3bb1 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ModelClient.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelClient.md
@@ -2,6 +2,7 @@
# ModelClient
+The class is defined in **[ModelClient.java](../../src/main/java/org/openapitools/model/ModelClient.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelFile.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelFile.md
similarity index 68%
rename from samples/client/petstore/java-micronaut-client/docs/ModelFile.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ModelFile.md
index 014716aba6..53228b7d77 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ModelFile.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelFile.md
@@ -4,6 +4,8 @@
Must be named `File` for test.
+The class is defined in **[ModelFile.java](../../src/main/java/org/openapitools/model/ModelFile.java)**
+
## Properties
Name | Type | Description | Notes
@@ -12,6 +14,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelList.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelList.md
similarity index 63%
rename from samples/client/petstore/java-micronaut-client/docs/ModelList.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ModelList.md
index 6468645316..badcf08bd2 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ModelList.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelList.md
@@ -2,6 +2,7 @@
# ModelList
+The class is defined in **[ModelList.java](../../src/main/java/org/openapitools/model/ModelList.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelReturn.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelReturn.md
similarity index 66%
rename from samples/client/petstore/java-micronaut-client/docs/ModelReturn.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ModelReturn.md
index f907f3a956..48712674ad 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ModelReturn.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelReturn.md
@@ -4,6 +4,8 @@
Model for testing reserved words
+The class is defined in **[ModelReturn.java](../../src/main/java/org/openapitools/model/ModelReturn.java)**
+
## Properties
Name | Type | Description | Notes
@@ -12,6 +14,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/Name.md b/samples/client/petstore/java-micronaut-client/docs/models/Name.md
similarity index 80%
rename from samples/client/petstore/java-micronaut-client/docs/Name.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Name.md
index e9e41d1343..9595d1d974 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Name.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Name.md
@@ -4,6 +4,8 @@
Model for testing model name same as property name
+The class is defined in **[Name.java](../../src/main/java/org/openapitools/model/Name.java)**
+
## Properties
Name | Type | Description | Notes
diff --git a/samples/client/petstore/java-micronaut-client/docs/NumberOnly.md b/samples/client/petstore/java-micronaut-client/docs/models/NumberOnly.md
similarity index 63%
rename from samples/client/petstore/java-micronaut-client/docs/NumberOnly.md
rename to samples/client/petstore/java-micronaut-client/docs/models/NumberOnly.md
index ff8408617c..1c7c5a3d67 100644
--- a/samples/client/petstore/java-micronaut-client/docs/NumberOnly.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/NumberOnly.md
@@ -2,6 +2,7 @@
# NumberOnly
+The class is defined in **[NumberOnly.java](../../src/main/java/org/openapitools/model/NumberOnly.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/Order.md b/samples/client/petstore/java-micronaut-client/docs/models/Order.md
similarity index 72%
rename from samples/client/petstore/java-micronaut-client/docs/Order.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Order.md
index 2522ec781e..c5f46aad0e 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Order.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Order.md
@@ -2,6 +2,7 @@
# Order
+The class is defined in **[Order.java](../../src/main/java/org/openapitools/model/Order.java)**
## Properties
@@ -16,15 +17,15 @@ Name | Type | Description | Notes
-## Enum: StatusEnum
+
+
+## StatusEnum
Name | Value
---- | -----
-PLACED | `"placed"`
-APPROVED | `"approved"`
-DELIVERED | `"delivered"`
-
-
+PLACED | `"placed"`
+APPROVED | `"approved"`
+DELIVERED | `"delivered"`
diff --git a/samples/client/petstore/java-micronaut-client/docs/OuterComposite.md b/samples/client/petstore/java-micronaut-client/docs/models/OuterComposite.md
similarity index 71%
rename from samples/client/petstore/java-micronaut-client/docs/OuterComposite.md
rename to samples/client/petstore/java-micronaut-client/docs/models/OuterComposite.md
index dc004d557a..13edac1307 100644
--- a/samples/client/petstore/java-micronaut-client/docs/OuterComposite.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/OuterComposite.md
@@ -2,6 +2,7 @@
# OuterComposite
+The class is defined in **[OuterComposite.java](../../src/main/java/org/openapitools/model/OuterComposite.java)**
## Properties
@@ -15,4 +16,3 @@ Name | Type | Description | Notes
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/OuterEnum.md b/samples/client/petstore/java-micronaut-client/docs/models/OuterEnum.md
similarity index 55%
rename from samples/client/petstore/java-micronaut-client/docs/OuterEnum.md
rename to samples/client/petstore/java-micronaut-client/docs/models/OuterEnum.md
index 1f9b723eb8..71fc1dfeba 100644
--- a/samples/client/petstore/java-micronaut-client/docs/OuterEnum.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/OuterEnum.md
@@ -4,6 +4,8 @@
## Enum
+The class is defined in **[OuterEnum.java](../../src/main/java/org/openapitools/model/OuterEnum.java)**
+
* `PLACED` (value: `"placed"`)
diff --git a/samples/client/petstore/java-micronaut-client/docs/Pet.md b/samples/client/petstore/java-micronaut-client/docs/models/Pet.md
similarity index 74%
rename from samples/client/petstore/java-micronaut-client/docs/Pet.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Pet.md
index 6a18fe4238..8abc005db7 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Pet.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Pet.md
@@ -2,6 +2,7 @@
# Pet
+The class is defined in **[Pet.java](../../src/main/java/org/openapitools/model/Pet.java)**
## Properties
@@ -16,15 +17,15 @@ Name | Type | Description | Notes
-## Enum: StatusEnum
+
+
+
+## StatusEnum
Name | Value
---- | -----
-AVAILABLE | `"available"`
-PENDING | `"pending"`
-SOLD | `"sold"`
-
-
-
+AVAILABLE | `"available"`
+PENDING | `"pending"`
+SOLD | `"sold"`
diff --git a/samples/client/petstore/java-micronaut-client/docs/ReadOnlyFirst.md b/samples/client/petstore/java-micronaut-client/docs/models/ReadOnlyFirst.md
similarity index 68%
rename from samples/client/petstore/java-micronaut-client/docs/ReadOnlyFirst.md
rename to samples/client/petstore/java-micronaut-client/docs/models/ReadOnlyFirst.md
index 503ba210db..3ee5d2f8e0 100644
--- a/samples/client/petstore/java-micronaut-client/docs/ReadOnlyFirst.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/ReadOnlyFirst.md
@@ -2,6 +2,7 @@
# ReadOnlyFirst
+The class is defined in **[ReadOnlyFirst.java](../../src/main/java/org/openapitools/model/ReadOnlyFirst.java)**
## Properties
@@ -13,5 +14,3 @@ Name | Type | Description | Notes
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/SpecialModelName.md b/samples/client/petstore/java-micronaut-client/docs/models/SpecialModelName.md
similarity index 62%
rename from samples/client/petstore/java-micronaut-client/docs/SpecialModelName.md
rename to samples/client/petstore/java-micronaut-client/docs/models/SpecialModelName.md
index 88dbe30279..881887f07a 100644
--- a/samples/client/petstore/java-micronaut-client/docs/SpecialModelName.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/SpecialModelName.md
@@ -2,6 +2,7 @@
# SpecialModelName
+The class is defined in **[SpecialModelName.java](../../src/main/java/org/openapitools/model/SpecialModelName.java)**
## Properties
@@ -11,6 +12,3 @@ Name | Type | Description | Notes
-
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/Tag.md b/samples/client/petstore/java-micronaut-client/docs/models/Tag.md
similarity index 69%
rename from samples/client/petstore/java-micronaut-client/docs/Tag.md
rename to samples/client/petstore/java-micronaut-client/docs/models/Tag.md
index 7de5f5be77..0f9ae67b0a 100644
--- a/samples/client/petstore/java-micronaut-client/docs/Tag.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/Tag.md
@@ -2,6 +2,7 @@
# Tag
+The class is defined in **[Tag.java](../../src/main/java/org/openapitools/model/Tag.java)**
## Properties
@@ -13,5 +14,3 @@ Name | Type | Description | Notes
-
-
diff --git a/samples/client/petstore/java-micronaut-client/docs/TypeHolderDefault.md b/samples/client/petstore/java-micronaut-client/docs/models/TypeHolderDefault.md
similarity index 72%
rename from samples/client/petstore/java-micronaut-client/docs/TypeHolderDefault.md
rename to samples/client/petstore/java-micronaut-client/docs/models/TypeHolderDefault.md
index 1cd7787e49..cb18bde0ed 100644
--- a/samples/client/petstore/java-micronaut-client/docs/TypeHolderDefault.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/TypeHolderDefault.md
@@ -2,6 +2,7 @@
# TypeHolderDefault
+The class is defined in **[TypeHolderDefault.java](../../src/main/java/org/openapitools/model/TypeHolderDefault.java)**
## Properties
@@ -18,3 +19,4 @@ Name | Type | Description | Notes
+
diff --git a/samples/client/petstore/java-micronaut-client/docs/TypeHolderExample.md b/samples/client/petstore/java-micronaut-client/docs/models/TypeHolderExample.md
similarity index 73%
rename from samples/client/petstore/java-micronaut-client/docs/TypeHolderExample.md
rename to samples/client/petstore/java-micronaut-client/docs/models/TypeHolderExample.md
index 805608ae2b..83a65f0f27 100644
--- a/samples/client/petstore/java-micronaut-client/docs/TypeHolderExample.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/TypeHolderExample.md
@@ -2,6 +2,7 @@
# TypeHolderExample
+The class is defined in **[TypeHolderExample.java](../../src/main/java/org/openapitools/model/TypeHolderExample.java)**
## Properties
@@ -19,3 +20,5 @@ Name | Type | Description | Notes
+
+
diff --git a/samples/client/petstore/java-micronaut-client/docs/User.md b/samples/client/petstore/java-micronaut-client/docs/models/User.md
similarity index 84%
rename from samples/client/petstore/java-micronaut-client/docs/User.md
rename to samples/client/petstore/java-micronaut-client/docs/models/User.md
index 73274c63f1..5306420809 100644
--- a/samples/client/petstore/java-micronaut-client/docs/User.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/User.md
@@ -2,6 +2,7 @@
# User
+The class is defined in **[User.java](../../src/main/java/org/openapitools/model/User.java)**
## Properties
@@ -21,3 +22,7 @@ Name | Type | Description | Notes
+
+
+
+
diff --git a/samples/client/petstore/java-micronaut-client/docs/XmlItem.md b/samples/client/petstore/java-micronaut-client/docs/models/XmlItem.md
similarity index 93%
rename from samples/client/petstore/java-micronaut-client/docs/XmlItem.md
rename to samples/client/petstore/java-micronaut-client/docs/models/XmlItem.md
index 2f07c8efbf..71ca437c2e 100644
--- a/samples/client/petstore/java-micronaut-client/docs/XmlItem.md
+++ b/samples/client/petstore/java-micronaut-client/docs/models/XmlItem.md
@@ -2,6 +2,7 @@
# XmlItem
+The class is defined in **[XmlItem.java](../../src/main/java/org/openapitools/model/XmlItem.java)**
## Properties
@@ -42,3 +43,28 @@ Name | Type | Description | Notes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/client/petstore/java-micronaut-client/gradle.properties b/samples/client/petstore/java-micronaut-client/gradle.properties
index 4804e04901..70b9dde78f 100644
--- a/samples/client/petstore/java-micronaut-client/gradle.properties
+++ b/samples/client/petstore/java-micronaut-client/gradle.properties
@@ -1 +1 @@
-micronautVersion=3.0.0-M5
\ No newline at end of file
+micronautVersion=3.2.6
\ No newline at end of file
diff --git a/samples/client/petstore/java-micronaut-client/pom.xml b/samples/client/petstore/java-micronaut-client/pom.xml
index c64bc3bb07..89a43adef3 100644
--- a/samples/client/petstore/java-micronaut-client/pom.xml
+++ b/samples/client/petstore/java-micronaut-client/pom.xml
@@ -10,7 +10,7 @@
io.micronaut
micronaut-parent
- 3.0.0-M5
+ 3.2.6
@@ -18,7 +18,7 @@
1.8
- 3.0.0-M5
+ 3.2.6
org.openapitools.Application
netty
1.5.21
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/AnotherFakeApi.java
index 09c1c9fb39..26e3afaff5 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/AnotherFakeApi.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/AnotherFakeApi.java
@@ -15,7 +15,6 @@ package org.openapitools.api;
import io.micronaut.http.annotation.*;
import io.micronaut.core.annotation.*;
import io.micronaut.http.client.annotation.Client;
-import org.openapitools.query.QueryParam;
import io.micronaut.core.convert.format.Format;
import reactor.core.publisher.Mono;
import org.openapitools.model.ModelClient;
@@ -31,18 +30,17 @@ import javax.validation.constraints.*;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Client("${base-path}")
public interface AnotherFakeApi {
-
- /**
- * To test special tags
- * To test special tags and operation ID starting with number
- *
- * @param _body client model (required)
- * @return ModelClient
- */
- @Patch(uri="/another-fake/dummy")
- @Produces(value={"application/json"})
- @Consumes(value={"application/json"})
- Mono call123testSpecialTags(
- @Body @Valid @NotNull ModelClient _body
+ /**
+ * To test special tags
+ * To test special tags and operation ID starting with number
+ *
+ * @param _body client model (required)
+ * @return ModelClient
+ */
+ @Patch(uri="/another-fake/dummy")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono call123testSpecialTags(
+ @Body @NotNull @Valid ModelClient _body
);
}
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeApi.java
index 1a5913a842..7f5970b69a 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeApi.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeApi.java
@@ -15,7 +15,6 @@ package org.openapitools.api;
import io.micronaut.http.annotation.*;
import io.micronaut.core.annotation.*;
import io.micronaut.http.client.annotation.Client;
-import org.openapitools.query.QueryParam;
import io.micronaut.core.convert.format.Format;
import reactor.core.publisher.Mono;
import java.math.BigDecimal;
@@ -39,242 +38,228 @@ import javax.validation.constraints.*;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Client("${base-path}")
public interface FakeApi {
-
- /**
- * creates an XmlItem
- * this route creates an XmlItem
- *
- * @param xmlItem XmlItem Body (required)
- */
- @Post(uri="/fake/create_xml_item")
- @Produces(value={"application/xml"})
- @Consumes(value={"application/json"})
- Mono createXmlItem(
- @Body @Valid @NotNull XmlItem xmlItem
+ /**
+ * creates an XmlItem
+ * this route creates an XmlItem
+ *
+ * @param xmlItem XmlItem Body (required)
+ */
+ @Post(uri="/fake/create_xml_item")
+ @Produces(value={"application/xml"})
+ @Consumes(value={"application/json"})
+ Mono createXmlItem(
+ @Body @NotNull @Valid XmlItem xmlItem
);
-
- /**
- * Test serialization of outer boolean types
- *
- * @param _body Input boolean as post body (optional)
- * @return Boolean
- */
- @Post(uri="/fake/outer/boolean")
- @Produces(value={"*/*"})
- @Consumes(value={"*/*"})
- Mono fakeOuterBooleanSerialize(
- @Body Boolean _body
+ /**
+ * Test serialization of outer boolean types
+ *
+ * @param _body Input boolean as post body (optional)
+ * @return Boolean
+ */
+ @Post(uri="/fake/outer/boolean")
+ @Produces(value={"application/json"})
+ @Consumes(value={"*/*"})
+ Mono fakeOuterBooleanSerialize(
+ @Body @Nullable Boolean _body
);
-
- /**
- * Test serialization of object with outer number type
- *
- * @param _body Input composite as post body (optional)
- * @return OuterComposite
- */
- @Post(uri="/fake/outer/composite")
- @Produces(value={"*/*"})
- @Consumes(value={"*/*"})
- Mono fakeOuterCompositeSerialize(
- @Body @Valid OuterComposite _body
+ /**
+ * Test serialization of object with outer number type
+ *
+ * @param _body Input composite as post body (optional)
+ * @return OuterComposite
+ */
+ @Post(uri="/fake/outer/composite")
+ @Produces(value={"application/json"})
+ @Consumes(value={"*/*"})
+ Mono fakeOuterCompositeSerialize(
+ @Body @Nullable @Valid OuterComposite _body
);
-
- /**
- * Test serialization of outer number types
- *
- * @param _body Input number as post body (optional)
- * @return BigDecimal
- */
- @Post(uri="/fake/outer/number")
- @Produces(value={"*/*"})
- @Consumes(value={"*/*"})
- Mono fakeOuterNumberSerialize(
- @Body BigDecimal _body
+ /**
+ * Test serialization of outer number types
+ *
+ * @param _body Input number as post body (optional)
+ * @return BigDecimal
+ */
+ @Post(uri="/fake/outer/number")
+ @Produces(value={"application/json"})
+ @Consumes(value={"*/*"})
+ Mono fakeOuterNumberSerialize(
+ @Body @Nullable BigDecimal _body
);
-
- /**
- * Test serialization of outer string types
- *
- * @param _body Input string as post body (optional)
- * @return String
- */
- @Post(uri="/fake/outer/string")
- @Produces(value={"*/*"})
- @Consumes(value={"*/*"})
- Mono fakeOuterStringSerialize(
- @Body String _body
+ /**
+ * Test serialization of outer string types
+ *
+ * @param _body Input string as post body (optional)
+ * @return String
+ */
+ @Post(uri="/fake/outer/string")
+ @Produces(value={"application/json"})
+ @Consumes(value={"*/*"})
+ Mono fakeOuterStringSerialize(
+ @Body @Nullable String _body
);
-
- /**
- * For this test, the body for this request much reference a schema named `File`.
- *
- * @param _body (required)
- */
- @Put(uri="/fake/body-with-file-schema")
- @Produces(value={"application/json"})
- @Consumes(value={"application/json"})
- Mono testBodyWithFileSchema(
- @Body @Valid @NotNull FileSchemaTestClass _body
+ /**
+ * For this test, the body for this request much reference a schema named `File`.
+ *
+ * @param _body (required)
+ */
+ @Put(uri="/fake/body-with-file-schema")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono testBodyWithFileSchema(
+ @Body @NotNull @Valid FileSchemaTestClass _body
);
-
- /**
- * testBodyWithQueryParams
- *
- * @param query (required)
- * @param _body (required)
- */
- @Put(uri="/fake/body-with-query-params")
- @Produces(value={"application/json"})
- @Consumes(value={"application/json"})
- Mono testBodyWithQueryParams(
- @QueryParam(name="query") @NotNull String query,
- @Body @Valid @NotNull User _body
+ /**
+ * testBodyWithQueryParams
+ *
+ * @param query (required)
+ * @param _body (required)
+ */
+ @Put(uri="/fake/body-with-query-params")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono testBodyWithQueryParams(
+ @QueryValue(value="query") @NotNull String query,
+ @Body @NotNull @Valid User _body
);
-
- /**
- * To test \"client\" model
- * To test \"client\" model
- *
- * @param _body client model (required)
- * @return ModelClient
- */
- @Patch(uri="/fake")
- @Produces(value={"application/json"})
- @Consumes(value={"application/json"})
- Mono testClientModel(
- @Body @Valid @NotNull ModelClient _body
+ /**
+ * To test \"client\" model
+ * To test \"client\" model
+ *
+ * @param _body client model (required)
+ * @return ModelClient
+ */
+ @Patch(uri="/fake")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono testClientModel(
+ @Body @NotNull @Valid ModelClient _body
);
-
- /**
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- *
- * @param number None (required)
- * @param _double None (required)
- * @param patternWithoutDelimiter None (required)
- * @param _byte None (required)
- * @param integer None (optional)
- * @param int32 None (optional)
- * @param int64 None (optional)
- * @param _float None (optional)
- * @param string None (optional)
- * @param binary None (optional)
- * @param date None (optional)
- * @param dateTime None (optional)
- * @param password None (optional)
- * @param paramCallback None (optional)
- */
- @Post(uri="/fake")
- @Produces(value={"application/x-www-form-urlencoded"})
- @Consumes(value={"application/json"})
- Mono testEndpointParameters(
+ /**
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ *
+ * @param number None (required)
+ * @param _double None (required)
+ * @param patternWithoutDelimiter None (required)
+ * @param _byte None (required)
+ * @param integer None (optional)
+ * @param int32 None (optional)
+ * @param int64 None (optional)
+ * @param _float None (optional)
+ * @param string None (optional)
+ * @param binary None (optional)
+ * @param date None (optional)
+ * @param dateTime None (optional)
+ * @param password None (optional)
+ * @param paramCallback None (optional)
+ */
+ @Post(uri="/fake")
+ @Produces(value={"application/x-www-form-urlencoded"})
+ @Consumes(value={"application/json"})
+ Mono testEndpointParameters(
@NotNull @DecimalMin("32.1") @DecimalMax("543.2") BigDecimal number,
@NotNull @DecimalMin("67.8") @DecimalMax("123.4") Double _double,
@NotNull @Pattern(regexp="^[A-Z].*") String patternWithoutDelimiter,
@NotNull byte[] _byte,
- @Min(10) @Max(100) Integer integer,
- @Min(20) @Max(200) Integer int32,
- Long int64,
- @DecimalMax("987.6") Float _float,
- @Pattern(regexp="/[a-z]/i") String string,
- File binary,
- @Format("yyyy-MM-dd") LocalDate date,
- @Format("yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") LocalDateTime dateTime,
- @Size(min=10, max=64) String password,
- String paramCallback
+ @Nullable @Min(10) @Max(100) Integer integer,
+ @Nullable @Min(20) @Max(200) Integer int32,
+ @Nullable Long int64,
+ @Nullable @DecimalMax("987.6") Float _float,
+ @Nullable @Pattern(regexp="/[a-z]/i") String string,
+ @Nullable File binary,
+ @Nullable @Format("yyyy-MM-dd") LocalDate date,
+ @Nullable @Format("yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") LocalDateTime dateTime,
+ @Nullable @Size(min=10, max=64) String password,
+ @Nullable String paramCallback
);
-
- /**
- * To test enum parameters
- * To test enum parameters
- *
- * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
- * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
- * @param enumQueryStringArray Query parameter enum test (string array) (optional)
- * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
- * @param enumQueryInteger Query parameter enum test (double) (optional)
- * @param enumQueryDouble Query parameter enum test (double) (optional)
- * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
- * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
- */
- @Get(uri="/fake")
- @Produces(value={"application/x-www-form-urlencoded"})
- @Consumes(value={"application/json"})
- Mono testEnumParameters(
- @Header(name="enum_header_string_array") List enumHeaderStringArray,
- @Header(name="enum_header_string", defaultValue="-efg") String enumHeaderString,
- @QueryParam(name="enum_query_string_array", format=QueryParam.Format.CSV) List enumQueryStringArray,
- @QueryParam(name="enum_query_string", defaultValue="-efg") String enumQueryString,
- @QueryParam(name="enum_query_integer") Integer enumQueryInteger,
- @QueryParam(name="enum_query_double") Double enumQueryDouble,
- List enumFormStringArray,
- String enumFormString
+ /**
+ * To test enum parameters
+ * To test enum parameters
+ *
+ * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
+ * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryStringArray Query parameter enum test (string array) (optional)
+ * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryInteger Query parameter enum test (double) (optional)
+ * @param enumQueryDouble Query parameter enum test (double) (optional)
+ * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
+ * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
+ */
+ @Get(uri="/fake")
+ @Produces(value={"application/x-www-form-urlencoded"})
+ @Consumes(value={"application/json"})
+ Mono testEnumParameters(
+ @Header(name="enum_header_string_array") @Nullable List enumHeaderStringArray,
+ @Header(name="enum_header_string", defaultValue="-efg") @Nullable String enumHeaderString,
+ @QueryValue(value="enum_query_string_array") @Nullable List enumQueryStringArray,
+ @QueryValue(value="enum_query_string", defaultValue="-efg") @Nullable String enumQueryString,
+ @QueryValue(value="enum_query_integer") @Nullable Integer enumQueryInteger,
+ @QueryValue(value="enum_query_double") @Nullable Double enumQueryDouble,
+ @Nullable List enumFormStringArray,
+ @Nullable String enumFormString
);
-
- /**
- * Fake endpoint to test group parameters (optional)
- * Fake endpoint to test group parameters (optional)
- *
- * @param requiredStringGroup Required String in group parameters (required)
- * @param requiredBooleanGroup Required Boolean in group parameters (required)
- * @param requiredInt64Group Required Integer in group parameters (required)
- * @param stringGroup String in group parameters (optional)
- * @param booleanGroup Boolean in group parameters (optional)
- * @param int64Group Integer in group parameters (optional)
- */
- @Delete(uri="/fake")
- @Consumes(value={"application/json"})
- Mono testGroupParameters(
- @QueryParam(name="required_string_group") @NotNull Integer requiredStringGroup,
+ /**
+ * Fake endpoint to test group parameters (optional)
+ * Fake endpoint to test group parameters (optional)
+ *
+ * @param requiredStringGroup Required String in group parameters (required)
+ * @param requiredBooleanGroup Required Boolean in group parameters (required)
+ * @param requiredInt64Group Required Integer in group parameters (required)
+ * @param stringGroup String in group parameters (optional)
+ * @param booleanGroup Boolean in group parameters (optional)
+ * @param int64Group Integer in group parameters (optional)
+ */
+ @Delete(uri="/fake")
+ @Consumes(value={"application/json"})
+ Mono testGroupParameters(
+ @QueryValue(value="required_string_group") @NotNull Integer requiredStringGroup,
@Header(name="required_boolean_group") @NotNull Boolean requiredBooleanGroup,
- @QueryParam(name="required_int64_group") @NotNull Long requiredInt64Group,
- @QueryParam(name="string_group") Integer stringGroup,
- @Header(name="boolean_group") Boolean booleanGroup,
- @QueryParam(name="int64_group") Long int64Group
+ @QueryValue(value="required_int64_group") @NotNull Long requiredInt64Group,
+ @QueryValue(value="string_group") @Nullable Integer stringGroup,
+ @Header(name="boolean_group") @Nullable Boolean booleanGroup,
+ @QueryValue(value="int64_group") @Nullable Long int64Group
);
-
- /**
- * test inline additionalProperties
- *
- * @param param request body (required)
- */
- @Post(uri="/fake/inline-additionalProperties")
- @Produces(value={"application/json"})
- @Consumes(value={"application/json"})
- Mono testInlineAdditionalProperties(
+ /**
+ * test inline additionalProperties
+ *
+ * @param param request body (required)
+ */
+ @Post(uri="/fake/inline-additionalProperties")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono testInlineAdditionalProperties(
@Body @NotNull Map param
);
-
- /**
- * test json serialization of form data
- *
- * @param param field1 (required)
- * @param param2 field2 (required)
- */
- @Get(uri="/fake/jsonFormData")
- @Produces(value={"application/x-www-form-urlencoded"})
- @Consumes(value={"application/json"})
- Mono testJsonFormData(
+ /**
+ * test json serialization of form data
+ *
+ * @param param field1 (required)
+ * @param param2 field2 (required)
+ */
+ @Get(uri="/fake/jsonFormData")
+ @Produces(value={"application/x-www-form-urlencoded"})
+ @Consumes(value={"application/json"})
+ Mono testJsonFormData(
@NotNull String param,
@NotNull String param2
);
-
- /**
- * To test the collection format in query parameters
- *
- * @param pipe (required)
- * @param ioutil (required)
- * @param http (required)
- * @param url (required)
- * @param context (required)
- */
- @Put(uri="/fake/test-query-parameters")
- @Consumes(value={"application/json"})
- Mono testQueryParameterCollectionFormat(
- @QueryParam(name="pipe", format=QueryParam.Format.CSV) @NotNull List pipe,
- @QueryParam(name="ioutil", format=QueryParam.Format.CSV) @NotNull List ioutil,
- @QueryParam(name="http", format=QueryParam.Format.SSV) @NotNull List http,
- @QueryParam(name="url", format=QueryParam.Format.CSV) @NotNull List url,
- @QueryParam(name="context", format=QueryParam.Format.MULTI) @NotNull List context
+ /**
+ * To test the collection format in query parameters
+ *
+ * @param pipe (required)
+ * @param ioutil (required)
+ * @param http (required)
+ * @param url (required)
+ * @param context (required)
+ */
+ @Put(uri="/fake/test-query-parameters")
+ @Consumes(value={"application/json"})
+ Mono testQueryParameterCollectionFormat(
+ @QueryValue(value="pipe") @NotNull List pipe,
+ @QueryValue(value="ioutil") @NotNull List ioutil,
+ @QueryValue(value="http") @NotNull List http,
+ @QueryValue(value="url") @NotNull List url,
+ @QueryValue(value="context") @NotNull List context
);
}
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java
index e586776bc7..5b96586217 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java
@@ -15,7 +15,6 @@ package org.openapitools.api;
import io.micronaut.http.annotation.*;
import io.micronaut.core.annotation.*;
import io.micronaut.http.client.annotation.Client;
-import org.openapitools.query.QueryParam;
import io.micronaut.core.convert.format.Format;
import reactor.core.publisher.Mono;
import org.openapitools.model.ModelClient;
@@ -31,18 +30,17 @@ import javax.validation.constraints.*;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Client("${base-path}")
public interface FakeClassnameTags123Api {
-
- /**
- * To test class name in snake case
- * To test class name in snake case
- *
- * @param _body client model (required)
- * @return ModelClient
- */
- @Patch(uri="/fake_classname_test")
- @Produces(value={"application/json"})
- @Consumes(value={"application/json"})
- Mono testClassname(
- @Body @Valid @NotNull ModelClient _body
+ /**
+ * To test class name in snake case
+ * To test class name in snake case
+ *
+ * @param _body client model (required)
+ * @return ModelClient
+ */
+ @Patch(uri="/fake_classname_test")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono testClassname(
+ @Body @NotNull @Valid ModelClient _body
);
}
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/PetApi.java
index 538f7eb80f..a49acded58 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/PetApi.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/PetApi.java
@@ -15,7 +15,6 @@ package org.openapitools.api;
import io.micronaut.http.annotation.*;
import io.micronaut.core.annotation.*;
import io.micronaut.http.client.annotation.Client;
-import org.openapitools.query.QueryParam;
import io.micronaut.core.convert.format.Format;
import reactor.core.publisher.Mono;
import java.io.File;
@@ -34,130 +33,121 @@ import javax.validation.constraints.*;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Client("${base-path}")
public interface PetApi {
-
- /**
- * Add a new pet to the store
- *
- * @param _body Pet object that needs to be added to the store (required)
- */
- @Post(uri="/pet")
- @Produces(value={"application/json"})
- @Consumes(value={"application/json"})
- Mono addPet(
- @Body @Valid @NotNull Pet _body
+ /**
+ * Add a new pet to the store
+ *
+ * @param _body Pet object that needs to be added to the store (required)
+ */
+ @Post(uri="/pet")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono addPet(
+ @Body @NotNull @Valid Pet _body
);
-
- /**
- * Deletes a pet
- *
- * @param petId Pet id to delete (required)
- * @param apiKey (optional)
- */
- @Delete(uri="/pet/{petId}")
- @Consumes(value={"application/json"})
- Mono deletePet(
+ /**
+ * Deletes a pet
+ *
+ * @param petId Pet id to delete (required)
+ * @param apiKey (optional)
+ */
+ @Delete(uri="/pet/{petId}")
+ @Consumes(value={"application/json"})
+ Mono deletePet(
@PathVariable(name="petId") @NotNull Long petId,
- @Header(name="api_key") String apiKey
+ @Header(name="api_key") @Nullable String apiKey
);
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- *
- * @param status Status values that need to be considered for filter (required)
- * @return List<Pet>
- */
- @Get(uri="/pet/findByStatus")
- @Consumes(value={"application/json"})
- Mono> findPetsByStatus(
- @QueryParam(name="status", format=QueryParam.Format.CSV) @NotNull List status
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ *
+ * @param status Status values that need to be considered for filter (required)
+ * @return List<Pet>
+ */
+ @Get(uri="/pet/findByStatus")
+ @Consumes(value={"application/json"})
+ Mono> findPetsByStatus(
+ @QueryValue(value="status") @NotNull List status
);
-
- /**
- * Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- *
- * @param tags Tags to filter by (required)
- * @return Set<Pet>
- */
- @Get(uri="/pet/findByTags")
- @Consumes(value={"application/json"})
- Mono> findPetsByTags(
- @QueryParam(name="tags", format=QueryParam.Format.CSV) @NotNull Set tags
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ *
+ * @param tags Tags to filter by (required)
+ * @return Set<Pet>
+ */
+ @Get(uri="/pet/findByTags")
+ @Consumes(value={"application/json"})
+ Mono> findPetsByTags(
+ @QueryValue(value="tags") @NotNull Set tags
);
-
- /**
- * Find pet by ID
- * Returns a single pet
- *
- * @param petId ID of pet to return (required)
- * @return Pet
- */
- @Get(uri="/pet/{petId}")
- @Consumes(value={"application/json"})
- Mono getPetById(
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ *
+ * @param petId ID of pet to return (required)
+ * @return Pet
+ */
+ @Get(uri="/pet/{petId}")
+ @Consumes(value={"application/json"})
+ Mono getPetById(
@PathVariable(name="petId") @NotNull Long petId
);
-
- /**
- * Update an existing pet
- *
- * @param _body Pet object that needs to be added to the store (required)
- */
- @Put(uri="/pet")
- @Produces(value={"application/json"})
- @Consumes(value={"application/json"})
- Mono updatePet(
- @Body @Valid @NotNull Pet _body
+ /**
+ * Update an existing pet
+ *
+ * @param _body Pet object that needs to be added to the store (required)
+ */
+ @Put(uri="/pet")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono updatePet(
+ @Body @NotNull @Valid Pet _body
);
-
- /**
- * Updates a pet in the store with form data
- *
- * @param petId ID of pet that needs to be updated (required)
- * @param name Updated name of the pet (optional)
- * @param status Updated status of the pet (optional)
- */
- @Post(uri="/pet/{petId}")
- @Produces(value={"application/x-www-form-urlencoded"})
- @Consumes(value={"application/json"})
- Mono updatePetWithForm(
+ /**
+ * Updates a pet in the store with form data
+ *
+ * @param petId ID of pet that needs to be updated (required)
+ * @param name Updated name of the pet (optional)
+ * @param status Updated status of the pet (optional)
+ */
+ @Post(uri="/pet/{petId}")
+ @Produces(value={"application/x-www-form-urlencoded"})
+ @Consumes(value={"application/json"})
+ Mono updatePetWithForm(
@PathVariable(name="petId") @NotNull Long petId,
- String name,
- String status
+ @Nullable String name,
+ @Nullable String status
);
-
- /**
- * uploads an image
- *
- * @param petId ID of pet to update (required)
- * @param additionalMetadata Additional data to pass to server (optional)
- * @param _file file to upload (optional)
- * @return ModelApiResponse
- */
- @Post(uri="/pet/{petId}/uploadImage")
- @Produces(value={"multipart/form-data"})
- @Consumes(value={"application/json"})
- Mono uploadFile(
+ /**
+ * uploads an image
+ *
+ * @param petId ID of pet to update (required)
+ * @param additionalMetadata Additional data to pass to server (optional)
+ * @param _file file to upload (optional)
+ * @return ModelApiResponse
+ */
+ @Post(uri="/pet/{petId}/uploadImage")
+ @Produces(value={"multipart/form-data"})
+ @Consumes(value={"application/json"})
+ Mono uploadFile(
@PathVariable(name="petId") @NotNull Long petId,
- String additionalMetadata,
- File _file
+ @Nullable String additionalMetadata,
+ @Nullable File _file
);
-
- /**
- * uploads an image (required)
- *
- * @param petId ID of pet to update (required)
- * @param requiredFile file to upload (required)
- * @param additionalMetadata Additional data to pass to server (optional)
- * @return ModelApiResponse
- */
- @Post(uri="/fake/{petId}/uploadImageWithRequiredFile")
- @Produces(value={"multipart/form-data"})
- @Consumes(value={"application/json"})
- Mono uploadFileWithRequiredFile(
+ /**
+ * uploads an image (required)
+ *
+ * @param petId ID of pet to update (required)
+ * @param requiredFile file to upload (required)
+ * @param additionalMetadata Additional data to pass to server (optional)
+ * @return ModelApiResponse
+ */
+ @Post(uri="/fake/{petId}/uploadImageWithRequiredFile")
+ @Produces(value={"multipart/form-data"})
+ @Consumes(value={"application/json"})
+ Mono uploadFileWithRequiredFile(
@PathVariable(name="petId") @NotNull Long petId,
@NotNull File requiredFile,
- String additionalMetadata
+ @Nullable String additionalMetadata
);
}
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/StoreApi.java
index 5a0bb8af78..36ccca3553 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/StoreApi.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/StoreApi.java
@@ -15,7 +15,6 @@ package org.openapitools.api;
import io.micronaut.http.annotation.*;
import io.micronaut.core.annotation.*;
import io.micronaut.http.client.annotation.Client;
-import org.openapitools.query.QueryParam;
import io.micronaut.core.convert.format.Format;
import reactor.core.publisher.Mono;
import org.openapitools.model.Order;
@@ -31,52 +30,48 @@ import javax.validation.constraints.*;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Client("${base-path}")
public interface StoreApi {
-
- /**
- * Delete purchase order by ID
- * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- *
- * @param orderId ID of the order that needs to be deleted (required)
- */
- @Delete(uri="/store/order/{order_id}")
- @Consumes(value={"application/json"})
- Mono deleteOrder(
+ /**
+ * Delete purchase order by ID
+ * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ *
+ * @param orderId ID of the order that needs to be deleted (required)
+ */
+ @Delete(uri="/store/order/{order_id}")
+ @Consumes(value={"application/json"})
+ Mono deleteOrder(
@PathVariable(name="order_id") @NotNull String orderId
);
-
- /**
- * Returns pet inventories by status
- * Returns a map of status codes to quantities
- *
- * @return Map<String, Integer>
- */
- @Get(uri="/store/inventory")
- @Consumes(value={"application/json"})
- Mono> getInventory();
-
- /**
- * Find purchase order by ID
- * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- *
- * @param orderId ID of pet that needs to be fetched (required)
- * @return Order
- */
- @Get(uri="/store/order/{order_id}")
- @Consumes(value={"application/json"})
- Mono getOrderById(
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ *
+ * @return Map<String, Integer>
+ */
+ @Get(uri="/store/inventory")
+ @Consumes(value={"application/json"})
+ Mono> getInventory();
+ /**
+ * Find purchase order by ID
+ * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ *
+ * @param orderId ID of pet that needs to be fetched (required)
+ * @return Order
+ */
+ @Get(uri="/store/order/{order_id}")
+ @Consumes(value={"application/json"})
+ Mono getOrderById(
@PathVariable(name="order_id") @NotNull @Min(1L) @Max(5L) Long orderId
);
-
- /**
- * Place an order for a pet
- *
- * @param _body order placed for purchasing the pet (required)
- * @return Order
- */
- @Post(uri="/store/order")
- @Produces(value={"*/*"})
- @Consumes(value={"application/json"})
- Mono placeOrder(
- @Body @Valid @NotNull Order _body
+ /**
+ * Place an order for a pet
+ *
+ * @param _body order placed for purchasing the pet (required)
+ * @return Order
+ */
+ @Post(uri="/store/order")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono placeOrder(
+ @Body @NotNull @Valid Order _body
);
}
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java
index 6e608808a7..8fa12ce923 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java
@@ -15,7 +15,6 @@ package org.openapitools.api;
import io.micronaut.http.annotation.*;
import io.micronaut.core.annotation.*;
import io.micronaut.http.client.annotation.Client;
-import org.openapitools.query.QueryParam;
import io.micronaut.core.convert.format.Format;
import reactor.core.publisher.Mono;
import java.time.LocalDateTime;
@@ -32,102 +31,94 @@ import javax.validation.constraints.*;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Client("${base-path}")
public interface UserApi {
-
- /**
- * Create user
- * This can only be done by the logged in user.
- *
- * @param _body Created user object (required)
- */
- @Post(uri="/user")
- @Produces(value={"*/*"})
- @Consumes(value={"application/json"})
- Mono createUser(
- @Body @Valid @NotNull User _body
+ /**
+ * Create user
+ * This can only be done by the logged in user.
+ *
+ * @param _body Created user object (required)
+ */
+ @Post(uri="/user")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono createUser(
+ @Body @NotNull @Valid User _body
);
-
- /**
- * Creates list of users with given input array
- *
- * @param _body List of user object (required)
- */
- @Post(uri="/user/createWithArray")
- @Produces(value={"*/*"})
- @Consumes(value={"application/json"})
- Mono createUsersWithArrayInput(
+ /**
+ * Creates list of users with given input array
+ *
+ * @param _body List of user object (required)
+ */
+ @Post(uri="/user/createWithArray")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono createUsersWithArrayInput(
@Body @NotNull List _body
);
-
- /**
- * Creates list of users with given input array
- *
- * @param _body List of user object (required)
- */
- @Post(uri="/user/createWithList")
- @Produces(value={"*/*"})
- @Consumes(value={"application/json"})
- Mono createUsersWithListInput(
+ /**
+ * Creates list of users with given input array
+ *
+ * @param _body List of user object (required)
+ */
+ @Post(uri="/user/createWithList")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono createUsersWithListInput(
@Body @NotNull List _body
);
-
- /**
- * Delete user
- * This can only be done by the logged in user.
- *
- * @param username The name that needs to be deleted (required)
- */
- @Delete(uri="/user/{username}")
- @Consumes(value={"application/json"})
- Mono deleteUser(
+ /**
+ * Delete user
+ * This can only be done by the logged in user.
+ *
+ * @param username The name that needs to be deleted (required)
+ */
+ @Delete(uri="/user/{username}")
+ @Consumes(value={"application/json"})
+ Mono deleteUser(
@PathVariable(name="username") @NotNull String username
);
-
- /**
- * Get user by user name
- *
- * @param username The name that needs to be fetched. Use user1 for testing. (required)
- * @return User
- */
- @Get(uri="/user/{username}")
- @Consumes(value={"application/json"})
- Mono getUserByName(
+ /**
+ * Get user by user name
+ *
+ * @param username The name that needs to be fetched. Use user1 for testing. (required)
+ * @return User
+ */
+ @Get(uri="/user/{username}")
+ @Consumes(value={"application/json"})
+ Mono getUserByName(
@PathVariable(name="username") @NotNull String username
);
-
- /**
- * Logs user into the system
- *
- * @param username The user name for login (required)
- * @param password The password for login in clear text (required)
- * @return String
- */
- @Get(uri="/user/login")
- @Consumes(value={"application/json"})
- Mono loginUser(
- @QueryParam(name="username") @NotNull String username,
- @QueryParam(name="password") @NotNull String password
+ /**
+ * Logs user into the system
+ *
+ * @param username The user name for login (required)
+ * @param password The password for login in clear text (required)
+ * @return String
+ */
+ @Get(uri="/user/login")
+ @Consumes(value={"application/json"})
+ Mono loginUser(
+ @QueryValue(value="username") @NotNull String username,
+ @QueryValue(value="password") @NotNull String password
);
-
- /**
- * Logs out current logged in user session
- *
- */
- @Get(uri="/user/logout")
- @Consumes(value={"application/json"})
- Mono logoutUser();
-
- /**
- * Updated user
- * This can only be done by the logged in user.
- *
- * @param username name that need to be deleted (required)
- * @param _body Updated user object (required)
- */
- @Put(uri="/user/{username}")
- @Produces(value={"*/*"})
- @Consumes(value={"application/json"})
- Mono updateUser(
+ /**
+ * Logs out current logged in user session
+ *
+ */
+ @Get(uri="/user/logout")
+ @Consumes(value={"application/json"})
+ Mono logoutUser();
+ /**
+ * Updated user
+ * This can only be done by the logged in user.
+ *
+ * @param username name that need to be deleted (required)
+ * @param _body Updated user object (required)
+ */
+ @Put(uri="/user/{username}")
+ @Produces(value={"application/json"})
+ @Consumes(value={"application/json"})
+ Mono updateUser(
@PathVariable(name="username") @NotNull String username,
- @Body @Valid @NotNull User _body
+ @Body @NotNull @Valid User _body
);
}
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
index c727e3389a..96ce13164e 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
@@ -35,69 +35,72 @@ import javax.annotation.Generated;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Introspected
public class AdditionalPropertiesAnyType extends HashMap {
- public static final String JSON_PROPERTY_NAME = "name";
- private String name;
+ public static final String JSON_PROPERTY_NAME = "name";
+ private String name;
- public AdditionalPropertiesAnyType name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_NAME)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public String getName() {
- return name;
- }
-
- @JsonProperty(JSON_PROPERTY_NAME)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
+ public AdditionalPropertiesAnyType() {
+ super();
}
- if (o == null || getClass() != o.getClass()) {
- return false;
+ public AdditionalPropertiesAnyType name(String name) {
+ this.name = name;
+ return this;
}
- AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
- return Objects.equals(this.name, additionalPropertiesAnyType.name) &&
- super.equals(o);
- }
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesAnyType {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
+ /**
+ * Get name
+ * @return name
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getName() {
+ return name;
+ }
+
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
+ return Objects.equals(this.name, additionalPropertiesAnyType.name) &&
+ super.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, super.hashCode());
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class AdditionalPropertiesAnyType {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
}
- return o.toString().replace("\n", "\n ");
- }
}
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
index 749c516be0..107272b74d 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
@@ -36,69 +36,72 @@ import javax.annotation.Generated;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Introspected
public class AdditionalPropertiesArray extends HashMap {
- public static final String JSON_PROPERTY_NAME = "name";
- private String name;
+ public static final String JSON_PROPERTY_NAME = "name";
+ private String name;
- public AdditionalPropertiesArray name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_NAME)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public String getName() {
- return name;
- }
-
- @JsonProperty(JSON_PROPERTY_NAME)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
+ public AdditionalPropertiesArray() {
+ super();
}
- if (o == null || getClass() != o.getClass()) {
- return false;
+ public AdditionalPropertiesArray name(String name) {
+ this.name = name;
+ return this;
}
- AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
- return Objects.equals(this.name, additionalPropertiesArray.name) &&
- super.equals(o);
- }
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesArray {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
+ /**
+ * Get name
+ * @return name
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getName() {
+ return name;
+ }
+
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
+ return Objects.equals(this.name, additionalPropertiesArray.name) &&
+ super.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, super.hashCode());
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class AdditionalPropertiesArray {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
}
- return o.toString().replace("\n", "\n ");
- }
}
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
index 859739c31a..cfdb8791d0 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
@@ -35,69 +35,72 @@ import javax.annotation.Generated;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Introspected
public class AdditionalPropertiesBoolean extends HashMap {
- public static final String JSON_PROPERTY_NAME = "name";
- private String name;
+ public static final String JSON_PROPERTY_NAME = "name";
+ private String name;
- public AdditionalPropertiesBoolean name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_NAME)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public String getName() {
- return name;
- }
-
- @JsonProperty(JSON_PROPERTY_NAME)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
+ public AdditionalPropertiesBoolean() {
+ super();
}
- if (o == null || getClass() != o.getClass()) {
- return false;
+ public AdditionalPropertiesBoolean name(String name) {
+ this.name = name;
+ return this;
}
- AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
- return Objects.equals(this.name, additionalPropertiesBoolean.name) &&
- super.equals(o);
- }
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesBoolean {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
+ /**
+ * Get name
+ * @return name
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getName() {
+ return name;
+ }
+
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
+ return Objects.equals(this.name, additionalPropertiesBoolean.name) &&
+ super.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, super.hashCode());
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class AdditionalPropertiesBoolean {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
}
- return o.toString().replace("\n", "\n ");
- }
}
diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
index aef32243b4..8e130aca02 100644
--- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
+++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
@@ -47,411 +47,413 @@ import javax.annotation.Generated;
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
@Introspected
public class AdditionalPropertiesClass {
- public static final String JSON_PROPERTY_MAP_STRING = "map_string";
- private Map mapString = null;
+ public static final String JSON_PROPERTY_MAP_STRING = "map_string";
+ private Map mapString = null;
- public static final String JSON_PROPERTY_MAP_NUMBER = "map_number";
- private Map mapNumber = null;
+ public static final String JSON_PROPERTY_MAP_NUMBER = "map_number";
+ private Map mapNumber = null;
- public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer";
- private Map mapInteger = null;
+ public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer";
+ private Map mapInteger = null;
- public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean";
- private Map mapBoolean = null;
+ public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean";
+ private Map mapBoolean = null;
- public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer";
- private Map> mapArrayInteger = null;
+ public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer";
+ private Map> mapArrayInteger = null;
- public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype";
- private Map> mapArrayAnytype = null;
+ public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype";
+ private Map> mapArrayAnytype = null;
- public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string";
- private Map> mapMapString = null;
+ public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string";
+ private Map> mapMapString = null;
- public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype";
- private Map> mapMapAnytype = null;
+ public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype";
+ private Map> mapMapAnytype = null;
- public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
- private Object anytype1;
+ public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
+ private Object anytype1;
- public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2";
- private Object anytype2;
+ public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2";
+ private Object anytype2;
- public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3";
- private Object anytype3;
+ public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3";
+ private Object anytype3;
- public AdditionalPropertiesClass mapString(Map mapString) {
- this.mapString = mapString;
- return this;
- }
-
- public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
- if (this.mapString == null) {
- this.mapString = new HashMap();
+ public AdditionalPropertiesClass() {
}
- this.mapString.put(key, mapStringItem);
- return this;
- }
-
- /**
- * Get mapString
- * @return mapString
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_MAP_STRING)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Map getMapString() {
- return mapString;
- }
-
- @JsonProperty(JSON_PROPERTY_MAP_STRING)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setMapString(Map mapString) {
- this.mapString = mapString;
- }
-
- public AdditionalPropertiesClass mapNumber(Map mapNumber) {
- this.mapNumber = mapNumber;
- return this;
- }
-
- public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
- if (this.mapNumber == null) {
- this.mapNumber = new HashMap();
+ public AdditionalPropertiesClass mapString(Map mapString) {
+ this.mapString = mapString;
+ return this;
}
- this.mapNumber.put(key, mapNumberItem);
- return this;
+
+ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
+ if (this.mapString == null) {
+ this.mapString = new HashMap();
+ }
+ this.mapString.put(key, mapStringItem);
+ return this;
}
- /**
- * Get mapNumber
- * @return mapNumber
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_MAP_NUMBER)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Map getMapNumber() {
- return mapNumber;
- }
-
- @JsonProperty(JSON_PROPERTY_MAP_NUMBER)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setMapNumber(Map mapNumber) {
- this.mapNumber = mapNumber;
- }
-
- public AdditionalPropertiesClass mapInteger(Map mapInteger) {
- this.mapInteger = mapInteger;
- return this;
- }
-
- public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
- if (this.mapInteger == null) {
- this.mapInteger = new HashMap();
+ /**
+ * Get mapString
+ * @return mapString
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_MAP_STRING)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map getMapString() {
+ return mapString;
}
- this.mapInteger.put(key, mapIntegerItem);
- return this;
- }
- /**
- * Get mapInteger
- * @return mapInteger
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_MAP_INTEGER)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Map getMapInteger() {
- return mapInteger;
- }
-
- @JsonProperty(JSON_PROPERTY_MAP_INTEGER)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setMapInteger(Map mapInteger) {
- this.mapInteger = mapInteger;
- }
-
- public AdditionalPropertiesClass mapBoolean(Map mapBoolean) {
- this.mapBoolean = mapBoolean;
- return this;
- }
-
- public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
- if (this.mapBoolean == null) {
- this.mapBoolean = new HashMap();
+ @JsonProperty(JSON_PROPERTY_MAP_STRING)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMapString(Map mapString) {
+ this.mapString = mapString;
}
- this.mapBoolean.put(key, mapBooleanItem);
- return this;
- }
- /**
- * Get mapBoolean
- * @return mapBoolean
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Map getMapBoolean() {
- return mapBoolean;
- }
-
- @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setMapBoolean(Map mapBoolean) {
- this.mapBoolean = mapBoolean;
- }
-
- public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) {
- this.mapArrayInteger = mapArrayInteger;
- return this;
- }
-
- public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) {
- if (this.mapArrayInteger == null) {
- this.mapArrayInteger = new HashMap>();
+ public AdditionalPropertiesClass mapNumber(Map mapNumber) {
+ this.mapNumber = mapNumber;
+ return this;
}
- this.mapArrayInteger.put(key, mapArrayIntegerItem);
- return this;
+
+ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
+ if (this.mapNumber == null) {
+ this.mapNumber = new HashMap();
+ }
+ this.mapNumber.put(key, mapNumberItem);
+ return this;
}
- /**
- * Get mapArrayInteger
- * @return mapArrayInteger
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Map> getMapArrayInteger() {
- return mapArrayInteger;
- }
-
- @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setMapArrayInteger(Map> mapArrayInteger) {
- this.mapArrayInteger = mapArrayInteger;
- }
-
- public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) {
- this.mapArrayAnytype = mapArrayAnytype;
- return this;
- }
-
- public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) {
- if (this.mapArrayAnytype == null) {
- this.mapArrayAnytype = new HashMap>();
+ /**
+ * Get mapNumber
+ * @return mapNumber
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_MAP_NUMBER)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map getMapNumber() {
+ return mapNumber;
}
- this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
- return this;
- }
- /**
- * Get mapArrayAnytype
- * @return mapArrayAnytype
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Map> getMapArrayAnytype() {
- return mapArrayAnytype;
- }
-
- @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setMapArrayAnytype(Map> mapArrayAnytype) {
- this.mapArrayAnytype = mapArrayAnytype;
- }
-
- public AdditionalPropertiesClass mapMapString(Map> mapMapString) {
- this.mapMapString = mapMapString;
- return this;
- }
-
- public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) {
- if (this.mapMapString == null) {
- this.mapMapString = new HashMap>();
+ @JsonProperty(JSON_PROPERTY_MAP_NUMBER)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMapNumber(Map mapNumber) {
+ this.mapNumber = mapNumber;
}
- this.mapMapString.put(key, mapMapStringItem);
- return this;
- }
- /**
- * Get mapMapString
- * @return mapMapString
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Map> getMapMapString() {
- return mapMapString;
- }
-
- @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setMapMapString(Map> mapMapString) {
- this.mapMapString = mapMapString;
- }
-
- public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) {
- this.mapMapAnytype = mapMapAnytype;
- return this;
- }
-
- public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) {
- if (this.mapMapAnytype == null) {
- this.mapMapAnytype = new HashMap>();
+ public AdditionalPropertiesClass mapInteger(Map mapInteger) {
+ this.mapInteger = mapInteger;
+ return this;
}
- this.mapMapAnytype.put(key, mapMapAnytypeItem);
- return this;
+
+ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
+ if (this.mapInteger == null) {
+ this.mapInteger = new HashMap();
+ }
+ this.mapInteger.put(key, mapIntegerItem);
+ return this;
}
- /**
- * Get mapMapAnytype
- * @return mapMapAnytype
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Map> getMapMapAnytype() {
- return mapMapAnytype;
- }
-
- @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setMapMapAnytype(Map> mapMapAnytype) {
- this.mapMapAnytype = mapMapAnytype;
- }
-
- public AdditionalPropertiesClass anytype1(Object anytype1) {
- this.anytype1 = anytype1;
- return this;
- }
-
- /**
- * Get anytype1
- * @return anytype1
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_ANYTYPE1)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Object getAnytype1() {
- return anytype1;
- }
-
- @JsonProperty(JSON_PROPERTY_ANYTYPE1)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setAnytype1(Object anytype1) {
- this.anytype1 = anytype1;
- }
-
- public AdditionalPropertiesClass anytype2(Object anytype2) {
- this.anytype2 = anytype2;
- return this;
- }
-
- /**
- * Get anytype2
- * @return anytype2
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_ANYTYPE2)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Object getAnytype2() {
- return anytype2;
- }
-
- @JsonProperty(JSON_PROPERTY_ANYTYPE2)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setAnytype2(Object anytype2) {
- this.anytype2 = anytype2;
- }
-
- public AdditionalPropertiesClass anytype3(Object anytype3) {
- this.anytype3 = anytype3;
- return this;
- }
-
- /**
- * Get anytype3
- * @return anytype3
- **/
- @Nullable
- @ApiModelProperty(value = "")
- @JsonProperty(JSON_PROPERTY_ANYTYPE3)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public Object getAnytype3() {
- return anytype3;
- }
-
- @JsonProperty(JSON_PROPERTY_ANYTYPE3)
- @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
- public void setAnytype3(Object anytype3) {
- this.anytype3 = anytype3;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
+ /**
+ * Get mapInteger
+ * @return mapInteger
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_MAP_INTEGER)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map getMapInteger() {
+ return mapInteger;
}
- if (o == null || getClass() != o.getClass()) {
- return false;
+
+ @JsonProperty(JSON_PROPERTY_MAP_INTEGER)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMapInteger(Map mapInteger) {
+ this.mapInteger = mapInteger;
}
- AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
- return Objects.equals(this.mapString, additionalPropertiesClass.mapString) &&
- Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) &&
- Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) &&
- Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) &&
- Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) &&
- Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) &&
- Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) &&
- Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) &&
- Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
- Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) &&
- Objects.equals(this.anytype3, additionalPropertiesClass.anytype3);
- }
- @Override
- public int hashCode() {
- return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesClass {\n");
- sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n");
- sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n");
- sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n");
- sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n");
- sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n");
- sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n");
- sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n");
- sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n");
- sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n");
- sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n");
- sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
+ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) {
+ this.mapBoolean = mapBoolean;
+ return this;
}
- return o.toString().replace("\n", "\n ");
+
+ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
+ if (this.mapBoolean == null) {
+ this.mapBoolean = new HashMap();
+ }
+ this.mapBoolean.put(key, mapBooleanItem);
+ return this;
}
+ /**
+ * Get mapBoolean
+ * @return mapBoolean
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map getMapBoolean() {
+ return mapBoolean;
+ }
+
+ @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMapBoolean(Map mapBoolean) {
+ this.mapBoolean = mapBoolean;
+ }
+
+ public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) {
+ this.mapArrayInteger = mapArrayInteger;
+ return this;
+ }
+
+ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) {
+ if (this.mapArrayInteger == null) {
+ this.mapArrayInteger = new HashMap>();
+ }
+ this.mapArrayInteger.put(key, mapArrayIntegerItem);
+ return this;
+ }
+
+ /**
+ * Get mapArrayInteger
+ * @return mapArrayInteger
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map> getMapArrayInteger() {
+ return mapArrayInteger;
+ }
+
+ @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMapArrayInteger(Map> mapArrayInteger) {
+ this.mapArrayInteger = mapArrayInteger;
+ }
+
+ public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) {
+ this.mapArrayAnytype = mapArrayAnytype;
+ return this;
+ }
+
+ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) {
+ if (this.mapArrayAnytype == null) {
+ this.mapArrayAnytype = new HashMap>();
+ }
+ this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
+ return this;
+ }
+
+ /**
+ * Get mapArrayAnytype
+ * @return mapArrayAnytype
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map> getMapArrayAnytype() {
+ return mapArrayAnytype;
+ }
+
+ @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMapArrayAnytype(Map> mapArrayAnytype) {
+ this.mapArrayAnytype = mapArrayAnytype;
+ }
+
+ public AdditionalPropertiesClass mapMapString(Map> mapMapString) {
+ this.mapMapString = mapMapString;
+ return this;
+ }
+
+ public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) {
+ if (this.mapMapString == null) {
+ this.mapMapString = new HashMap>();
+ }
+ this.mapMapString.put(key, mapMapStringItem);
+ return this;
+ }
+
+ /**
+ * Get mapMapString
+ * @return mapMapString
+ **/
+ @Nullable
+ @ApiModelProperty(value = "")
+ @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map> getMapMapString() {
+ return mapMapString;
+ }
+
+ @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMapMapString(Map> mapMapString) {
+ this.mapMapString = mapMapString;
+ }
+
+ public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) {
+ this.mapMapAnytype = mapMapAnytype;
+ return this;
+ }
+
+ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) {
+ if (this.mapMapAnytype == null) {
+ this.mapMapAnytype = new HashMap