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 + + + +## RESERVED WORDS + + + +## 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>(); + } + this.mapMapAnytype.put(key, mapMapAnytypeItem); + 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; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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"; + } + return o.toString().replace("\n", "\n "); + } + } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 5d6f4bcec0..1e1c1f2073 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesInteger 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 AdditionalPropertiesInteger 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 AdditionalPropertiesInteger() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.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 AdditionalPropertiesInteger {\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; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(this.name, additionalPropertiesInteger.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 AdditionalPropertiesInteger {\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/AdditionalPropertiesNumber.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 88dfc96af1..972cb4ae44 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -36,69 +36,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesNumber 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 AdditionalPropertiesNumber 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 AdditionalPropertiesNumber() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.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 AdditionalPropertiesNumber {\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; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(this.name, additionalPropertiesNumber.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 AdditionalPropertiesNumber {\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/AdditionalPropertiesObject.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 393746a2f1..1c3fe0f862 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesObject 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 AdditionalPropertiesObject 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 AdditionalPropertiesObject() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.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 AdditionalPropertiesObject {\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; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(this.name, additionalPropertiesObject.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 AdditionalPropertiesObject {\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/AdditionalPropertiesString.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index cefd74bd15..732a70109d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesString 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 AdditionalPropertiesString 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 AdditionalPropertiesString() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.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 AdditionalPropertiesString {\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; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(this.name, additionalPropertiesString.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 AdditionalPropertiesString {\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/Animal.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java index 5225322d5c..9920cdfda2 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java @@ -43,95 +43,97 @@ import javax.annotation.Generated; @Introspected public class Animal { - public static final String JSON_PROPERTY_CLASS_NAME = "className"; - protected String className; + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + protected String className; - public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + public static final String JSON_PROPERTY_COLOR = "color"; + private String color = "red"; - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { - return className; - } - - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getColor() { - return color; - } - - @JsonProperty(JSON_PROPERTY_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Animal() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Animal className(String className) { + this.className = className; + return this; } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).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 className + * @return className + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { + return color; + } + + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColor(String color) { + this.color = color; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).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/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 0388c7c5ae..f8e35cafcb 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -36,75 +36,77 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ArrayOfArrayOfNumberOnly { - public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = null; + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + private List> arrayArrayNumber = null; - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + public ArrayOfArrayOfNumberOnly() { } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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 arrayArrayNumber + * @return arrayArrayNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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/ArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 721d788bd9..0c81db857c 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -36,75 +36,77 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ArrayOfNumberOnly { - public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = null; + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + private List arrayNumber = null; - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + public ArrayOfNumberOnly() { } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayNumber() { - return arrayNumber; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } + this.arrayNumber.add(arrayNumberItem); + return this; } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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 arrayNumber + * @return arrayNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { + return arrayNumber; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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/ArrayTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java index 07578136d1..91a150fa94 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java @@ -38,147 +38,149 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ArrayTest { - public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = null; + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + private List arrayOfString = null; - public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = null; + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + private List> arrayArrayOfInteger = null; - public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = null; + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + private List> arrayArrayOfModel = null; - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + public ArrayTest() { } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayOfString() { - return arrayOfString; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * Get arrayOfString + * @return arrayOfString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { + return arrayOfString; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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 ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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/BigCat.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java index badc938431..732353de97 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java @@ -35,104 +35,107 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class BigCat extends Cat { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - TIGERS("tigers"), - LEOPARDS("leopards"), - JAGUARS("jaguars"); + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + TIGERS("tigers"), + LEOPARDS("leopards"), + JAGUARS("jaguars"); - private String value; + private String value; - KindEnum(String value) { - this.value = value; + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public BigCat() { + super(); + } + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get kind + * @return kind + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KindEnum getKind() { + return kind; + } + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public KindEnum getKind() { - return kind; - } - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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 "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java index cdc464b8e9..f19a893551 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -33,102 +33,104 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class BigCatAllOf { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - TIGERS("tigers"), - LEOPARDS("leopards"), - JAGUARS("jaguars"); + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + TIGERS("tigers"), + LEOPARDS("leopards"), + JAGUARS("jaguars"); - private String value; + private String value; - KindEnum(String value) { - this.value = value; + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public BigCatAllOf() { + } + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get kind + * @return kind + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KindEnum getKind() { + return kind; + } + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public KindEnum getKind() { - return kind; - } - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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 "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java index dd01342a8a..312e637f86 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java @@ -38,207 +38,209 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Capitalization { - public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - private String smallCamel; + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + private String smallCamel; - public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - private String capitalCamel; + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + private String capitalCamel; - public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - private String smallSnake; + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + private String smallSnake; - public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - private String capitalSnake; + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + private String capitalSnake; - public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - private String scAETHFlowPoints; + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + private String scAETHFlowPoints; - public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - private String ATT_NAME; + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + private String ATT_NAME; - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallCamel() { - return smallCamel; - } - - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalCamel() { - return capitalCamel; - } - - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallSnake() { - return smallSnake; - } - - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalSnake() { - return capitalSnake; - } - - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - **/ - @Nullable - @ApiModelProperty(value = "Name of the pet ") - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getATTNAME() { - return ATT_NAME; - } - - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Capitalization() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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 smallCamel + * @return smallCamel + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { + return smallCamel; + } + + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { + return capitalCamel; + } + + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { + return smallSnake; + } + + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { + return capitalSnake; + } + + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @Nullable + @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { + return ATT_NAME; + } + + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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/Cat.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java index 8f9fe12d88..817807f86d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Cat extends Animal { - public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDeclawed() { - return declawed; - } - - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Cat() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).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 declawed + * @return declawed + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { + return declawed; + } + + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).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/CatAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java index 4ee623d649..6125a814c9 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class CatAllOf { - public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDeclawed() { - return declawed; - } - - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public CatAllOf() { } - if (o == null || getClass() != o.getClass()) { - return false; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).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 declawed + * @return declawed + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { + return declawed; + } + + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(this.declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).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/Category.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java index 552c577d79..88978ee639 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java @@ -34,95 +34,97 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Category { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_NAME = "name"; - private String name = "default-name"; + public static final String JSON_PROPERTY_NAME = "name"; + private String name = "default-name"; - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Category() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Category id(Long id) { + this.id = id; + return this; } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).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 id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).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/ClassModel.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java index 2f94229b7e..37dafc836c 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java @@ -34,67 +34,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ClassModel { - public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - private String propertyClass; + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + private String propertyClass; - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { - return propertyClass; - } - - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ClassModel() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 propertyClass + * @return propertyClass + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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/Dog.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java index 8bde5e0809..53a7c64f13 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Dog extends Animal { - public static final String JSON_PROPERTY_BREED = "breed"; - private String breed; + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBreed() { - return breed; - } - - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Dog() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public Dog breed(String breed) { + this.breed = breed; + return this; } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).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 breed + * @return breed + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { + return breed; + } + + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(String breed) { + this.breed = breed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).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/DogAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java index 51dec00ea1..3dba0d3bc2 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class DogAllOf { - public static final String JSON_PROPERTY_BREED = "breed"; - private String breed; + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBreed() { - return breed; - } - - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public DogAllOf() { } - if (o == null || getClass() != o.getClass()) { - return false; + public DogAllOf breed(String breed) { + this.breed = breed; + return this; } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).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 breed + * @return breed + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { + return breed; + } + + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(String breed) { + this.breed = breed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(this.breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + sb.append(" breed: ").append(toIndentedString(breed)).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/EnumArrays.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java index c71f5edf0c..9c72665e82 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java @@ -36,169 +36,171 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class EnumArrays { - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - DOLLAR("$"); + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + DOLLAR("$"); - private String value; + private String value; - JustSymbolEnum(String value) { - this.value = value; + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + private List arrayEnum = null; + + public EnumArrays() { + } + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get justSymbol + * @return justSymbol + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { + return arrayEnum; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayEnum() { - return arrayEnum; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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 "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumClass.java index 1ee1b126d0..f01bfc4175 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumClass.java @@ -29,34 +29,34 @@ import com.fasterxml.jackson.annotation.JsonValue; */ @Introspected public enum EnumClass { - _ABC("_abc"), - _EFG("-efg"), - _XYZ_("(xyz)"); + _ABC("_abc"), + _EFG("-efg"), + _XYZ_("(xyz)"); - private String value; + private String value; - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } + EnumClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java index 0b9c758a82..1168da6df5 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java @@ -38,313 +38,315 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class EnumTest { - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - LOWER("lower"), - EMPTY(""); + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + LOWER("lower"), + EMPTY(""); - private String value; + private String value; - EnumStringEnum(String value) { - this.value = value; + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + LOWER("lower"), + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + private EnumNumberEnum enumNumber; + + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + private OuterEnum outerEnum; + + public EnumTest() { + } + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get enumString + * @return enumString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { + return enumString; + } + + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { + return outerEnum; + } + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - LOWER("lower"), - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - private EnumNumberEnum enumNumber; - - public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumStringEnum getEnumString() { - return enumString; - } - - @JsonProperty(JSON_PROPERTY_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { - return outerEnum; - } - - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).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 "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 9e250b52ef..b1f30f1a4f 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -37,104 +37,106 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class FileSchemaTestClass { - public static final String JSON_PROPERTY_FILE = "file"; - private ModelFile _file; + public static final String JSON_PROPERTY_FILE = "file"; + private ModelFile _file; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public FileSchemaTestClass _file(ModelFile _file) { - this._file = _file; - return this; - } - - /** - * Get _file - * @return _file - **/ - @Valid - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ModelFile getFile() { - return _file; - } - - @JsonProperty(JSON_PROPERTY_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFile(ModelFile _file) { - this._file = _file; - } - - public FileSchemaTestClass files(List files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(ModelFile filesItem) { - if (this.files == null) { - this.files = new ArrayList(); + public FileSchemaTestClass() { } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get _file + * @return _file + **/ + @Valid + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelFile getFile() { + return _file; } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this._file, fileSchemaTestClass._file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - @Override - public int hashCode() { - return Objects.hash(_file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).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"; + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this._file, fileSchemaTestClass._file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(_file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).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/FormatTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java index 239ef22ecb..83555236ab 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java @@ -51,457 +51,459 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class FormatTest { - public static final String JSON_PROPERTY_INTEGER = "integer"; - private Integer integer; + public static final String JSON_PROPERTY_INTEGER = "integer"; + private Integer integer; - public static final String JSON_PROPERTY_INT32 = "int32"; - private Integer int32; + public static final String JSON_PROPERTY_INT32 = "int32"; + private Integer int32; - public static final String JSON_PROPERTY_INT64 = "int64"; - private Long int64; + public static final String JSON_PROPERTY_INT64 = "int64"; + private Long int64; - public static final String JSON_PROPERTY_NUMBER = "number"; - private BigDecimal number; + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; - public static final String JSON_PROPERTY_FLOAT = "float"; - private Float _float; + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; - public static final String JSON_PROPERTY_DOUBLE = "double"; - private Double _double; + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; - public static final String JSON_PROPERTY_STRING = "string"; - private String string; + public static final String JSON_PROPERTY_STRING = "string"; + private String string; - public static final String JSON_PROPERTY_BYTE = "byte"; - private byte[] _byte; + public static final String JSON_PROPERTY_BYTE = "byte"; + private byte[] _byte; - public static final String JSON_PROPERTY_BINARY = "binary"; - private File binary; + public static final String JSON_PROPERTY_BINARY = "binary"; + private File binary; - public static final String JSON_PROPERTY_DATE = "date"; - private LocalDate date; + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; - public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - private LocalDateTime dateTime; + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private LocalDateTime dateTime; - public static final String JSON_PROPERTY_UUID = "uuid"; - private UUID uuid; + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; - public static final String JSON_PROPERTY_PASSWORD = "password"; - private String password; + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; - public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; - private BigDecimal bigDecimal; + public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; + private BigDecimal bigDecimal; - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - **/ - @Nullable - @Min(10) - @Max(100) - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInteger() { - return integer; - } - - @JsonProperty(JSON_PROPERTY_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - **/ - @Nullable - @Min(20) - @Max(200) - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_INT32) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInt32() { - return int32; - } - - @JsonProperty(JSON_PROPERTY_INT32) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_INT64) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getInt64() { - return int64; - } - - @JsonProperty(JSON_PROPERTY_INT64) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - **/ - @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getNumber() { - return number; - } - - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - **/ - @Nullable - @DecimalMin("54.3") - @DecimalMax("987.6") - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FLOAT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Float getFloat() { - return _float; - } - - @JsonProperty(JSON_PROPERTY_FLOAT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - **/ - @Nullable - @DecimalMin("67.8") - @DecimalMax("123.4") - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DOUBLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getDouble() { - return _double; - } - - @JsonProperty(JSON_PROPERTY_DOUBLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - **/ - @Nullable - @Pattern(regexp="/[a-z]/i") - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getString() { - return string; - } - - @JsonProperty(JSON_PROPERTY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_BYTE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public byte[] getByte() { - return _byte; - } - - @JsonProperty(JSON_PROPERTY_BYTE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(File binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BINARY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public File getBinary() { - return binary; - } - - @JsonProperty(JSON_PROPERTY_BINARY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBinary(File binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") - public LocalDate getDate() { - return date; - } - - @JsonProperty(JSON_PROPERTY_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public LocalDateTime getDateTime() { - return dateTime; - } - - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public void setDateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @Nullable - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { - return uuid; - } - - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @NotNull - @Size(min=10, max=64) - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getPassword() { - return password; - } - - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public FormatTest() { } - if (o == null || getClass() != o.getClass()) { - return false; + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).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 integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @Nullable + @Min(10) + @Max(100) + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { + return integer; + } + + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @Nullable + @Min(20) + @Max(200) + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { + return int32; + } + + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { + return int64; + } + + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @NotNull + @DecimalMin("32.1") + @DecimalMax("543.2") + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { + return number; + } + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @Nullable + @DecimalMin("54.3") + @DecimalMax("987.6") + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { + return _float; + } + + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @Nullable + @DecimalMin("67.8") + @DecimalMax("123.4") + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { + return _double; + } + + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @Nullable + @Pattern(regexp="/[a-z]/i") + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { + return string; + } + + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(String string) { + this.string = string; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { + return _byte; + } + + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { + return binary; + } + + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") + public LocalDate getDate() { + return date; + } + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest dateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public LocalDateTime getDateTime() { + return dateTime; + } + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public void setDateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @Nullable + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; + } + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @NotNull + @Size(min=10, max=64) + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(String password) { + this.password = password; + } + + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + + /** + * Get bigDecimal + * @return bigDecimal + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getBigDecimal() { + return bigDecimal; + } + + @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.bigDecimal, formatTest.bigDecimal); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).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/HasOnlyReadOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 43e713b030..0de28c4978 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -34,73 +34,75 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class HasOnlyReadOnly { - public static final String JSON_PROPERTY_BAR = "bar"; - private String bar; + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; - public static final String JSON_PROPERTY_FOO = "foo"; - private String foo; + public static final String JSON_PROPERTY_FOO = "foo"; + private String foo; - /** - * Get bar - * @return bar - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BAR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { - return bar; - } - - /** - * Get foo - * @return foo - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FOO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFoo() { - return foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public HasOnlyReadOnly() { } - if (o == null || getClass() != o.getClass()) { - return false; + /** + * Get bar + * @return bar + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).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 foo + * @return foo + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { + return foo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).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/MapTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java index 259929412b..57112ef976 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java @@ -39,216 +39,218 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class MapTest { - public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - private Map> mapMapOfString = null; + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + private Map> mapMapOfString = null; - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - LOWER("lower"); + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + LOWER("lower"); - private String value; + private String value; - InnerEnum(String value) { - this.value = value; + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + private Map mapOfEnumString = null; + + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + private Map directMap = null; + + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + private Map indirectMap = null; + + public MapTest() { + } + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; } - @JsonValue - public String getValue() { - return value; + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { + return mapMapOfString; + } + + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { + return directMap; + } + + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { + return indirectMap; + } + + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - private Map mapOfEnumString = null; - - public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - private Map directMap = null; - - public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapMapOfString() { - return mapMapOfString; - } - - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getDirectMap() { - return directMap; - } - - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getIndirectMap() { - return indirectMap; - } - - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).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 "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4f546fae5f..46e2e81f47 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -41,133 +41,135 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class MixedPropertiesAndAdditionalPropertiesClass { - public static final String JSON_PROPERTY_UUID = "uuid"; - private UUID uuid; + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; - public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - private LocalDateTime dateTime; + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private LocalDateTime dateTime; - public static final String JSON_PROPERTY_MAP = "map"; - private Map map = null; + public static final String JSON_PROPERTY_MAP = "map"; + private Map map = null; - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { - return uuid; - } - - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public LocalDateTime getDateTime() { - return dateTime; - } - - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public void setDateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap(); + public MixedPropertiesAndAdditionalPropertiesClass() { } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMap() { - return map; - } - - @JsonProperty(JSON_PROPERTY_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get uuid + * @return uuid + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).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"; + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; } - return o.toString().replace("\n", "\n "); + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public LocalDateTime getDateTime() { + return dateTime; + } + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public void setDateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } + this.map.put(key, mapItem); + return this; } + /** + * Get map + * @return map + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { + return map; + } + + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMap(Map map) { + this.map = map; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).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 "); + } + } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java index 34604b7b3b..05141ad707 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java @@ -35,95 +35,97 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Model200Response { - public static final String JSON_PROPERTY_NAME = "name"; - private Integer name; + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; - public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - private String propertyClass; + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + private String propertyClass; - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { - return propertyClass; - } - - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Model200Response() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Model200Response name(Integer name) { + this.name = name; + return this; } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 Integer getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(Integer name) { + this.name = name; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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/ModelApiResponse.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java index 7d185d9d0b..33e9cd2305 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -35,123 +35,125 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelApiResponse { - public static final String JSON_PROPERTY_CODE = "code"; - private Integer code; + public static final String JSON_PROPERTY_CODE = "code"; + private Integer code; - public static final String JSON_PROPERTY_TYPE = "type"; - private String type; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCode() { - return code; - } - - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelApiResponse() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelApiResponse code(Integer code) { + this.code = code; + return this; } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).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 code + * @return code + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).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/ModelClient.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java index af4f73af5c..936ddd4a2d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelClient { - public static final String JSON_PROPERTY_CLIENT = "client"; - private String _client; + public static final String JSON_PROPERTY_CLIENT = "client"; + private String _client; - public ModelClient _client(String _client) { - this._client = _client; - return this; - } - - /** - * Get _client - * @return _client - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CLIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClient() { - return _client; - } - - @JsonProperty(JSON_PROPERTY_CLIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClient(String _client) { - this._client = _client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelClient() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelClient _client(String _client) { + this._client = _client; + return this; } - ModelClient _client = (ModelClient) o; - return Objects.equals(this._client, _client._client); - } - @Override - public int hashCode() { - return Objects.hash(_client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelClient {\n"); - sb.append(" _client: ").append(toIndentedString(_client)).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 _client + * @return _client + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { + return _client; + } + + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(String _client) { + this._client = _client; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelClient _client = (ModelClient) o; + return Objects.equals(this._client, _client._client); + } + + @Override + public int hashCode() { + return Objects.hash(_client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelClient {\n"); + sb.append(" _client: ").append(toIndentedString(_client)).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/ModelFile.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java index 7112952184..b4d40ff9b6 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java @@ -34,67 +34,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelFile { - public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; - private String sourceURI; + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - **/ - @Nullable - @ApiModelProperty(value = "Test capitalization") - @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSourceURI() { - return sourceURI; - } - - @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelFile() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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"; + /** + * Test capitalization + * @return sourceURI + **/ + @Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceURI() { + return sourceURI; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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/ModelList.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java index 9aa652a72e..6c48df8fe4 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelList { - public static final String JSON_PROPERTY_123LIST = "123-list"; - private String _123list; + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_123LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String get123list() { - return _123list; - } - - @JsonProperty(JSON_PROPERTY_123LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelList() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).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 _123list + * @return _123list + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String get123list() { + return _123list; + } + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).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/ModelReturn.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java index 2688ecad26..be60946ba7 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java @@ -34,67 +34,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelReturn { - public static final String JSON_PROPERTY_RETURN = "return"; - private Integer _return; + public static final String JSON_PROPERTY_RETURN = "return"; + private Integer _return; - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_RETURN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getReturn() { - return _return; - } - - @JsonProperty(JSON_PROPERTY_RETURN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelReturn() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).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 _return + * @return _return + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { + return _return; + } + + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturn(Integer _return) { + this._return = _return; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).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/Name.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java index 018d3cf558..401002e5de 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java @@ -37,129 +37,131 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Name { - public static final String JSON_PROPERTY_NAME = "name"; - private Integer name; + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; - public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - private Integer snakeCase; + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + private Integer snakeCase; - public static final String JSON_PROPERTY_PROPERTY = "property"; - private String property; + public static final String JSON_PROPERTY_PROPERTY = "property"; + private String property; - public static final String JSON_PROPERTY_123NUMBER = "123Number"; - private Integer _123number; + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + private Integer _123number; - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(Integer name) { - this.name = name; - } - - /** - * Get snakeCase - * @return snakeCase - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSnakeCase() { - return snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getProperty() { - return property; - } - - @JsonProperty(JSON_PROPERTY_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProperty(String property) { - this.property = property; - } - - /** - * Get _123number - * @return _123number - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_123NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer get123number() { - return _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Name() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Name name(Integer name) { + this.name = name; + return this; } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).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 + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(Integer name) { + this.name = name; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { + return snakeCase; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { + return property; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperty(String property) { + this.property = property; + } + + /** + * Get _123number + * @return _123number + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { + return _123number; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).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/NumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java index e4197f390e..9b3e86e34e 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java @@ -34,67 +34,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class NumberOnly { - public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - private BigDecimal justNumber; + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + private BigDecimal justNumber; - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getJustNumber() { - return justNumber; - } - - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public NumberOnly() { } - if (o == null || getClass() != o.getClass()) { - return false; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).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 justNumber + * @return justNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { + return justNumber; + } + + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).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/Order.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java index 8ecdbda126..801a4d52c6 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java @@ -39,243 +39,245 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Order { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_PET_ID = "petId"; - private Long petId; + public static final String JSON_PROPERTY_PET_ID = "petId"; + private Long petId; - public static final String JSON_PROPERTY_QUANTITY = "quantity"; - private Integer quantity; + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Integer quantity; - public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - private LocalDateTime shipDate; + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + private LocalDateTime shipDate; - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_COMPLETE = "complete"; + private Boolean complete = false; + + public Order() { + } + public Order id(Long id) { + this.id = id; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { + return petId; + } + + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { + return quantity; + } + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public LocalDateTime getShipDate() { + return shipDate; + } + + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public void setShipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @Nullable + @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { + return complete; + } + + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_STATUS = "status"; - private StatusEnum status; - - public static final String JSON_PROPERTY_COMPLETE = "complete"; - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PET_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getPetId() { - return petId; - } - - @JsonProperty(JSON_PROPERTY_PET_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_QUANTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getQuantity() { - return quantity; - } - - @JsonProperty(JSON_PROPERTY_QUANTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(LocalDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_SHIP_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public LocalDateTime getShipDate() { - return shipDate; - } - - @JsonProperty(JSON_PROPERTY_SHIP_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public void setShipDate(LocalDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - **/ - @Nullable - @ApiModelProperty(value = "Order Status") - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { - return status; - } - - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getComplete() { - return complete; - } - - @JsonProperty(JSON_PROPERTY_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).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 "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java index 4c41ddc658..96fd146e25 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java @@ -36,123 +36,125 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class OuterComposite { - public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - private BigDecimal myNumber; + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + private BigDecimal myNumber; - public static final String JSON_PROPERTY_MY_STRING = "my_string"; - private String myString; + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + private String myString; - public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - private Boolean myBoolean; + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + private Boolean myBoolean; - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getMyNumber() { - return myNumber; - } - - @JsonProperty(JSON_PROPERTY_MY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMyString() { - return myString; - } - - @JsonProperty(JSON_PROPERTY_MY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getMyBoolean() { - return myBoolean; - } - - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public OuterComposite() { } - if (o == null || getClass() != o.getClass()) { - return false; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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 myNumber + * @return myNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { + return myNumber; + } + + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { + return myString; + } + + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { + return myBoolean; + } + + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/OuterEnum.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterEnum.java index 76fe37007e..5cf96d1093 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterEnum.java @@ -29,34 +29,34 @@ import com.fasterxml.jackson.annotation.JsonValue; */ @Introspected public enum OuterEnum { - PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); - private String value; + private String value; - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } + OuterEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java index f142a57afd..fa4dec4b49 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java @@ -45,257 +45,258 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Pet { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_CATEGORY = "category"; - private Category category; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private Category category; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private Set photoUrls = new LinkedHashSet(); + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + private Set photoUrls = new LinkedHashSet(); - public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = null; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - PENDING("pending"), - SOLD("sold"); + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + PENDING("pending"), + SOLD("sold"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public Pet() { + } + public Pet id(Long id) { + this.id = id; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @Valid + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Set getPhotoUrls() { + return photoUrls; + } + + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @Nullable + @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * 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"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_STATUS = "status"; - private StatusEnum status; - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - **/ - @Valid - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CATEGORY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Category getCategory() { - return category; - } - - @JsonProperty(JSON_PROPERTY_CATEGORY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTags() { - return tags; - } - - @JsonProperty(JSON_PROPERTY_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTags(List tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - **/ - @Nullable - @ApiModelProperty(value = "pet status in the store") - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { - return status; - } - - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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 "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java index a9827ceca0..38133c13c8 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,84 +34,86 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ReadOnlyFirst { - public static final String JSON_PROPERTY_BAR = "bar"; - private String bar; + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; - public static final String JSON_PROPERTY_BAZ = "baz"; - private String baz; + public static final String JSON_PROPERTY_BAZ = "baz"; + private String baz; - /** - * Get bar - * @return bar - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BAR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { - return bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BAZ) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBaz() { - return baz; - } - - @JsonProperty(JSON_PROPERTY_BAZ) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ReadOnlyFirst() { } - if (o == null || getClass() != o.getClass()) { - return false; + /** + * Get bar + * @return bar + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).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 ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { + return baz; + } + + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaz(String baz) { + this.baz = baz; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).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/SpecialModelName.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java index 0845ebff63..d0a8db4de8 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class SpecialModelName { - public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - private Long $specialPropertyName; + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + private Long $specialPropertyName; - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public SpecialModelName() { } - if (o == null || getClass() != o.getClass()) { - return false; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).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 $specialPropertyName + * @return $specialPropertyName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).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/Tag.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java index eee95fd360..7163b18633 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java @@ -34,95 +34,97 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Tag { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public Tag 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 Tag() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Tag id(Long id) { + this.id = id; + return this; } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).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 id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Tag 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; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).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/TypeHolderDefault.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7475ae2ec4..47b47122e3 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -40,184 +40,186 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class TypeHolderDefault { - public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - private String stringItem = "what"; + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + private String stringItem = "what"; - public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - private BigDecimal numberItem; + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + private BigDecimal numberItem; - public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - private Integer integerItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + private Integer integerItem; - public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - private Boolean boolItem = true; + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + private Boolean boolItem = true; - public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + private List arrayItem = new ArrayList(); - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getStringItem() { - return stringItem; - } - - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getNumberItem() { - return numberItem; - } - - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getIntegerItem() { - return integerItem; - } - - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getBoolItem() { - return boolItem; - } - - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getArrayItem() { - return arrayItem; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public TypeHolderDefault() { } - if (o == null || getClass() != o.getClass()) { - return false; + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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 stringItem + * @return stringItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { + return stringItem; + } + + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { + return numberItem; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { + return integerItem; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { + return boolItem; + } + + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { + return arrayItem; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && + Objects.equals(this.numberItem, typeHolderDefault.numberItem) && + Objects.equals(this.integerItem, typeHolderDefault.integerItem) && + Objects.equals(this.boolItem, typeHolderDefault.boolItem) && + Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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/TypeHolderExample.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java index 539ef489b9..be1a735186 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -41,212 +41,214 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class TypeHolderExample { - public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - private String stringItem; + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + private String stringItem; - public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - private BigDecimal numberItem; + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + private BigDecimal numberItem; - public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; - private Float floatItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; - public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - private Integer integerItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + private Integer integerItem; - public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - private Boolean boolItem; + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + private Boolean boolItem; - public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + private List arrayItem = new ArrayList(); - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - **/ - @NotNull - @ApiModelProperty(example = "what", required = true, value = "") - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getStringItem() { - return stringItem; - } - - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getNumberItem() { - return numberItem; - } - - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - **/ - @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") - @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Float getFloatItem() { - return floatItem; - } - - @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getIntegerItem() { - return integerItem; - } - - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @NotNull - @ApiModelProperty(example = "true", required = true, value = "") - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getBoolItem() { - return boolItem; - } - - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - **/ - @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getArrayItem() { - return arrayItem; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public TypeHolderExample() { } - if (o == null || getClass() != o.getClass()) { - return false; + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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 stringItem + * @return stringItem + **/ + @NotNull + @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { + return stringItem; + } + + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { + return numberItem; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @NotNull + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Float getFloatItem() { + return floatItem; + } + + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { + return integerItem; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { + return boolItem; + } + + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { + return arrayItem; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(this.stringItem, typeHolderExample.stringItem) && + Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && + Objects.equals(this.integerItem, typeHolderExample.integerItem) && + Objects.equals(this.boolItem, typeHolderExample.boolItem) && + Objects.equals(this.arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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/User.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java index caea2374d8..fedc16d291 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java @@ -40,263 +40,265 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class User { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_USERNAME = "username"; - private String username; + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; - public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - private String firstName; + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; - public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - private String lastName; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; - public static final String JSON_PROPERTY_EMAIL = "email"; - private String email; + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; - public static final String JSON_PROPERTY_PASSWORD = "password"; - private String password; + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; - public static final String JSON_PROPERTY_PHONE = "phone"; - private String phone; + public static final String JSON_PROPERTY_PHONE = "phone"; + private String phone; - public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - private Integer userStatus; + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + private Integer userStatus; - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUsername() { - return username; - } - - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FIRST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFirstName() { - return firstName; - } - - @JsonProperty(JSON_PROPERTY_FIRST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_LAST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLastName() { - return lastName; - } - - @JsonProperty(JSON_PROPERTY_LAST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_EMAIL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmail() { - return email; - } - - @JsonProperty(JSON_PROPERTY_EMAIL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPassword() { - return password; - } - - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPhone() { - return phone; - } - - @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - **/ - @Nullable - @ApiModelProperty(value = "User Status") - @JsonProperty(JSON_PROPERTY_USER_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getUserStatus() { - return userStatus; - } - - @JsonProperty(JSON_PROPERTY_USER_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public User() { } - if (o == null || getClass() != o.getClass()) { - return false; + public User id(Long id) { + this.id = id; + return this; } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).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 id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { + return firstName; + } + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { + return lastName; + } + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { + return phone; + } + + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @Nullable + @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { + return userStatus; + } + + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).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/XmlItem.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java index 5ef9159004..351e04063b 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java @@ -64,923 +64,925 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class XmlItem { - public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - private String attributeString; + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + private String attributeString; - public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - private BigDecimal attributeNumber; + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + private BigDecimal attributeNumber; - public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - private Integer attributeInteger; + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + private Integer attributeInteger; - public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - private Boolean attributeBoolean; + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + private Boolean attributeBoolean; - public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = null; + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + private List wrappedArray = null; - public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - private String nameString; + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + private String nameString; - public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - private BigDecimal nameNumber; + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + private BigDecimal nameNumber; - public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - private Integer nameInteger; + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + private Integer nameInteger; - public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - private Boolean nameBoolean; + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + private Boolean nameBoolean; - public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = null; + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + private List nameArray = null; - public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = null; + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + private List nameWrappedArray = null; - public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - private String prefixString; + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + private String prefixString; - public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - private BigDecimal prefixNumber; + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + private BigDecimal prefixNumber; - public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - private Integer prefixInteger; + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + private Integer prefixInteger; - public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - private Boolean prefixBoolean; + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + private Boolean prefixBoolean; - public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = null; + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + private List prefixArray = null; - public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = null; + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + private List prefixWrappedArray = null; - public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - private String namespaceString; + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + private String namespaceString; - public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - private BigDecimal namespaceNumber; + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + private BigDecimal namespaceNumber; - public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - private Integer namespaceInteger; + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + private Integer namespaceInteger; - public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - private Boolean namespaceBoolean; + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + private Boolean namespaceBoolean; - public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = null; + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + private List namespaceArray = null; - public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = null; + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + private List namespaceWrappedArray = null; - public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - private String prefixNsString; + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + private String prefixNsString; - public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - private BigDecimal prefixNsNumber; + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + private BigDecimal prefixNsNumber; - public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - private Integer prefixNsInteger; + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + private Integer prefixNsInteger; - public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - private Boolean prefixNsBoolean; + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + private Boolean prefixNsBoolean; - public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = null; + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + private List prefixNsArray = null; - public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = null; + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + private List prefixNsWrappedArray = null; - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAttributeString() { - return attributeString; - } - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getAttributeInteger() { - return attributeInteger; - } - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + public XmlItem() { } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWrappedArray() { - return wrappedArray; - } - - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_NAME_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getNameString() { - return nameString; - } - - @JsonProperty(JSON_PROPERTY_NAME_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getNameNumber() { - return nameNumber; - } - - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNameInteger() { - return nameInteger; - } - - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getNameBoolean() { - return nameBoolean; - } - - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList(); + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; } - this.nameArray.add(nameArrayItem); - return this; - } - /** - * Get nameArray - * @return nameArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getNameArray() { - return nameArray; - } - - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + /** + * Get attributeString + * @return attributeString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { + return attributeString; } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - /** - * Get nameWrappedArray - * @return nameWrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getNameWrappedArray() { - return nameWrappedArray; - } - - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrefixString() { - return prefixString; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getPrefixInteger() { - return prefixInteger; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; } - this.prefixArray.add(prefixArrayItem); - return this; - } - /** - * Get prefixArray - * @return prefixArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPrefixArray() { - return prefixArray; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getNamespaceString() { - return namespaceString; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + /** + * Get attributeNumber + * @return attributeNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { + return attributeNumber; } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - /** - * Get namespaceArray - * @return namespaceArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getNamespaceArray() { - return namespaceArray; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrefixNsString() { - return prefixNsString; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - /** - * Get prefixNsArray - * @return prefixNsArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPrefixNsArray() { - return prefixNsArray; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + /** + * Get attributeInteger + * @return attributeInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { + return attributeInteger; } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; } - if (o == null || getClass() != o.getClass()) { - return false; + + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).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 attributeBoolean + * @return attributeBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList(); + } + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + /** + * Get wrappedArray + * @return wrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { + return wrappedArray; + } + + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { + return nameString; + } + + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameString(String nameString) { + this.nameString = nameString; + } + + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { + return nameNumber; + } + + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { + return nameInteger; + } + + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { + return nameBoolean; + } + + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList(); + } + this.nameArray.add(nameArrayItem); + return this; + } + + /** + * Get nameArray + * @return nameArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { + return nameArray; + } + + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList(); + } + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + /** + * Get nameWrappedArray + * @return nameWrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { + return nameWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { + return prefixString; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { + return prefixInteger; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList(); + } + this.prefixArray.add(prefixArrayItem); + return this; + } + + /** + * Get prefixArray + * @return prefixArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { + return prefixArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList(); + } + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + /** + * Get prefixWrappedArray + * @return prefixWrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { + return namespaceString; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList(); + } + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + /** + * Get namespaceArray + * @return namespaceArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { + return namespaceArray; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList(); + } + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + /** + * Get namespaceWrappedArray + * @return namespaceWrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { + return prefixNsString; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList(); + } + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + /** + * Get prefixNsArray + * @return prefixNsArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { + return prefixNsArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList(); + } + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + /** + * Get prefixNsWrappedArray + * @return prefixNsWrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(this.attributeString, xmlItem.attributeString) && + Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && + Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && + Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && + Objects.equals(this.nameString, xmlItem.nameString) && + Objects.equals(this.nameNumber, xmlItem.nameNumber) && + Objects.equals(this.nameInteger, xmlItem.nameInteger) && + Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && + Objects.equals(this.nameArray, xmlItem.nameArray) && + Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(this.prefixString, xmlItem.prefixString) && + Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && + Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && + Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(this.prefixArray, xmlItem.prefixArray) && + Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(this.namespaceString, xmlItem.namespaceString) && + Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && + Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && + Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).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/resources/application.yml b/samples/client/petstore/java-micronaut-client/src/main/resources/application.yml index bf9e0df6ca..49d8cc32a0 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/resources/application.yml +++ b/samples/client/petstore/java-micronaut-client/src/main/resources/application.yml @@ -1,5 +1,5 @@ -base-path: "http://petstore.swagger.io:80/v2" -context-path: "/v2" +base-path: "http://petstore.swagger.io:80/v2/" +context-path: "/v2/" micronaut: application: diff --git a/samples/client/petstore/java-micronaut-client/src/main/resources/logback.xml b/samples/client/petstore/java-micronaut-client/src/main/resources/logback.xml new file mode 100644 index 0000000000..8221870826 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/main/resources/logback.xml @@ -0,0 +1,15 @@ + + + + false + + + %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n + + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/.gitignore b/samples/server/petstore/java-micronaut-server/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/server/petstore/java-micronaut-server/.mvn/wrapper/MavenWrapperDownloader.java b/samples/server/petstore/java-micronaut-server/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000000..fc435c409b --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,124 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.Authenticator; +import java.net.PasswordAuthentication; +import java.net.URL; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/.mvn/wrapper/maren-wrapper.properties b/samples/server/petstore/java-micronaut-server/.mvn/wrapper/maren-wrapper.properties new file mode 100644 index 0000000000..642d572ce9 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.mvn/wrapper/maren-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/samples/server/petstore/java-micronaut-server/.openapi-generator-ignore b/samples/server/petstore/java-micronaut-server/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/java-micronaut-server/.openapi-generator/FILES b/samples/server/petstore/java-micronaut-server/.openapi-generator/FILES new file mode 100644 index 0000000000..c1595591bf --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.openapi-generator/FILES @@ -0,0 +1,36 @@ +.gitignore +.mvn/wrapper/MavenWrapperDownloader.java +.mvn/wrapper/maren-wrapper.properties +.mvn/wrapper/maven-wrapper.jar +README.md +build.gradle +docs/controllers/PetController.md +docs/controllers/StoreController.md +docs/controllers/UserController.md +docs/models/Category.md +docs/models/ModelApiResponse.md +docs/models/Order.md +docs/models/Pet.md +docs/models/Tag.md +docs/models/User.md +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +mvnw +mvnw.bat +pom.xml +settings.gradle +src/main/java/org/openapitools/Application.java +src/main/java/org/openapitools/controller/PetController.java +src/main/java/org/openapitools/controller/StoreController.java +src/main/java/org/openapitools/controller/UserController.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java +src/main/resources/application.yml +src/main/resources/logback.xml diff --git a/samples/server/petstore/java-micronaut-server/.openapi-generator/VERSION b/samples/server/petstore/java-micronaut-server/.openapi-generator/VERSION new file mode 100644 index 0000000000..0984c4c1ad --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-micronaut-server/README.md b/samples/server/petstore/java-micronaut-server/README.md new file mode 100644 index 0000000000..7f5a8dd218 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/README.md @@ -0,0 +1,27 @@ +# petstore-micronaut-server + +This is a generated server based on [Micronaut](https://micronaut.io/) framework. + +## Configuration + +To run the whole application, use [Application.java](src/main/java/org/openapitools/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](src/main/resources/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: + +* [PetController](docs/controllers/PetController.md) +* [StoreController](docs/controllers/StoreController.md) +* [UserController](docs/controllers/UserController.md) + +## Author + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/build.gradle b/samples/server/petstore/java-micronaut-server/build.gradle new file mode 100644 index 0000000000..29b6603f79 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/build.gradle @@ -0,0 +1,43 @@ +plugins { + id("groovy") + id("com.github.johnrengelman.shadow") version "7.1.1" + id("io.micronaut.application") version "3.1.1" +} + +version = "1.0.0" +group = "org.openapitools" + +repositories { + mavenCentral() +} + +micronaut { + runtime("netty") + testRuntime("spock2") + processing { + incremental(true) + annotations("org.openapitools.*") + } +} + + +dependencies { + annotationProcessor("io.micronaut:micronaut-http-validation") + implementation("io.micronaut:micronaut-http-client") + implementation("io.micronaut:micronaut-runtime") + implementation("io.micronaut:micronaut-validation") + implementation("io.micronaut.reactor:micronaut-reactor") + implementation("io.swagger:swagger-annotations:1.5.9") + runtimeOnly("ch.qos.logback:logback-classic") +} + +// TODO Set the main class +application { + mainClass.set("org.openapitools.Application") +} +java { + sourceCompatibility = JavaVersion.toVersion("1.8") + targetCompatibility = JavaVersion.toVersion("1.8") +} + +graalvmNative.toolchainDetection = false diff --git a/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md b/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md new file mode 100644 index 0000000000..da831a4f13 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md @@ -0,0 +1,208 @@ +# PetController + +All URIs are relative to `"/v2"` + +The controller class is defined in **[PetController.java](../../src/main/java/org/openapitools/controller/PetController.java)** + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +```java +Mono PetController.addPet(pet) +``` + +Add a new pet to the store + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**pet** | [**Pet**](../../docs/models/Pet.md) | Pet object that needs to be added to the store | + +### Return type +[**Pet**](../../docs/models/Pet.md) + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: `application/json`, `application/xml` + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **deletePet** +```java +Mono PetController.deletePet(petIdapiKey) +``` + +Deletes a pet + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**petId** | `Long` | Pet id to delete | +**apiKey** | `String` | | [optional parameter] + + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: Not defined + + +# **findPetsByStatus** +```java +Mono> PetController.findPetsByStatus(status) +``` + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**status** | [**List<String>**](../../docs/models/String.md) | Status values that need to be considered for filter | [enum: `available`, `pending`, `sold`] + +### Return type +[**List<Pet>**](../../docs/models/Pet.md) + +### Authorization +* **petstore_auth**, scopes: `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **findPetsByTags** +```java +Mono> PetController.findPetsByTags(tags) +``` + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**tags** | [**List<String>**](../../docs/models/String.md) | Tags to filter by | + +### Return type +[**List<Pet>**](../../docs/models/Pet.md) + +### Authorization +* **petstore_auth**, scopes: `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **getPetById** +```java +Mono PetController.getPetById(petId) +``` + +Find pet by ID + +Returns a single pet + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**petId** | `Long` | ID of pet to return | + +### Return type +[**Pet**](../../docs/models/Pet.md) + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **updatePet** +```java +Mono PetController.updatePet(pet) +``` + +Update an existing pet + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**pet** | [**Pet**](../../docs/models/Pet.md) | Pet object that needs to be added to the store | + +### Return type +[**Pet**](../../docs/models/Pet.md) + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: `application/json`, `application/xml` + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **updatePetWithForm** +```java +Mono PetController.updatePetWithForm(petIdnamestatus) +``` + +Updates a pet in the store with form data + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**petId** | `Long` | ID of pet that needs to be updated | +**name** | `String` | Updated name of the pet | [optional parameter] +**status** | `String` | Updated status of the pet | [optional parameter] + + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: `application/x-www-form-urlencoded` + - **Produces Content-Type**: Not defined + + +# **uploadFile** +```java +Mono PetController.uploadFile(petIdadditionalMetadata_file) +``` + +uploads an image + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**petId** | `Long` | ID of pet to update | +**additionalMetadata** | `String` | Additional data to pass to server | [optional parameter] +**_file** | `CompletedFileUpload` | file to upload | [optional parameter] + +### Return type +[**ModelApiResponse**](../../docs/models/ModelApiResponse.md) + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: `multipart/form-data` + - **Produces Content-Type**: `application/json` + diff --git a/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md b/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md new file mode 100644 index 0000000000..0cc9c7f0a2 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md @@ -0,0 +1,99 @@ +# StoreController + +All URIs are relative to `"/v2"` + +The controller class is defined in **[StoreController.java](../../src/main/java/org/openapitools/controller/StoreController.java)** + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](#placeOrder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +```java +Mono StoreController.deleteOrder(orderId) +``` + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**orderId** | `String` | ID of the order that needs to be deleted | + + + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: Not defined + + +# **getInventory** +```java +Mono> StoreController.getInventory() +``` + +Returns pet inventories by status + +Returns a map of status codes to quantities + + +### Return type +`Map<String, Integer>` + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/json` + + +# **getOrderById** +```java +Mono StoreController.getOrderById(orderId) +``` + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**orderId** | `Long` | ID of pet that needs to be fetched | + +### Return type +[**Order**](../../docs/models/Order.md) + + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **placeOrder** +```java +Mono StoreController.placeOrder(order) +``` + +Place an order for a pet + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**order** | [**Order**](../../docs/models/Order.md) | order placed for purchasing the pet | + +### Return type +[**Order**](../../docs/models/Order.md) + + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: `application/xml`, `application/json` + diff --git a/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md b/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md new file mode 100644 index 0000000000..31012f2b44 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md @@ -0,0 +1,189 @@ +# UserController + +All URIs are relative to `"/v2"` + +The controller class is defined in **[UserController.java](../../src/main/java/org/openapitools/controller/UserController.java)** + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](#updateUser) | **PUT** /user/{username} | Updated user + + +# **createUser** +```java +Mono UserController.createUser(user) +``` + +Create user + +This can only be done by the logged in user. + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user** | [**User**](../../docs/models/User.md) | Created user object | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: Not defined + + +# **createUsersWithArrayInput** +```java +Mono UserController.createUsersWithArrayInput(user) +``` + +Creates list of users with given input array + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user** | [**List<User>**](../../docs/models/User.md) | List of user object | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: Not defined + + +# **createUsersWithListInput** +```java +Mono UserController.createUsersWithListInput(user) +``` + +Creates list of users with given input array + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user** | [**List<User>**](../../docs/models/User.md) | List of user object | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: Not defined + + +# **deleteUser** +```java +Mono UserController.deleteUser(username) +``` + +Delete user + +This can only be done by the logged in user. + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**username** | `String` | The name that needs to be deleted | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: Not defined + + +# **getUserByName** +```java +Mono UserController.getUserByName(username) +``` + +Get user by user name + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**username** | `String` | The name that needs to be fetched. Use user1 for testing. | + +### Return type +[**User**](../../docs/models/User.md) + + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **loginUser** +```java +Mono UserController.loginUser(usernamepassword) +``` + +Logs user into the system + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**username** | `String` | The user name for login | +**password** | `String` | The password for login in clear text | + +### Return type +`String` + + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **logoutUser** +```java +Mono UserController.logoutUser() +``` + +Logs out current logged in user session + + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: Not defined + + +# **updateUser** +```java +Mono UserController.updateUser(usernameuser) +``` + +Updated user + +This can only be done by the logged in user. + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**username** | `String` | name that need to be deleted | +**user** | [**User**](../../docs/models/User.md) | Updated user object | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: Not defined + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/Category.md b/samples/server/petstore/java-micronaut-server/docs/models/Category.md new file mode 100644 index 0000000000..65cdd608ad --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/Category.md @@ -0,0 +1,18 @@ + + +# Category + +A category for a pet + +The class is defined in **[Category.java](../../src/main/java/org/openapitools/model/Category.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**name** | `String` | | [optional property] + + + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/ModelApiResponse.md b/samples/server/petstore/java-micronaut-server/docs/models/ModelApiResponse.md new file mode 100644 index 0000000000..be3226fa26 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/ModelApiResponse.md @@ -0,0 +1,20 @@ + + +# ModelApiResponse + +Describes the result of uploading an image resource + +The class is defined in **[ModelApiResponse.java](../../src/main/java/org/openapitools/model/ModelApiResponse.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | `Integer` | | [optional property] +**type** | `String` | | [optional property] +**message** | `String` | | [optional property] + + + + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/Order.md b/samples/server/petstore/java-micronaut-server/docs/models/Order.md new file mode 100644 index 0000000000..b514feb22d --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/Order.md @@ -0,0 +1,33 @@ + + +# Order + +An order for a pets from the pet store + +The class is defined in **[Order.java](../../src/main/java/org/openapitools/model/Order.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**petId** | `Long` | | [optional property] +**quantity** | `Integer` | | [optional property] +**shipDate** | `LocalDateTime` | | [optional property] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional property] +**complete** | `Boolean` | | [optional property] + + + + + +## StatusEnum + +Name | Value +---- | ----- +PLACED | `"placed"` +APPROVED | `"approved"` +DELIVERED | `"delivered"` + + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/Pet.md b/samples/server/petstore/java-micronaut-server/docs/models/Pet.md new file mode 100644 index 0000000000..9f8876b0df --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/Pet.md @@ -0,0 +1,33 @@ + + +# Pet + +A pet for sale in the pet store + +The class is defined in **[Pet.java](../../src/main/java/org/openapitools/model/Pet.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**category** | [`Category`](Category.md) | | [optional property] +**name** | `String` | | +**photoUrls** | `List<String>` | | +**tags** | [`List<Tag>`](Tag.md) | | [optional property] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional property] + + + + + + +## StatusEnum + +Name | Value +---- | ----- +AVAILABLE | `"available"` +PENDING | `"pending"` +SOLD | `"sold"` + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/Tag.md b/samples/server/petstore/java-micronaut-server/docs/models/Tag.md new file mode 100644 index 0000000000..557c72572a --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/Tag.md @@ -0,0 +1,18 @@ + + +# Tag + +A tag for a pet + +The class is defined in **[Tag.java](../../src/main/java/org/openapitools/model/Tag.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**name** | `String` | | [optional property] + + + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/User.md b/samples/server/petstore/java-micronaut-server/docs/models/User.md new file mode 100644 index 0000000000..dac90ef84e --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/User.md @@ -0,0 +1,30 @@ + + +# User + +A User who is purchasing from the pet store + +The class is defined in **[User.java](../../src/main/java/org/openapitools/model/User.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**username** | `String` | | [optional property] +**firstName** | `String` | | [optional property] +**lastName** | `String` | | [optional property] +**email** | `String` | | [optional property] +**password** | `String` | | [optional property] +**phone** | `String` | | [optional property] +**userStatus** | `Integer` | User Status | [optional property] + + + + + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/gradle.properties b/samples/server/petstore/java-micronaut-server/gradle.properties new file mode 100644 index 0000000000..70b9dde78f --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/gradle.properties @@ -0,0 +1 @@ +micronautVersion=3.2.6 \ No newline at end of file diff --git a/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.jar b/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..e69de29bb2 diff --git a/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.properties b/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..f2e1eb1fd4 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip diff --git a/samples/server/petstore/java-micronaut-server/gradlew b/samples/server/petstore/java-micronaut-server/gradlew new file mode 100644 index 0000000000..4f906e0c81 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/server/petstore/java-micronaut-server/gradlew.bat b/samples/server/petstore/java-micronaut-server/gradlew.bat new file mode 100644 index 0000000000..107acd32c4 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/server/petstore/java-micronaut-server/mvnw b/samples/server/petstore/java-micronaut-server/mvnw new file mode 100644 index 0000000000..a16b5431b4 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/samples/server/petstore/java-micronaut-server/mvnw.bat b/samples/server/petstore/java-micronaut-server/mvnw.bat new file mode 100644 index 0000000000..c8d43372c9 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/mvnw.bat @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/samples/server/petstore/java-micronaut-server/pom.xml b/samples/server/petstore/java-micronaut-server/pom.xml new file mode 100644 index 0000000000..71aee310ca --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/pom.xml @@ -0,0 +1,159 @@ + + + 4.0.0 + org.openapitools + petstore-micronaut-server + 1.0.0 + ${packaging} + + + io.micronaut + micronaut-parent + 3.2.6 + + + + jar + 1.8 + + + 3.2.6 + org.openapitools.Application + netty + 1.5.21 + + + + + central + https://repo.maven.apache.org/maven2 + + + + + + io.micronaut + micronaut-inject + compile + + + io.micronaut + micronaut-validation + compile + + + io.micronaut + micronaut-inject-groovy + test + + + org.spockframework + spock-core + test + + + org.codehaus.groovy + groovy-all + + + + + io.micronaut.test + micronaut-test-spock + test + + + io.micronaut + micronaut-http-client + compile + + + io.micronaut + micronaut-http-server-netty + compile + + + io.micronaut + micronaut-runtime + compile + + + io.micronaut.reactor + micronaut-reactor + compile + + + ch.qos.logback + logback-classic + runtime + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + + + io.micronaut.build + micronaut-maven-plugin + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + + + + io.micronaut + micronaut-http-validation + ${micronaut.version} + + + + -Amicronaut.processing.group=org.openapitools + -Amicronaut.processing.module=petstore-micronaut-server + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*Spec.* + **/*Test.* + + + + + + org.codehaus.gmavenplus + gmavenplus-plugin + 1.9.0 + + + + addSources + generateStubs + compile + removeStubs + addTestSources + generateTestStubs + compileTests + removeTestStubs + + + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/settings.gradle b/samples/server/petstore/java-micronaut-server/settings.gradle new file mode 100644 index 0000000000..f96ffa51ae --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-micronaut-server" \ No newline at end of file diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/Application.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/Application.java new file mode 100644 index 0000000000..54b6adc71e --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/Application.java @@ -0,0 +1,9 @@ +package org.openapitools; + +import io.micronaut.runtime.Micronaut; + +public class Application { + public static void main(String[] args) { + Micronaut.run(Application.class, args); + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java new file mode 100644 index 0000000000..330ee3b707 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java @@ -0,0 +1,286 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.controller; + +import io.micronaut.http.annotation.*; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.core.convert.format.Format; +import reactor.core.publisher.Mono; +import io.micronaut.http.multipart.CompletedFileUpload; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import javax.annotation.Generated; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Controller("${context-path}") +public class PetController { + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return Pet + */ + @ApiOperation( + value = "Add a new pet to the store", + nickname = "addPet", + response = Pet.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 405, message = "Invalid input")}) + @Post(uri="/pet") + @Produces(value = {"application/xml", "application/json"}) + @Consumes(value = {"application/json", "application/xml"}) + public Mono addPet( + @Body @NotNull @Valid Pet pet + ) { + // TODO implement addPet() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + */ + @ApiOperation( + value = "Deletes a pet", + nickname = "deletePet", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value")}) + @Delete(uri="/pet/{petId}") + @Produces(value = {}) + public Mono deletePet( + @PathVariable(value="petId") @NotNull Long petId, + @Header(value="api_key") @Nullable String apiKey + ) { + // TODO implement deletePet() body; + Mono result = Mono.empty(); + return result; + } + + /** + * 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> + */ + @ApiOperation( + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet.class, + responseContainer = "array", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "array"), + @ApiResponse(code = 400, message = "Invalid status value")}) + @Get(uri="/pet/findByStatus") + @Produces(value = {"application/xml", "application/json"}) + public Mono> findPetsByStatus( + @QueryValue(value="status") @NotNull List status + ) { + // TODO implement findPetsByStatus() body; + Mono> result = Mono.empty(); + return result; + } + + /** + * 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 List<Pet> + */ + @ApiOperation( + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet.class, + responseContainer = "array", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "array"), + @ApiResponse(code = 400, message = "Invalid tag value")}) + @Get(uri="/pet/findByTags") + @Produces(value = {"application/xml", "application/json"}) + public Mono> findPetsByTags( + @QueryValue(value="tags") @NotNull List tags + ) { + // TODO implement findPetsByTags() body; + Mono> result = Mono.empty(); + return result; + } + + /** + * Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return Pet + */ + @ApiOperation( + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet.class, + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found")}) + @Get(uri="/pet/{petId}") + @Produces(value = {"application/xml", "application/json"}) + public Mono getPetById( + @PathVariable(value="petId") @NotNull Long petId + ) { + // TODO implement getPetById() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return Pet + */ + @ApiOperation( + value = "Update an existing pet", + nickname = "updatePet", + response = Pet.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception")}) + @Put(uri="/pet") + @Produces(value = {"application/xml", "application/json"}) + @Consumes(value = {"application/json", "application/xml"}) + public Mono updatePet( + @Body @NotNull @Valid Pet pet + ) { + // TODO implement updatePet() body; + Mono result = Mono.empty(); + return result; + } + + /** + * 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) + */ + @ApiOperation( + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input")}) + @Post(uri="/pet/{petId}") + @Produces(value = {}) + @Consumes(value = {"application/x-www-form-urlencoded"}) + public Mono updatePetWithForm( + @PathVariable(value="petId") @NotNull Long petId, + @Nullable String name, + @Nullable String status + ) { + // TODO implement updatePetWithForm() body; + Mono result = Mono.empty(); + return result; + } + + /** + * 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 + */ + @ApiOperation( + value = "uploads an image", + nickname = "uploadFile", + response = ModelApiResponse.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)}) + @Post(uri="/pet/{petId}/uploadImage") + @Produces(value = {"application/json"}) + @Consumes(value = {"multipart/form-data"}) + public Mono uploadFile( + @PathVariable(value="petId") @NotNull Long petId, + @Nullable String additionalMetadata, + @Nullable CompletedFileUpload _file + ) { + // TODO implement uploadFile() body; + Mono result = Mono.empty(); + return result; + } +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java new file mode 100644 index 0000000000..3ae60165ca --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.controller; + +import io.micronaut.http.annotation.*; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.core.convert.format.Format; +import reactor.core.publisher.Mono; +import org.openapitools.model.Order; +import javax.annotation.Generated; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Controller("${context-path}") +public class StoreController { + /** + * 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) + */ + @ApiOperation( + value = "Delete purchase order by ID", + nickname = "deleteOrder", + notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found")}) + @Delete(uri="/store/order/{orderId}") + @Produces(value = {}) + public Mono deleteOrder( + @PathVariable(value="orderId") @NotNull String orderId + ) { + // TODO implement deleteOrder() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return Map<String, Integer> + */ + @ApiOperation( + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = Integer.class, + responseContainer = "map", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "map")}) + @Get(uri="/store/inventory") + @Produces(value = {"application/json"}) + public Mono> getInventory() { + // TODO implement getInventory() body; + Mono> result = Mono.empty(); + return result; + } + + /** + * 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 + */ + @ApiOperation( + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + response = Order.class, + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found")}) + @Get(uri="/store/order/{orderId}") + @Produces(value = {"application/xml", "application/json"}) + public Mono getOrderById( + @PathVariable(value="orderId") @NotNull @Min(1L) @Max(5L) Long orderId + ) { + // TODO implement getOrderById() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return Order + */ + @ApiOperation( + value = "Place an order for a pet", + nickname = "placeOrder", + response = Order.class, + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order")}) + @Post(uri="/store/order") + @Produces(value = {"application/xml", "application/json"}) + @Consumes(value = {"application/json"}) + public Mono placeOrder( + @Body @NotNull @Valid Order order + ) { + // TODO implement placeOrder() body; + Mono result = Mono.empty(); + return result; + } +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java new file mode 100644 index 0000000000..78adec9146 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.controller; + +import io.micronaut.http.annotation.*; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.core.convert.format.Format; +import reactor.core.publisher.Mono; +import java.time.LocalDateTime; +import org.openapitools.model.User; +import javax.annotation.Generated; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Controller("${context-path}") +public class UserController { + /** + * Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + */ + @ApiOperation( + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user.", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 0, message = "successful operation")}) + @Post(uri="/user") + @Produces(value = {}) + @Consumes(value = {"application/json"}) + public Mono createUser( + @Body @NotNull @Valid User user + ) { + // TODO implement createUser() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + */ + @ApiOperation( + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 0, message = "successful operation")}) + @Post(uri="/user/createWithArray") + @Produces(value = {}) + @Consumes(value = {"application/json"}) + public Mono createUsersWithArrayInput( + @Body @NotNull List user + ) { + // TODO implement createUsersWithArrayInput() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + */ + @ApiOperation( + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 0, message = "successful operation")}) + @Post(uri="/user/createWithList") + @Produces(value = {}) + @Consumes(value = {"application/json"}) + public Mono createUsersWithListInput( + @Body @NotNull List user + ) { + // TODO implement createUsersWithListInput() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + */ + @ApiOperation( + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user.", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found")}) + @Delete(uri="/user/{username}") + @Produces(value = {}) + public Mono deleteUser( + @PathVariable(value="username") @NotNull String username + ) { + // TODO implement deleteUser() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return User + */ + @ApiOperation( + value = "Get user by user name", + nickname = "getUserByName", + response = User.class, + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found")}) + @Get(uri="/user/{username}") + @Produces(value = {"application/xml", "application/json"}) + public Mono getUserByName( + @PathVariable(value="username") @NotNull String username + ) { + // TODO implement getUserByName() body; + Mono result = Mono.empty(); + return result; + } + + /** + * 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 + */ + @ApiOperation( + value = "Logs user into the system", + nickname = "loginUser", + response = String.class, + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied")}) + @Get(uri="/user/login") + @Produces(value = {"application/xml", "application/json"}) + public Mono loginUser( + @QueryValue(value="username") @NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") String username, + @QueryValue(value="password") @NotNull String password + ) { + // TODO implement loginUser() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Logs out current logged in user session + * + */ + @ApiOperation( + value = "Logs out current logged in user session", + nickname = "logoutUser", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 0, message = "successful operation")}) + @Get(uri="/user/logout") + @Produces(value = {}) + public Mono logoutUser() { + // TODO implement logoutUser() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + */ + @ApiOperation( + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user.", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found")}) + @Put(uri="/user/{username}") + @Produces(value = {}) + @Consumes(value = {"application/json"}) + public Mono updateUser( + @PathVariable(value="username") @NotNull String username, + @Body @NotNull @Valid User user + ) { + // TODO implement updateUser() body; + Mono result = Mono.empty(); + return result; + } +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 0000000000..e6a3f7e943 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * A category for a pet + */ +@ApiModel(description = "A category for a pet") +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) +@JsonTypeName("Category") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +public class Category { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public Category() { + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @Nullable + @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @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; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).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 "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 0000000000..6e4b2b0834 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * Describes the result of uploading an image resource + */ +@ApiModel(description = "Describes the result of uploading an image resource") +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) +@JsonTypeName("ApiResponse") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +public class ModelApiResponse { + public static final String JSON_PROPERTY_CODE = "code"; + private Integer code; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public ModelApiResponse() { + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).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 "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 0000000000..2ef8aa8285 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,285 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.LocalDateTime; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * An order for a pets from the pet store + */ +@ApiModel(description = "An order for a pets from the pet store") +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) +@JsonTypeName("Order") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +public class Order { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_PET_ID = "petId"; + private Long petId; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Integer quantity; + + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + private LocalDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_COMPLETE = "complete"; + private Boolean complete = false; + + public Order() { + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { + return petId; + } + + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { + return quantity; + } + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public LocalDateTime getShipDate() { + return shipDate; + } + + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public void setShipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @Nullable + @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { + return complete; + } + + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).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 "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 0000000000..a2625f7d89 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,302 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * A pet for sale in the pet store + */ +@ApiModel(description = "A pet for sale in the pet store") +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) +@JsonTypeName("Pet") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +public class Pet { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private Category category; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + private List photoUrls = new ArrayList(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + PENDING("pending"), + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public Pet(String name, List photoUrls) { + this.name = name; + this.photoUrls = photoUrls; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @Valid + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { + return photoUrls; + } + + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @Nullable + @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 0000000000..830c5ded13 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * A tag for a pet + */ +@ApiModel(description = "A tag for a pet") +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) +@JsonTypeName("Tag") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +public class Tag { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public Tag() { + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Tag 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; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).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 "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java new file mode 100644 index 0000000000..057e2f19d9 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,306 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * A User who is purchasing from the pet store + */ +@ApiModel(description = "A User who is purchasing from the pet store") +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) +@JsonTypeName("User") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +public class User { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PHONE = "phone"; + private String phone; + + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + private Integer userStatus; + + public User() { + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { + return firstName; + } + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { + return lastName; + } + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { + return phone; + } + + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @Nullable + @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { + return userStatus; + } + + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).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 "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/resources/application.yml b/samples/server/petstore/java-micronaut-server/src/main/resources/application.yml new file mode 100644 index 0000000000..932949d0b3 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/resources/application.yml @@ -0,0 +1,18 @@ +context-path: "/v2/" + +micronaut: + application: + name: petstore-micronaut-server + server: + port: 8080 + security: + # authentication: bearer | cookie | session | idtoken + +jackson: + serialization: + writeEnumsUsingToString: true + writeDatesAsTimestamps: false + deserialization: + readEnumsUsingToString: true + failOnUnknownProperties: false + failOnInvalidSubtype: false diff --git a/samples/server/petstore/java-micronaut-server/src/main/resources/logback.xml b/samples/server/petstore/java-micronaut-server/src/main/resources/logback.xml new file mode 100644 index 0000000000..8221870826 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/resources/logback.xml @@ -0,0 +1,15 @@ + + + + false + + + %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n + + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy new file mode 100644 index 0000000000..1a42ac43aa --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy @@ -0,0 +1,398 @@ +package org.openapitools.controller + +import io.micronaut.http.multipart.CompletedFileUpload +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet +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 PetController + */ +@MicronautTest +class PetControllerSpec extends Specification { + + @Inject + EmbeddedServer server + + @Inject + @Client('${context-path}') + HttpClient client + + @Inject + PetController controller + + /** + * This test is used to validate the implementation of addPet() method + * + * The method should: Add a new pet to the store + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'addPet() method test'() { + given: + Pet pet = new Pet('doggie', ['example']) + + when: + Pet result = controller.addPet(pet).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet' to the features of addPet() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'addPet() test with client through path /pet'() { + given: + Pet body = new Pet('doggie', ['example']) + var uri = UriTemplate.of('/pet').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Pet.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of deletePet() method + * + * The method should: Deletes a pet + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'deletePet() method test'() { + given: + Long petId = 56L + String apiKey = 'example' + + when: + controller.deletePet(petId, apiKey).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/{petId}' to the features of deletePet() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'deletePet() test with client through path /pet/{petId}'() { + given: + var uri = UriTemplate.of('/pet/{petId}').expand([ + // Fill in the path variables + 'petId': 56L + ]) + MutableHttpRequest request = HttpRequest.DELETE(uri) + .accept('application/json') + .header('api_key', 'example') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of findPetsByStatus() method + * + * The method should: Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'findPetsByStatus() method test'() { + given: + List status = ['available'] + + when: + List result = controller.findPetsByStatus(status).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/findByStatus' to the features of findPetsByStatus() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'findPetsByStatus() test with client through path /pet/findByStatus'() { + given: + var uri = UriTemplate.of('/pet/findByStatus').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + request.getParameters() + .add('status', ['available'].toString()) // The query parameter format should be csv + + when: + HttpResponse response = client.toBlocking().exchange(request, Argument.of(List.class, Pet.class)); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of findPetsByTags() method + * + * The method should: Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'findPetsByTags() method test'() { + given: + List tags = ['example'] + + when: + List result = controller.findPetsByTags(tags).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/findByTags' to the features of findPetsByTags() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'findPetsByTags() test with client through path /pet/findByTags'() { + given: + var uri = UriTemplate.of('/pet/findByTags').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + request.getParameters() + .add('tags', ['example'].toString()) // The query parameter format should be csv + + when: + HttpResponse response = client.toBlocking().exchange(request, Argument.of(List.class, Pet.class)); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of getPetById() method + * + * The method should: Find pet by ID + * + * Returns a single pet + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'getPetById() method test'() { + given: + Long petId = 56L + + when: + Pet result = controller.getPetById(petId).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/{petId}' to the features of getPetById() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'getPetById() test with client through path /pet/{petId}'() { + given: + var uri = UriTemplate.of('/pet/{petId}').expand([ + // Fill in the path variables + 'petId': 56L + ]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Pet.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of updatePet() method + * + * The method should: Update an existing pet + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'updatePet() method test'() { + given: + Pet pet = new Pet('doggie', ['example']) + + when: + Pet result = controller.updatePet(pet).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet' to the features of updatePet() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'updatePet() test with client through path /pet'() { + given: + Pet body = new Pet('doggie', ['example']) + var uri = UriTemplate.of('/pet').expand([:]) + MutableHttpRequest request = HttpRequest.PUT(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Pet.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of updatePetWithForm() method + * + * The method should: Updates a pet in the store with form data + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'updatePetWithForm() method test'() { + given: + Long petId = 56L + String name = 'example' + String status = 'example' + + when: + controller.updatePetWithForm(petId, name, status).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/{petId}' to the features of updatePetWithForm() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'updatePetWithForm() test with client through path /pet/{petId}'() { + given: + var form = [ + // Fill in the body form parameters + 'name': 'example', + 'status': 'example' + ] + var uri = UriTemplate.of('/pet/{petId}').expand([ + // Fill in the path variables + 'petId': 56L + ]) + MutableHttpRequest request = HttpRequest.POST(uri, form) + .contentType('application/x-www-form-urlencoded') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of uploadFile() method + * + * The method should: uploads an image + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'uploadFile() method test'() { + given: + Long petId = 56L + String additionalMetadata = 'example' + CompletedFileUpload file = null + + when: + ModelApiResponse result = controller.uploadFile(petId, additionalMetadata, file).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/{petId}/uploadImage' to the features of uploadFile() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'uploadFile() test with client through path /pet/{petId}/uploadImage'() { + given: + var body = MultipartBody.builder() // Create multipart body + .addPart('additionalMetadata', 'example') + .addPart('file', 'filename', File.createTempFile('test', '.tmp')) + .build() + var uri = UriTemplate.of('/pet/{petId}/uploadImage').expand([ + // Fill in the path variables + 'petId': 56L + ]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('multipart/form-data') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, ModelApiResponse.class); + + then: + response.status() == HttpStatus.OK + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/StoreControllerSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/StoreControllerSpec.groovy new file mode 100644 index 0000000000..4af6ebffac --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/StoreControllerSpec.groovy @@ -0,0 +1,210 @@ +package org.openapitools.controller + +import org.openapitools.model.Order +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 StoreController + */ +@MicronautTest +class StoreControllerSpec extends Specification { + + @Inject + EmbeddedServer server + + @Inject + @Client('${context-path}') + HttpClient client + + @Inject + StoreController controller + + /** + * This test is used to validate the implementation of deleteOrder() method + * + * The method should: Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'deleteOrder() method test'() { + given: + String orderId = 'example' + + when: + controller.deleteOrder(orderId).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/store/order/{orderId}' to the features of deleteOrder() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'deleteOrder() test with client through path /store/order/{orderId}'() { + given: + var uri = UriTemplate.of('/store/order/{orderId}').expand([ + // Fill in the path variables + 'orderId': 'example' + ]) + MutableHttpRequest request = HttpRequest.DELETE(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of getInventory() method + * + * The method should: Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'getInventory() method test'() { + given: + + when: + Map result = controller.getInventory().block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/store/inventory' to the features of getInventory() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'getInventory() test with client through path /store/inventory'() { + given: + var uri = UriTemplate.of('/store/inventory').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Argument.of(Map.class, String.class, Integer.class)); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of getOrderById() method + * + * The method should: Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'getOrderById() method test'() { + given: + Long orderId = 56L + + when: + Order result = controller.getOrderById(orderId).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/store/order/{orderId}' to the features of getOrderById() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'getOrderById() test with client through path /store/order/{orderId}'() { + given: + var uri = UriTemplate.of('/store/order/{orderId}').expand([ + // Fill in the path variables + 'orderId': 56L + ]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Order.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of placeOrder() method + * + * The method should: Place an order for a pet + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'placeOrder() method test'() { + given: + Order order = new Order() + + when: + Order result = controller.placeOrder(order).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/store/order' to the features of placeOrder() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'placeOrder() test with client through path /store/order'() { + given: + Order body = new Order() + var uri = UriTemplate.of('/store/order').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Order.class); + + then: + response.status() == HttpStatus.OK + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/UserControllerSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/UserControllerSpec.groovy new file mode 100644 index 0000000000..59940a3b5a --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/UserControllerSpec.groovy @@ -0,0 +1,381 @@ +package org.openapitools.controller + +import java.time.LocalDateTime +import org.openapitools.model.User +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 UserController + */ +@MicronautTest +class UserControllerSpec extends Specification { + + @Inject + EmbeddedServer server + + @Inject + @Client('${context-path}') + HttpClient client + + @Inject + UserController controller + + /** + * This test is used to validate the implementation of createUser() method + * + * The method should: Create user + * + * This can only be done by the logged in user. + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'createUser() method test'() { + given: + User user = new User() + + when: + controller.createUser(user).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user' to the features of createUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'createUser() test with client through path /user'() { + given: + User body = new User() + var uri = UriTemplate.of('/user').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of createUsersWithArrayInput() method + * + * The method should: Creates list of users with given input array + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'createUsersWithArrayInput() method test'() { + given: + List user = [] + + when: + controller.createUsersWithArrayInput(user).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/createWithArray' to the features of createUsersWithArrayInput() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'createUsersWithArrayInput() test with client through path /user/createWithArray'() { + given: + List body = [] + var uri = UriTemplate.of('/user/createWithArray').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of createUsersWithListInput() method + * + * The method should: Creates list of users with given input array + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'createUsersWithListInput() method test'() { + given: + List user = [] + + when: + controller.createUsersWithListInput(user).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/createWithList' to the features of createUsersWithListInput() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'createUsersWithListInput() test with client through path /user/createWithList'() { + given: + List body = [] + var uri = UriTemplate.of('/user/createWithList').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of deleteUser() method + * + * The method should: Delete user + * + * This can only be done by the logged in user. + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'deleteUser() method test'() { + given: + String username = 'example' + + when: + controller.deleteUser(username).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/{username}' to the features of deleteUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'deleteUser() test with client through path /user/{username}'() { + given: + var uri = UriTemplate.of('/user/{username}').expand([ + // Fill in the path variables + 'username': 'example' + ]) + MutableHttpRequest request = HttpRequest.DELETE(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of getUserByName() method + * + * The method should: Get user by user name + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'getUserByName() method test'() { + given: + String username = 'example' + + when: + User result = controller.getUserByName(username).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/{username}' to the features of getUserByName() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'getUserByName() test with client through path /user/{username}'() { + given: + var uri = UriTemplate.of('/user/{username}').expand([ + // Fill in the path variables + 'username': 'example' + ]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, User.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of loginUser() method + * + * The method should: Logs user into the system + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'loginUser() method test'() { + given: + String username = 'example' + String password = 'example' + + when: + String result = controller.loginUser(username, password).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/login' to the features of loginUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'loginUser() test with client through path /user/login'() { + given: + var uri = UriTemplate.of('/user/login').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + request.getParameters() + .add('username', 'example') + .add('password', 'example') + + when: + HttpResponse response = client.toBlocking().exchange(request, String.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of logoutUser() method + * + * The method should: Logs out current logged in user session + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'logoutUser() method test'() { + given: + + when: + controller.logoutUser().block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/logout' to the features of logoutUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'logoutUser() test with client through path /user/logout'() { + given: + var uri = UriTemplate.of('/user/logout').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of updateUser() method + * + * The method should: Updated user + * + * This can only be done by the logged in user. + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'updateUser() method test'() { + given: + String username = 'example' + User user = new User() + + when: + controller.updateUser(username, user).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/{username}' to the features of updateUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'updateUser() test with client through path /user/{username}'() { + given: + User body = new User() + var uri = UriTemplate.of('/user/{username}').expand([ + // Fill in the path variables + 'username': 'example' + ]) + MutableHttpRequest request = HttpRequest.PUT(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/CategorySpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/CategorySpec.groovy new file mode 100644 index 0000000000..09ea5aea6b --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/CategorySpec.groovy @@ -0,0 +1,37 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for Category + */ +@MicronautTest +public class CategorySpec extends Specification { + private final Category model = null + + /** + * Model tests for Category + */ + void 'Category test'() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + void 'Category property id test'() { + // TODO: test id property of Category + } + + /** + * Test the property 'name' + */ + void 'Category property name test'() { + // TODO: test name property of Category + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/ModelApiResponseSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/ModelApiResponseSpec.groovy new file mode 100644 index 0000000000..11581554b2 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/ModelApiResponseSpec.groovy @@ -0,0 +1,44 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for ModelApiResponse + */ +@MicronautTest +public class ModelApiResponseSpec extends Specification { + private final ModelApiResponse model = null + + /** + * Model tests for ModelApiResponse + */ + void 'ModelApiResponse test'() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + void 'ModelApiResponse property code test'() { + // TODO: test code property of ModelApiResponse + } + + /** + * Test the property 'type' + */ + void 'ModelApiResponse property type test'() { + // TODO: test type property of ModelApiResponse + } + + /** + * Test the property 'message' + */ + void 'ModelApiResponse property message test'() { + // TODO: test message property of ModelApiResponse + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/OrderSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/OrderSpec.groovy new file mode 100644 index 0000000000..f49fd81a9a --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/OrderSpec.groovy @@ -0,0 +1,66 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import java.time.LocalDateTime +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for Order + */ +@MicronautTest +public class OrderSpec extends Specification { + private final Order model = null + + /** + * Model tests for Order + */ + void 'Order test'() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + void 'Order property id test'() { + // TODO: test id property of Order + } + + /** + * Test the property 'petId' + */ + void 'Order property petId test'() { + // TODO: test petId property of Order + } + + /** + * Test the property 'quantity' + */ + void 'Order property quantity test'() { + // TODO: test quantity property of Order + } + + /** + * Test the property 'shipDate' + */ + void 'Order property shipDate test'() { + // TODO: test shipDate property of Order + } + + /** + * Test the property 'status' + */ + void 'Order property status test'() { + // TODO: test status property of Order + } + + /** + * Test the property 'complete' + */ + void 'Order property complete test'() { + // TODO: test complete property of Order + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/PetSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/PetSpec.groovy new file mode 100644 index 0000000000..87de485ec4 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/PetSpec.groovy @@ -0,0 +1,69 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import java.util.ArrayList +import java.util.List +import org.openapitools.model.Category +import org.openapitools.model.Tag +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for Pet + */ +@MicronautTest +public class PetSpec extends Specification { + private final Pet model = null + + /** + * Model tests for Pet + */ + void 'Pet test'() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + void 'Pet property id test'() { + // TODO: test id property of Pet + } + + /** + * Test the property 'category' + */ + void 'Pet property category test'() { + // TODO: test category property of Pet + } + + /** + * Test the property 'name' + */ + void 'Pet property name test'() { + // TODO: test name property of Pet + } + + /** + * Test the property 'photoUrls' + */ + void 'Pet property photoUrls test'() { + // TODO: test photoUrls property of Pet + } + + /** + * Test the property 'tags' + */ + void 'Pet property tags test'() { + // TODO: test tags property of Pet + } + + /** + * Test the property 'status' + */ + void 'Pet property status test'() { + // TODO: test status property of Pet + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/TagSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/TagSpec.groovy new file mode 100644 index 0000000000..23208c3464 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/TagSpec.groovy @@ -0,0 +1,37 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for Tag + */ +@MicronautTest +public class TagSpec extends Specification { + private final Tag model = null + + /** + * Model tests for Tag + */ + void 'Tag test'() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + void 'Tag property id test'() { + // TODO: test id property of Tag + } + + /** + * Test the property 'name' + */ + void 'Tag property name test'() { + // TODO: test name property of Tag + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/UserSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/UserSpec.groovy new file mode 100644 index 0000000000..c3060a006b --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/UserSpec.groovy @@ -0,0 +1,79 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for User + */ +@MicronautTest +public class UserSpec extends Specification { + private final User model = null + + /** + * Model tests for User + */ + void 'User test'() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + void 'User property id test'() { + // TODO: test id property of User + } + + /** + * Test the property 'username' + */ + void 'User property username test'() { + // TODO: test username property of User + } + + /** + * Test the property 'firstName' + */ + void 'User property firstName test'() { + // TODO: test firstName property of User + } + + /** + * Test the property 'lastName' + */ + void 'User property lastName test'() { + // TODO: test lastName property of User + } + + /** + * Test the property 'email' + */ + void 'User property email test'() { + // TODO: test email property of User + } + + /** + * Test the property 'password' + */ + void 'User property password test'() { + // TODO: test password property of User + } + + /** + * Test the property 'phone' + */ + void 'User property phone test'() { + // TODO: test phone property of User + } + + /** + * Test the property 'userStatus' + */ + void 'User property userStatus test'() { + // TODO: test userStatus property of User + } + +}