├── .editorconfig
├── .gitattributes
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.yaml
│ ├── config.yml
│ ├── new_feature.yaml
│ └── other.yaml
├── release.yml
├── renovate.json
└── workflows
│ ├── central-sync.yml
│ ├── graalvm-dev.yml
│ ├── graalvm-latest.yml
│ ├── gradle.yml
│ ├── publish-snapshot.yml
│ └── release.yml
├── .gitignore
├── ISSUE_TEMPLATE.md
├── LICENSE
├── MAINTAINING.md
├── README.md
├── SECURITY.md
├── build-logic
├── build.gradle
├── settings.gradle
└── src
│ └── main
│ └── groovy
│ ├── io.micronaut.build.internal.openapi-base.gradle
│ ├── io.micronaut.build.internal.openapi-java-generator-test-suite.gradle
│ ├── io.micronaut.build.internal.openapi-kotlin-kapt-generator-test-suite.gradle
│ ├── io.micronaut.build.internal.openapi-kotlin-ksp-generator-test-suite.gradle
│ ├── io.micronaut.build.internal.openapi-module.gradle
│ ├── io.micronaut.build.internal.openapi-simple-module.gradle
│ ├── io.micronaut.build.internal.openapi-test-java.gradle
│ └── io
│ └── micronaut
│ └── build
│ └── internal
│ └── openapi
│ ├── OpenApiGeneratorTask.java
│ └── RemoteDownloadTask.java
├── build.gradle
├── config
├── HEADER
├── accepted-api-changes.json
├── checkstyle
│ ├── HEADER
│ ├── checkstyle.xml
│ ├── custom-suppressions.xml
│ └── suppressions.xml
└── spotless.license.java
├── docs-examples
├── example-groovy
│ ├── build.gradle
│ └── src
│ │ └── test
│ │ ├── groovy
│ │ └── io
│ │ │ └── micronaut
│ │ │ └── configuration
│ │ │ └── openapi
│ │ │ └── docs
│ │ │ ├── Application.groovy
│ │ │ └── controllers
│ │ │ ├── HelloController.groovy
│ │ │ └── annotations
│ │ │ └── HelloController.groovy
│ │ └── resources
│ │ └── logback.xml
├── example-java
│ ├── build.gradle
│ └── src
│ │ └── test
│ │ ├── java
│ │ └── io
│ │ │ └── micronaut
│ │ │ └── configuration
│ │ │ └── openapi
│ │ │ └── docs
│ │ │ ├── Application.java
│ │ │ └── controllers
│ │ │ ├── HelloController.java
│ │ │ └── annotations
│ │ │ └── HelloController.java
│ │ └── resources
│ │ └── logback.xml
└── example-kotlin
│ ├── .kotlintest
│ └── spec_failures
│ ├── build.gradle
│ └── src
│ └── test
│ ├── kotlin
│ └── io
│ │ └── micronaut
│ │ └── configuration
│ │ └── openapi
│ │ └── docs
│ │ ├── Application.kt
│ │ └── controllers
│ │ ├── HelloController.kt
│ │ └── annotations
│ │ └── HelloController.kt
│ └── resources
│ └── logback.xml
├── gradle.properties
├── gradle
├── libs.versions.toml
├── license.gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── openapi-adoc
├── build.gradle
└── src
│ ├── main
│ ├── java
│ │ └── io
│ │ │ └── micronaut
│ │ │ └── openapi
│ │ │ └── adoc
│ │ │ ├── OpenApiToAdocConfigProperty.java
│ │ │ ├── OpenApiToAdocConverter.java
│ │ │ ├── TemplatePaths.java
│ │ │ ├── md
│ │ │ ├── MdToAdocConverter.java
│ │ │ ├── TableToAsciiDoc.java
│ │ │ └── ToAsciiDocSerializer.java
│ │ │ └── utils
│ │ │ ├── CollectionUtils.java
│ │ │ ├── FileUtils.java
│ │ │ └── SwaggerUtils.java
│ └── resources
│ │ └── template
│ │ ├── content.ftl
│ │ ├── definitions.ftl
│ │ ├── examples.ftl
│ │ ├── externalDocs.ftl
│ │ ├── headers.ftl
│ │ ├── links.ftl
│ │ ├── openApiDoc.ftl
│ │ ├── overview.ftl
│ │ ├── parameters.ftl
│ │ ├── paths.ftl
│ │ ├── properties.ftl
│ │ ├── propertyDescription.ftl
│ │ ├── requestBody.ftl
│ │ ├── responses.ftl
│ │ ├── schemaType.ftl
│ │ ├── securityRequirements.ftl
│ │ └── servers.ftl
│ └── test
│ ├── java
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── adoc
│ │ └── OpenApiToAdocConverterTest.java
│ └── resources
│ ├── customDir
│ └── links1.ftl
│ └── yaml
│ └── swagger_petstore.yaml
├── openapi-annotations
├── build.gradle
└── src
│ └── main
│ └── java
│ └── io
│ └── micronaut
│ └── openapi
│ └── annotation
│ ├── OpenAPIDecorator.java
│ ├── OpenAPIExtraSchema.java
│ ├── OpenAPIExtraSchemas.java
│ ├── OpenAPIGroup.java
│ ├── OpenAPIGroupInfo.java
│ ├── OpenAPIGroupInfos.java
│ ├── OpenAPIGroups.java
│ ├── OpenAPIInclude.java
│ ├── OpenAPIIncludes.java
│ ├── OpenAPIManagement.java
│ └── OpenAPISecurity.java
├── openapi-bom
└── build.gradle
├── openapi-common
├── build.gradle
└── src
│ └── main
│ └── java
│ └── io
│ └── micronaut
│ └── openapi
│ ├── OpenApiUtils.java
│ ├── SimpleSchema.java
│ └── swagger
│ └── core
│ ├── jackson
│ ├── ApiResponsesSerializer.java
│ ├── CallbackSerializer.java
│ ├── ExampleSerializer.java
│ ├── MediaTypeSerializer.java
│ ├── PathsSerializer.java
│ ├── Schema31Serializer.java
│ ├── SchemaSerializer.java
│ └── mixin
│ │ ├── Components31Mixin.java
│ │ ├── ComponentsMixin.java
│ │ ├── DateSchemaMixin.java
│ │ ├── Discriminator31Mixin.java
│ │ ├── DiscriminatorMixin.java
│ │ ├── ExampleMixin.java
│ │ ├── ExtensionsMixin.java
│ │ ├── Info31Mixin.java
│ │ ├── InfoMixin.java
│ │ ├── LicenseMixin.java
│ │ ├── MediaTypeMixin.java
│ │ ├── OpenAPI31Mixin.java
│ │ ├── OpenAPIMixin.java
│ │ ├── OperationMixin.java
│ │ ├── Schema31Mixin.java
│ │ ├── SchemaConverterMixin.java
│ │ └── SchemaMixin.java
│ └── util
│ ├── ApiResponses31Deserializer.java
│ ├── ApiResponsesDeserializer.java
│ ├── Callback31Deserializer.java
│ ├── CallbackDeserializer.java
│ ├── DeserializationModule.java
│ ├── DeserializationModule31.java
│ ├── EncodingPropertyStyleEnumDeserializer.java
│ ├── EncodingStyleEnumDeserializer.java
│ ├── HeaderStyleEnumDeserializer.java
│ ├── Model31Deserializer.java
│ ├── ModelDeserializer.java
│ ├── ObjectMapperFactory.java
│ ├── OpenAPI31Deserializer.java
│ ├── Parameter31Deserializer.java
│ ├── ParameterDeserializer.java
│ ├── Paths31Deserializer.java
│ ├── PathsDeserializer.java
│ ├── PrimitiveType.java
│ ├── SecurityScheme31Deserializer.java
│ └── SecuritySchemeDeserializer.java
├── openapi-generator
├── build.gradle
└── src
│ ├── main
│ ├── java
│ │ ├── io
│ │ │ └── micronaut
│ │ │ │ └── openapi
│ │ │ │ └── generator
│ │ │ │ ├── AbstractMicronautJavaCodegen.java
│ │ │ │ ├── AbstractMicronautKotlinCodegen.java
│ │ │ │ ├── AuthFilterPatternStyle.java
│ │ │ │ ├── Formatting.java
│ │ │ │ ├── GeneratorOptionsBuilder.java
│ │ │ │ ├── JavaMicronautClientCodegen.java
│ │ │ │ ├── JavaMicronautClientOptionsBuilder.java
│ │ │ │ ├── JavaMicronautServerCodegen.java
│ │ │ │ ├── JavaMicronautServerOptionsBuilder.java
│ │ │ │ ├── KotlinMicronautClientCodegen.java
│ │ │ │ ├── KotlinMicronautClientOptionsBuilder.java
│ │ │ │ ├── KotlinMicronautServerCodegen.java
│ │ │ │ ├── KotlinMicronautServerOptionsBuilder.java
│ │ │ │ ├── MicronautCodeGenerator.java
│ │ │ │ ├── MicronautCodeGeneratorBuilder.java
│ │ │ │ ├── MicronautCodeGeneratorEntryPoint.java
│ │ │ │ ├── MicronautCodeGeneratorOptionsBuilder.java
│ │ │ │ ├── MicronautInlineModelResolver.java
│ │ │ │ ├── MnSchemaTypeUtil.java
│ │ │ │ ├── ParameterMapping.java
│ │ │ │ ├── ResponseBodyMapping.java
│ │ │ │ ├── SerializationLibraryKind.java
│ │ │ │ └── Utils.java
│ │ └── org
│ │ │ └── openapitools
│ │ │ └── codegen
│ │ │ ├── DefaultCodegen.java
│ │ │ └── DefaultGenerator.java
│ └── resources
│ │ └── templates
│ │ ├── java-micronaut
│ │ ├── client
│ │ │ ├── api.mustache
│ │ │ ├── auth
│ │ │ │ ├── Authorization.mustache
│ │ │ │ ├── AuthorizationBinder.mustache
│ │ │ │ ├── AuthorizationFilter.mustache
│ │ │ │ ├── Authorizations.mustache
│ │ │ │ └── config
│ │ │ │ │ ├── ApiKeyAuthConfig.mustache
│ │ │ │ │ ├── ConfigurableAuthorization.mustache
│ │ │ │ │ └── HttpBasicAuthConfig.mustache
│ │ │ ├── doc
│ │ │ │ ├── README.mustache
│ │ │ │ ├── api_doc.mustache
│ │ │ │ └── auth.mustache
│ │ │ ├── params
│ │ │ │ ├── bodyParams.mustache
│ │ │ │ ├── cookieParams.mustache
│ │ │ │ ├── formParams.mustache
│ │ │ │ ├── headerParams.mustache
│ │ │ │ ├── pathParams.mustache
│ │ │ │ ├── queryParams.mustache
│ │ │ │ └── type.mustache
│ │ │ └── test
│ │ │ │ ├── api_test.groovy.mustache
│ │ │ │ └── api_test.mustache
│ │ ├── common
│ │ │ ├── EnumConverterConfig.mustache
│ │ │ ├── configuration
│ │ │ │ ├── Application.mustache
│ │ │ │ ├── application.yml.mustache
│ │ │ │ └── logback.xml.mustache
│ │ │ ├── doc
│ │ │ │ ├── enum_outer_doc.mustache
│ │ │ │ ├── model_doc.mustache
│ │ │ │ └── pojo_doc.mustache
│ │ │ ├── generatedAnnotation.mustache
│ │ │ ├── licenseInfo.mustache
│ │ │ ├── model
│ │ │ │ ├── enum.mustache
│ │ │ │ ├── enumName.mustache
│ │ │ │ ├── jackson_annotations.mustache
│ │ │ │ ├── model.mustache
│ │ │ │ ├── oneof_interface.mustache
│ │ │ │ ├── permits.mustache
│ │ │ │ ├── pojo.mustache
│ │ │ │ ├── sealed.mustache
│ │ │ │ ├── typeInfoAnnotation.mustache
│ │ │ │ └── xmlAnnotation.mustache
│ │ │ ├── operationAnnotations.mustache
│ │ │ ├── params
│ │ │ │ └── validation.mustache
│ │ │ └── test
│ │ │ │ ├── model_test.groovy.mustache
│ │ │ │ └── model_test.mustache
│ │ └── server
│ │ │ ├── controller-implementation.mustache
│ │ │ ├── controller-interface.mustache
│ │ │ ├── controllerOperationBody.mustache
│ │ │ ├── doc
│ │ │ ├── README.mustache
│ │ │ └── controller_doc.mustache
│ │ │ ├── params
│ │ │ ├── annotations.mustache
│ │ │ └── type.mustache
│ │ │ └── test
│ │ │ ├── controller_test.groovy.mustache
│ │ │ └── controller_test.mustache
│ │ └── kotlin-micronaut
│ │ ├── client
│ │ ├── api.mustache
│ │ ├── auth
│ │ │ ├── Authorization.mustache
│ │ │ ├── AuthorizationBinder.mustache
│ │ │ ├── AuthorizationFilter.mustache
│ │ │ ├── Authorizations.mustache
│ │ │ └── config
│ │ │ │ ├── ApiKeyAuthConfig.mustache
│ │ │ │ ├── ConfigurableAuthorization.mustache
│ │ │ │ └── HttpBasicAuthConfig.mustache
│ │ ├── doc
│ │ │ ├── README.mustache
│ │ │ ├── api_doc.mustache
│ │ │ └── auth.mustache
│ │ ├── params
│ │ │ ├── bodyParams.mustache
│ │ │ ├── cookieParams.mustache
│ │ │ ├── formParams.mustache
│ │ │ ├── headerParams.mustache
│ │ │ ├── pathParams.mustache
│ │ │ ├── queryParams.mustache
│ │ │ └── type.mustache
│ │ └── test
│ │ │ └── api_test.mustache
│ │ ├── common
│ │ ├── EnumConverterConfig.mustache
│ │ ├── configuration
│ │ │ ├── Application.mustache
│ │ │ ├── application.yml.mustache
│ │ │ └── logback.xml.mustache
│ │ ├── doc
│ │ │ ├── enum_outer_doc.mustache
│ │ │ ├── model_doc.mustache
│ │ │ └── pojo_doc.mustache
│ │ ├── generatedAnnotation.mustache
│ │ ├── licenseInfo.mustache
│ │ ├── model
│ │ │ ├── enum.mustache
│ │ │ ├── enumName.mustache
│ │ │ ├── field_annotations.mustache
│ │ │ ├── jackson_annotations.mustache
│ │ │ ├── model.mustache
│ │ │ ├── oneof_interface.mustache
│ │ │ ├── pojo.mustache
│ │ │ ├── typeInfoAnnotation.mustache
│ │ │ └── xmlAnnotation.mustache
│ │ ├── operationAnnotations.mustache
│ │ ├── params
│ │ │ ├── validation.mustache
│ │ │ └── validation_field.mustache
│ │ └── test
│ │ │ └── model_test.mustache
│ │ └── server
│ │ ├── controller-implementation.mustache
│ │ ├── controller-interface.mustache
│ │ ├── controllerOperationBody.mustache
│ │ ├── doc
│ │ ├── README.mustache
│ │ └── controller_doc.mustache
│ │ ├── params
│ │ └── annotations.mustache
│ │ └── test
│ │ └── controller_test.mustache
│ ├── test
│ ├── java
│ │ └── io
│ │ │ └── micronaut
│ │ │ └── openapi
│ │ │ └── generator
│ │ │ ├── AbstractMicronautCodegenTest.java
│ │ │ ├── JavaMicronautClientCodegenSerializationLibraryTest.java
│ │ │ ├── JavaMicronautClientCodegenTest.java
│ │ │ ├── JavaMicronautServerCodegenTest.java
│ │ │ ├── KotlinMicronautClientCodegenTest.java
│ │ │ ├── KotlinMicronautServerCodegenTest.java
│ │ │ ├── MicronautCodeGeneratorEntryPointTest.java
│ │ │ └── MicronautCodegenTest.java
│ └── resources
│ │ ├── 3_0
│ │ ├── 1794
│ │ │ ├── openapi.yml
│ │ │ ├── paths
│ │ │ │ └── invoice.yml
│ │ │ └── schemas
│ │ │ │ └── invoice.yml
│ │ ├── body-enum.yml
│ │ ├── check-equals.yml
│ │ ├── client-produces-content-type.yml
│ │ ├── controller-enum.yml
│ │ ├── controller-enum2.yml
│ │ ├── date-annotations.yml
│ │ ├── date-time-format.yml
│ │ ├── default-value-optional.yml
│ │ ├── deprecated.yml
│ │ ├── discriminator2.yml
│ │ ├── discriminatorconstructorbug.yml
│ │ ├── enum-implements.yml
│ │ ├── enum.yml
│ │ ├── enum2.yml
│ │ ├── extra-annotations.yml
│ │ ├── file-download.yml
│ │ ├── file.yml
│ │ ├── inner-enum.yml
│ │ ├── inputStream.yml
│ │ ├── issue_11772.yml
│ │ ├── issue_19393_map_of_inner_enum.yml
│ │ ├── javaReservedWords.yml
│ │ ├── json-include-always.yml
│ │ ├── kotlinReservedWords.yml
│ │ ├── library-definition.yml
│ │ ├── micronaut
│ │ │ ├── content-type.yml
│ │ │ ├── multi-tags-test.yml
│ │ │ ├── oauth2.yml
│ │ │ └── roles-extension-test.yml
│ │ ├── model-with-primitives.yml
│ │ ├── modelwithlist.yml
│ │ ├── modelwithprimitivelist.yml
│ │ ├── multipartdata.yml
│ │ ├── multiple-content-types.yml
│ │ ├── multiple
│ │ │ ├── paths
│ │ │ │ └── files.yml
│ │ │ ├── schemas
│ │ │ │ └── files.yml
│ │ │ └── swagger.yml
│ │ ├── oas.yml
│ │ ├── oneof-with-discriminator.yml
│ │ ├── oneof-with-discriminator2.yml
│ │ ├── oneof-without-discriminator.yml
│ │ ├── openapi-built-in-prefix.yml
│ │ ├── openmeteo.yml
│ │ ├── operation-with-desc.yml
│ │ ├── optional-controller-values.yml
│ │ ├── parameter-list-with-default-swagger2.yml
│ │ ├── parameter-list-with-default.yml
│ │ ├── params-with-default-value.yml
│ │ ├── params-with-style.yml
│ │ ├── plural.yml
│ │ ├── propWithSecondUpperCaseChar.yml
│ │ ├── readonlyconstructorbug.yml
│ │ ├── schema-with-uuid.yml
│ │ ├── sealed
│ │ │ ├── oneOf_additionalProperties.yml
│ │ │ ├── oneOf_array.yml
│ │ │ ├── oneOf_arrayMapImport.yml
│ │ │ ├── oneOf_discriminator.yml
│ │ │ ├── oneOf_duplicateArray.yml
│ │ │ ├── oneOf_nonPrimitive.yml
│ │ │ ├── oneOf_polymorphismAndInheritance.yml
│ │ │ ├── oneOf_primitive.yml
│ │ │ ├── oneOf_primitiveAndArray.yml
│ │ │ ├── oneOf_reuseRef.yml
│ │ │ └── oneOf_twoPrimitives.yml
│ │ ├── security.yml
│ │ ├── spec.yml
│ │ ├── test-override-discriminator.yml
│ │ ├── underscore.yml
│ │ └── validation-messages.yml
│ │ ├── logback.xml
│ │ ├── petstore.json
│ │ └── petstore.yml
│ └── testFixtures
│ └── java
│ └── io
│ └── micronaut
│ └── openapi
│ └── generator
│ └── assertions
│ ├── AbstractAnnotationAssert.java
│ ├── ConstructorAssert.java
│ ├── JavaFileAssert.java
│ ├── MethodAnnotationAssert.java
│ ├── MethodAssert.java
│ ├── ParameterAnnotationAssert.java
│ ├── ParameterAssert.java
│ ├── PropertyAnnotationAssert.java
│ ├── PropertyAssert.java
│ ├── TestUtils.java
│ ├── TypeAnnotationAssert.java
│ └── package-info.java
├── openapi
├── build.gradle
├── openapi-controller-custom-uri.properties
├── openapi-custom-endpoints.properties
├── openapi-custom-schema-for-class.properties
├── openapi-custom-schema-for-iterable-class.properties
├── openapi-disabled-openapi.properties
├── openapi-endpoints-with-groups.properties
├── openapi-endpoints.properties
├── openapi-placeholder-type.properties
├── openapi-placeholders.properties
├── openapi-schema-decorators.properties
└── src
│ ├── main
│ ├── java
│ │ └── io
│ │ │ └── micronaut
│ │ │ └── openapi
│ │ │ ├── annotation
│ │ │ ├── mappers
│ │ │ │ ├── OpenAPIManagementAnnotationMapper.java
│ │ │ │ └── OpenAPISecurityAnnotationMapper.java
│ │ │ └── transformers
│ │ │ │ ├── AbstractRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ApiResponseRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ApiResponsesRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ArraySchemaRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── CallbackRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── CallbacksRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ContactRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ContentRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── DependentRequiredMapRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── DependentRequiredRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── DependentSchemaRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── DependentSchemasRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── DiscriminatorMappingRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── EncodingRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ExampleObjectMappingRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ExtensionPropertyRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ExtensionRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ExtensionsRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ExternalDocumentationRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── HeaderRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── HiddenRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── InfoRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── LicenseRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── LinkParameterRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── LinkRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── OAuthFlowRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── OAuthFlowsRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── OAuthScopeRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── OpenAPIDefinitionRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── OperationRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ParameterRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ParametersRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── RequestBodyRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── SchemaRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── SecurityRequirementRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── SecurityRequirementsRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── SecuritySchemeRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── SecuritySchemesRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ServerRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ServerVariableRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── ServersRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── TagRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── TagsRetentionPolicyAnnotationTransformer.java
│ │ │ │ ├── WebhookRetentionPolicyAnnotationTransformer.java
│ │ │ │ └── WebhooksRetentionPolicyAnnotationTransformer.java
│ │ │ ├── introspections
│ │ │ ├── CallbackConfiguration.java
│ │ │ ├── ExampleConfiguration.java
│ │ │ ├── HeaderConfiguration.java
│ │ │ ├── InfoConfiguration.java
│ │ │ ├── LinksConfiguration.java
│ │ │ ├── MediaConfiguration.java
│ │ │ ├── ModelConfiguration.java
│ │ │ ├── ParametersConfiguration.java
│ │ │ ├── ResponsesConfiguration.java
│ │ │ ├── SecurityConfiguration.java
│ │ │ ├── ServerConfiguration.java
│ │ │ └── TagsConfiguration.java
│ │ │ ├── javadoc
│ │ │ ├── JavadocDescription.java
│ │ │ └── JavadocParser.java
│ │ │ ├── postprocessors
│ │ │ ├── JacksonDiscriminatorPostProcessor.java
│ │ │ └── OpenApiOperationsPostProcessor.java
│ │ │ ├── view
│ │ │ ├── AbstractViewConfig.java
│ │ │ ├── OpenApiExplorerConfig.java
│ │ │ ├── OpenApiViewConfig.java
│ │ │ ├── RapiPDFConfig.java
│ │ │ ├── RapidocConfig.java
│ │ │ ├── RedocConfig.java
│ │ │ ├── ScalarConfig.java
│ │ │ └── SwaggerUIConfig.java
│ │ │ └── visitor
│ │ │ ├── AbstractOpenApiEndpointVisitor.java
│ │ │ ├── AbstractOpenApiVisitor.java
│ │ │ ├── AdocModule.java
│ │ │ ├── AnnProcessorEnvironment.java
│ │ │ ├── ConfigUtils.java
│ │ │ ├── ContextProperty.java
│ │ │ ├── ContextUtils.java
│ │ │ ├── ConvertUtils.java
│ │ │ ├── ElementUtils.java
│ │ │ ├── FileUtils.java
│ │ │ ├── GeneratorExt.java
│ │ │ ├── GeneratorUtils.java
│ │ │ ├── GroupUtils.java
│ │ │ ├── InternalExt.java
│ │ │ ├── MnParamFormat.java
│ │ │ ├── NumberUtils.java
│ │ │ ├── OpenApiApplicationVisitor.java
│ │ │ ├── OpenApiConfigProperty.java
│ │ │ ├── OpenApiControllerVisitor.java
│ │ │ ├── OpenApiEndpointVisitor.java
│ │ │ ├── OpenApiExtraSchemaVisitor.java
│ │ │ ├── OpenApiGroupInfoVisitor.java
│ │ │ ├── OpenApiIncludeVisitor.java
│ │ │ ├── OpenApiJacksonVisitor.java
│ │ │ ├── OpenApiModelProp.java
│ │ │ ├── OpenApiNormalizeUtils.java
│ │ │ ├── Pair.java
│ │ │ ├── ParamUtils.java
│ │ │ ├── ProtoUtils.java
│ │ │ ├── SchemaDefinitionUtils.java
│ │ │ ├── SchemaUtils.java
│ │ │ ├── SecurityUtils.java
│ │ │ ├── StringUtil.java
│ │ │ ├── TagUtils.java
│ │ │ ├── UrlUtils.java
│ │ │ ├── Utils.java
│ │ │ ├── VisibilityLevel.java
│ │ │ ├── group
│ │ │ ├── EndpointGroupInfo.java
│ │ │ ├── EndpointInfo.java
│ │ │ ├── GroupProperties.java
│ │ │ ├── OpenApiInfo.java
│ │ │ └── RouterVersioningProperties.java
│ │ │ ├── management
│ │ │ ├── EndpointProperties.java
│ │ │ ├── EndpointUtils.java
│ │ │ ├── EndpointsConfig.java
│ │ │ ├── SpringActuatorConfigUtils.java
│ │ │ └── SpringActuatorProperties.java
│ │ │ ├── package-info.java
│ │ │ └── security
│ │ │ ├── InterceptUrlMapConverter.java
│ │ │ ├── InterceptUrlMapPattern.java
│ │ │ ├── SecurityProperties.java
│ │ │ └── SecurityRule.java
│ └── resources
│ │ ├── META-INF
│ │ └── services
│ │ │ ├── io.micronaut.inject.annotation.AnnotationMapper
│ │ │ ├── io.micronaut.inject.annotation.AnnotationTransformer
│ │ │ └── io.micronaut.inject.visitor.TypeElementVisitor
│ │ └── templates
│ │ ├── openapi-explorer
│ │ ├── index.html
│ │ └── res
│ │ │ ├── README.md
│ │ │ ├── bootstrap.min.css
│ │ │ ├── default.min.css
│ │ │ ├── font-awesome.min.css
│ │ │ └── highlight.min.js
│ │ ├── rapidoc
│ │ ├── index.html
│ │ └── res
│ │ │ └── README.md
│ │ ├── redoc
│ │ ├── index.html
│ │ └── res
│ │ │ └── README.md
│ │ ├── scalar
│ │ └── index.html
│ │ └── swagger-ui
│ │ ├── index.html
│ │ ├── oauth2-redirect.html
│ │ ├── res
│ │ ├── README.md
│ │ ├── favicon-16x16.png
│ │ ├── favicon-32x32.png
│ │ └── index.css
│ │ └── theme
│ │ ├── classic.css
│ │ ├── dark.css
│ │ ├── dark2.css
│ │ ├── feeling-blue.css
│ │ ├── flattop.css
│ │ ├── material.css
│ │ ├── monokai.css
│ │ ├── muted.css
│ │ ├── newspaper.css
│ │ └── outline.css
│ └── test
│ ├── groovy
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ ├── AbstractOpenApiTypeElementSpec.groovy
│ │ ├── JAXBElement.java
│ │ ├── MyJaxbElement.java
│ │ ├── MyJaxbElement2.java
│ │ ├── MyJaxbElement3.java
│ │ ├── MyJaxbElement4.java
│ │ ├── ObjectId.java
│ │ ├── PubGenObject.java
│ │ ├── SwaggerPage.java
│ │ ├── api
│ │ ├── v1_0_0
│ │ │ └── MyDto.java
│ │ └── v2_0_1
│ │ │ └── MyDto.java
│ │ ├── extra
│ │ ├── ExtraModel1.java
│ │ ├── ExtraModel2.java
│ │ └── internal
│ │ │ └── ExtraModelInternalPackage.java
│ │ ├── javadoc
│ │ └── JavadocParserSpec.groovy
│ │ ├── model
│ │ ├── one
│ │ │ └── Response.java
│ │ └── two
│ │ │ └── Response.java
│ │ ├── proto
│ │ ├── MyEnum.java
│ │ ├── ProductProto.java
│ │ ├── ProductProtoOrBuilder.java
│ │ ├── ProductsListProto.java
│ │ ├── ProductsListProtoOrBuilder.java
│ │ ├── ProductsProtos.java
│ │ ├── SubObjectProto.java
│ │ └── SubObjectProtoOrBuilder.java
│ │ ├── test1
│ │ ├── Entity.java
│ │ └── EntityWithGeneric.java
│ │ ├── test2
│ │ ├── Entity.java
│ │ └── EntityWithGeneric.java
│ │ ├── test3
│ │ ├── Entity.java
│ │ └── EntityWithGeneric.java
│ │ ├── view
│ │ ├── OpenApiOperationViewParseSpec.groovy
│ │ ├── OpenApiOperationViewRenderSpec.groovy
│ │ ├── OpenApiViewMultipleDocumentsSpec.groovy
│ │ └── OpenApiViewSpec.groovy
│ │ └── visitor
│ │ ├── AnnotationRetentionPolicyTransformerSpec.groovy
│ │ ├── OpenApi31Spec.groovy
│ │ ├── OpenApiAdocModuleSpec.groovy
│ │ ├── OpenApiApplicationVisitorSpec.groovy
│ │ ├── OpenApiArraySchemaSpec.groovy
│ │ ├── OpenApiBasicSchemaSpec.groovy
│ │ ├── OpenApiClassPropertySpec.groovy
│ │ ├── OpenApiComplexSchemaSpec.groovy
│ │ ├── OpenApiControllerRequiresVisitorSpec.groovy
│ │ ├── OpenApiControllerVisitorSpec.groovy
│ │ ├── OpenApiDateTimeExampleSchemaSpec.groovy
│ │ ├── OpenApiDecoratorSpec.groovy
│ │ ├── OpenApiDuplicateElementsSpec.groovy
│ │ ├── OpenApiEmptyBodyResponseSpec.groovy
│ │ ├── OpenApiEncodingSpec.groovy
│ │ ├── OpenApiEndpointVisitorSpec.groovy
│ │ ├── OpenApiEnumSpec.groovy
│ │ ├── OpenApiExtensionSpec.groovy
│ │ ├── OpenApiExternalDocsSpec.groovy
│ │ ├── OpenApiExtraSchemaVisitorSpec.groovy
│ │ ├── OpenApiFileResponseTypeSpec.groovy
│ │ ├── OpenApiFileUploadBodyParameterSpec.groovy
│ │ ├── OpenApiFileUploadSpec.groovy
│ │ ├── OpenApiGeneratorExtensionsSpec.groovy
│ │ ├── OpenApiGroupSpec.groovy
│ │ ├── OpenApiHttpHeadersSpec.groovy
│ │ ├── OpenApiIncludeVisitorSpec.groovy
│ │ ├── OpenApiInheritedPojoControllerSpec.groovy
│ │ ├── OpenApiInnerClassSpec.groovy
│ │ ├── OpenApiInterfaceBeanSpec.groovy
│ │ ├── OpenApiJacksonAnySetterSpec.groovy
│ │ ├── OpenApiJacksonInheritanceSpec.groovy
│ │ ├── OpenApiJsonUnwrappedsSpec.groovy
│ │ ├── OpenApiJsonViewSpec.groovy
│ │ ├── OpenApiMapSchemaSpec.groovy
│ │ ├── OpenApiMergeSchemaSpec.groovy
│ │ ├── OpenApiNullableTypesSpec.groovy
│ │ ├── OpenApiOperationCallbackSpec.groovy
│ │ ├── OpenApiOperationHeadersSpec.groovy
│ │ ├── OpenApiOperationLinkSpec.groovy
│ │ ├── OpenApiOperationParametersSpec.groovy
│ │ ├── OpenApiOperationParseSpec.groovy
│ │ ├── OpenApiOperationTagsSpec.groovy
│ │ ├── OpenApiOperationUniqueSpec.groovy
│ │ ├── OpenApiOperationWithjavadocSpec.groovy
│ │ ├── OpenApiOutputCustomFileNameSpec.groovy
│ │ ├── OpenApiOutputJsonSpec.groovy
│ │ ├── OpenApiOutputYamlSpec.groovy
│ │ ├── OpenApiPageSpec.groovy
│ │ ├── OpenApiParameterMappingSpec.groovy
│ │ ├── OpenApiParameterSchemaSpec.groovy
│ │ ├── OpenApiPathParamRegexSpec.groovy
│ │ ├── OpenApiPlaceholdersSpec.groovy
│ │ ├── OpenApiPojoControllerGroovySpec.groovy
│ │ ├── OpenApiPojoControllerJavaSpec.groovy
│ │ ├── OpenApiPojoControllerKotlinSpec.groovy
│ │ ├── OpenApiPojoControllerSpec.groovy
│ │ ├── OpenApiPropsFromEnvSpec.groovy
│ │ ├── OpenApiProtobufSpec.groovy
│ │ ├── OpenApiPublicFieldsSpec.groovy
│ │ ├── OpenApiQueryValueWithFormatSpec.groovy
│ │ ├── OpenApiRecordsSpec.groovy
│ │ ├── OpenApiRecursionSpec.groovy
│ │ ├── OpenApiRequestBeanSpec.groovy
│ │ ├── OpenApiRequestBodyArraySchemaSpec.groovy
│ │ ├── OpenApiReturnVoidSpec.groovy
│ │ ├── OpenApiSchemaDecoratorSpec.groovy
│ │ ├── OpenApiSchemaFieldSpec.groovy
│ │ ├── OpenApiSchemaGenericsSpec.groovy
│ │ ├── OpenApiSchemaInContentSpec.groovy
│ │ ├── OpenApiSchemaInheritanceSpec.groovy
│ │ ├── OpenApiSchemaJavaTimeSpec.groovy
│ │ ├── OpenApiSchemaPrimitiveTypeSpec.groovy
│ │ ├── OpenApiSchemaSecuritySpec.groovy
│ │ ├── OpenApiSchemaWithMicronautStarterSpec.groovy
│ │ ├── OpenApiSchemaWithNotNullSpec.groovy
│ │ ├── OpenApiSecurityRequirementSpec.groovy
│ │ ├── OpenApiTagGenerationSpec.groovy
│ │ ├── OpenApiUrlParametersAsPojoSpec.groovy
│ │ ├── OpenApiVersionSpec.groovy
│ │ ├── OpenapiCustomSchemaSpec.groovy
│ │ └── SchemaMetaAnnotationSpec.groovy
│ ├── java
│ └── io
│ │ └── micronaut
│ │ └── sample
│ │ └── FooRecord.java
│ └── resources
│ ├── application-additional-files.yml
│ ├── application-additional-files2.yml
│ ├── application-additional-files3.yml
│ ├── application-disabled-openapi.yml
│ ├── application-endpoints.yml
│ ├── application-expand-props.yml
│ ├── application-info.yml
│ ├── application-local.yml
│ ├── application-local2.yml
│ ├── application-schemadecorator.yml
│ ├── application-schemaforclass.yml
│ ├── application-security.yml
│ ├── application-spring-actuator.yml
│ ├── application.yml
│ ├── merge
│ ├── diff-media-type.yml
│ └── option-endpoints.yml
│ └── swagger
│ ├── openapi.yml
│ └── petstore.yml
├── settings.gradle
├── src
└── main
│ └── docs
│ ├── guide
│ ├── breaks.adoc
│ ├── cli.adoc
│ ├── configuration.adoc
│ ├── configuration
│ │ ├── applicationConfiguration.adoc
│ │ ├── availableOptions.adoc
│ │ ├── propertiesFileConfiguration.adoc
│ │ └── systemPropertyConfiguration.adoc
│ ├── controllers.adoc
│ ├── convertToAdoc.adoc
│ ├── customSerializers.adoc
│ ├── endpoints.adoc
│ ├── endpoints
│ │ ├── enableendpoints.adoc
│ │ ├── endpointservers.adoc
│ │ ├── endpointspath.adoc
│ │ ├── endpointssecurityrequirements.adoc
│ │ ├── endpointstags.adoc
│ │ └── micronautendpoints.adoc
│ ├── exposingSwaggerOutput.adoc
│ ├── gettingStarted.adoc
│ ├── introduction.adoc
│ ├── kotlin.adoc
│ ├── mergingSchemas.adoc
│ ├── micronautOpenApiAnnotations.adoc
│ ├── micronautOpenApiAnnotations
│ │ ├── accessorsStyle.adoc
│ │ ├── openapidecorator.adoc
│ │ ├── openapiextraschema.adoc
│ │ ├── openapigroup.adoc
│ │ ├── openapigroupinfo.adoc
│ │ ├── openapiinclude.adoc
│ │ ├── openapimanagement.adoc
│ │ └── openapisecurity.adoc
│ ├── namingStrategy.adoc
│ ├── openApiDefinition.adoc
│ ├── openApiGenerator.adoc
│ ├── openApiGeneratorExtensions.adoc
│ ├── openApiGuides.adoc
│ ├── openApiViews.adoc
│ ├── openApiViews
│ │ ├── mappingPath.adoc
│ │ ├── openapiExplorer.adoc
│ │ ├── rapidoc.adoc
│ │ ├── rapipdf.adoc
│ │ ├── redoc.adoc
│ │ ├── scalar.adoc
│ │ ├── swaggerui.adoc
│ │ ├── swaggerui
│ │ │ └── oauth2.adoc
│ │ ├── viewsGenerationWithPropertiesFile.adoc
│ │ └── viewsGenerationWithSystemProperties.adoc
│ ├── releaseHistory.adoc
│ ├── repository.adoc
│ ├── schemaDecorators.adoc
│ ├── serverContext.adoc
│ ├── serverContext
│ │ ├── compileResolution.adoc
│ │ ├── serverFilter.adoc
│ │ └── urlParameter.adoc
│ ├── spring.adoc
│ ├── spring
│ │ ├── springBootActuator.adoc
│ │ ├── springWithGradle.adoc
│ │ ├── springWithMaven.adoc
│ │ ├── springWithOpenApiView.adoc
│ │ └── springWithWrappedRequestData.adoc
│ ├── swaggerAnnotations.adoc
│ ├── swaggerAnnotations
│ │ ├── schemasAndGenerics.adoc
│ │ ├── schemasAndMetaAnnotations.adoc
│ │ ├── schemasAndPojos.adoc
│ │ ├── schemasAnnotationResolution.adoc
│ │ └── schemasNaming.adoc
│ ├── tagsGeneration.adoc
│ ├── toc.yml
│ ├── versionsAndGroups.adoc
│ └── versionsAndGroups
│ │ ├── groups.adoc
│ │ ├── include.adoc
│ │ └── versions.adoc
│ └── resources
│ └── img
│ └── swagger-ui-with-groups.png
├── test-suite-generator-util
├── build.gradle
└── src
│ └── main
│ └── java
│ └── io
│ └── micronaut
│ └── openapi
│ └── testsuite
│ └── GeneratorMain.java
├── test-suite-java-client-generator
├── build.gradle
├── petstore.json
└── src
│ └── test
│ ├── groovy
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── test
│ │ └── api
│ │ └── ClientSpec.groovy
│ └── java
│ └── io
│ └── micronaut
│ └── openapi
│ └── test
│ └── util
│ └── TestUtils.java
├── test-suite-java-jaxrs
├── build.gradle.kts
└── src
│ └── test
│ ├── java
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── jaxrs
│ │ ├── Application.java
│ │ ├── ModelController.java
│ │ ├── ModelControllerTest.java
│ │ ├── OpenApiExposedTest.java
│ │ ├── OpenApiGeneratedTest.java
│ │ ├── TestController.java
│ │ ├── TestControllerTest.java
│ │ └── model
│ │ ├── one
│ │ └── Response.java
│ │ └── two
│ │ └── Response.java
│ └── resources
│ ├── application.properties
│ └── logback.xml
├── test-suite-java-server-generator
├── build.gradle
├── spec.yaml
└── src
│ ├── main
│ └── java
│ │ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── test
│ │ ├── api
│ │ ├── ParametersController.java
│ │ ├── RequestBodyController.java
│ │ └── ResponseBodyController.java
│ │ ├── dated
│ │ ├── DatedResponse.java
│ │ └── DatedResponseBodyWriter.java
│ │ ├── filter
│ │ ├── MyFilter.java
│ │ └── MyFilterBinder.java
│ │ └── page
│ │ └── PageBodyWriter.java
│ └── test
│ ├── groovy
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── test
│ │ └── api
│ │ ├── ParametersControllerSpec.groovy
│ │ ├── RequestBodyControllerSpec.groovy
│ │ └── ResponseBodyControllerSpec.groovy
│ └── resources
│ └── application-test.yml
├── test-suite-java-spring
├── build.gradle
├── openapi.properties
└── src
│ ├── main
│ ├── java
│ │ └── io
│ │ │ └── micronaut
│ │ │ └── openapi
│ │ │ └── spring
│ │ │ ├── Application.java
│ │ │ ├── WebConfig.java
│ │ │ └── api
│ │ │ ├── HelloController.java
│ │ │ ├── MyController.java
│ │ │ ├── TestController.java
│ │ │ └── dto
│ │ │ └── User.java
│ └── resources
│ │ └── application.yml
│ └── test
│ ├── java
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── spring
│ │ ├── OpenApiExposedTest.java
│ │ ├── TestConfig.java
│ │ └── TestControllerTest.java
│ └── resources
│ └── logback.xml
├── test-suite-kotlin-kapt-client-generator
├── build.gradle
├── petstore.json
└── src
│ └── test
│ ├── java
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── test
│ │ └── util
│ │ └── TestUtils.java
│ └── kotlin
│ └── io
│ └── micronaut
│ └── openapi
│ └── test
│ └── api
│ └── ClientTest.kt
├── test-suite-kotlin-kapt-server-generator
├── build.gradle
└── src
│ ├── main
│ └── kotlin
│ │ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── test
│ │ ├── api
│ │ ├── ParametersController.kt
│ │ ├── RequestBodyController.kt
│ │ └── ResponseBodyController.kt
│ │ ├── dated
│ │ ├── DatedResponse.kt
│ │ └── DatedResponseBodyWriter.kt
│ │ ├── filter
│ │ ├── MyFilter.kt
│ │ └── MyFilterBinder.kt
│ │ └── page
│ │ └── PageBodyWriter.kt
│ └── test
│ ├── kotlin
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── test
│ │ └── api
│ │ ├── ParametersControllerTest.kt
│ │ ├── RequestBodyControllerTest.kt
│ │ └── ResponseBodyControllerTest.kt
│ └── resources
│ └── application-test.yml
├── test-suite-kotlin-ksp-client-generator
├── build.gradle
├── petstore.json
└── src
│ └── test
│ ├── groovy
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── test
│ │ └── api
│ │ └── ClientSpec.groovy
│ ├── java
│ └── io
│ │ └── micronaut
│ │ └── openapi
│ │ └── test
│ │ └── util
│ │ └── TestUtils.java
│ └── kotlin
│ └── io
│ └── micronaut
│ └── openapi
│ └── test
│ └── api
│ └── ClientTest.kt
└── test-suite-kotlin-ksp-server-generator
├── build.gradle
├── spec.yaml
└── src
├── main
└── kotlin
│ └── io
│ └── micronaut
│ └── openapi
│ └── test
│ ├── api
│ ├── ParametersController.kt
│ ├── RequestBodyController.kt
│ └── ResponseBodyController.kt
│ ├── dated
│ ├── DatedResponse.kt
│ └── DatedResponseBodyWriter.kt
│ ├── filter
│ ├── MyFilter.kt
│ └── MyFilterBinder.kt
│ └── page
│ └── PageBodyWriter.kt
└── test
├── kotlin
└── io
│ └── micronaut
│ └── openapi
│ └── test
│ └── api
│ ├── ParametersControllerTest.kt
│ ├── RequestBodyControllerTest.kt
│ └── ResponseBodyControllerTest.kt
└── resources
└── application-test.yml
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | trim_trailing_whitespace = true
5 | insert_final_newline = true
6 | charset = utf-8
7 | indent_style = space
8 |
9 | [{*.sh,gradlew}]
10 | end_of_line = lf
11 |
12 | [{*.bat,*.cmd}]
13 | end_of_line = crlf
14 |
15 | [{*.mustache,*.ftl}]
16 | insert_final_newline = false
17 |
18 | [*.java]
19 | indent_size = 4
20 | tab_width = 4
21 | max_line_length = 100
22 | # Import order can be configured with ij_java_imports_layout=...
23 | # See documentation https://youtrack.jetbrains.com/issue/IDEA-170643#focus=streamItem-27-3708697.0-0
24 |
25 | [*.xml]
26 | indent_size = 4
27 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | *.java text eol=lf
5 | *.groovy text eol=lf
6 | *.html text eol=lf
7 | *.kt text eol=lf
8 | *.kts text eol=lf
9 | *.md text diff=markdown eol=lf
10 | *.py text diff=python executable
11 | *.pl text diff=perl executable
12 | *.pm text diff=perl
13 | *.css text diff=css eol=lf
14 | *.js text eol=lf
15 | *.sql text eol=lf
16 | *.q text eol=lf
17 |
18 | *.sh text eol=lf
19 | gradlew text eol=lf
20 |
21 | *.bat text eol=crlf
22 | *.cmd text eol=crlf
23 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | contact_links:
2 | - name: Micronaut Core Discussions
3 | url: https://github.com/micronaut-projects/micronaut-core/discussions
4 | about: Ask questions about Micronaut on Github
5 | - name: Micronaut Data Discussions
6 | url: https://github.com/micronaut-projects/micronaut-data/discussions
7 | about: Ask Micronaut Data related questions on Github
8 | - name: Stack Overflow
9 | url: https://stackoverflow.com/tags/micronaut
10 | about: Ask questions on Stack Overflow
11 | - name: Chat
12 | url: https://gitter.im/micronautfw/
13 | about: Chat with us on Gitter.
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/new_feature.yaml:
--------------------------------------------------------------------------------
1 | name: Feature request
2 | description: Create a new feature request
3 | body:
4 | - type: markdown
5 | attributes:
6 | value: |
7 | Please describe the feature you want for Micronaut to implement, before that check if there is already an existing issue to add it.
8 | - type: textarea
9 | attributes:
10 | label: Feature description
11 | placeholder: Tell us what feature you would like for Micronaut to have and what problem is it going to solve
12 | validations:
13 | required: true
14 |
15 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/other.yaml:
--------------------------------------------------------------------------------
1 | name: Other
2 | description: Something different
3 | body:
4 | - type: textarea
5 | attributes:
6 | label: Issue description
7 | validations:
8 | required: true
9 |
10 |
--------------------------------------------------------------------------------
/.github/release.yml:
--------------------------------------------------------------------------------
1 | changelog:
2 | exclude:
3 | authors:
4 | - micronaut-build
5 | categories:
6 | - title: Breaking Changes 🛠
7 | labels:
8 | - 'type: breaking'
9 | - title: New Features 🎉
10 | labels:
11 | - 'type: enhancement'
12 | - title: Bug Fixes 🐞
13 | labels:
14 | - 'type: bug'
15 | - title: Improvements ⭐
16 | labels:
17 | - 'type: improvement'
18 | - title: Docs 📖
19 | labels:
20 | - 'type: docs'
21 | - title: Dependency updates 🚀
22 | labels:
23 | - 'type: dependency-upgrade'
24 | - 'dependency-upgrade'
25 | - title: Regressions 🧐
26 | labels:
27 | - 'type: regression'
28 | - title: GraalVM 🏆
29 | labels:
30 | - 'relates-to: graal'
31 | - title: Other Changes 💡
32 | labels:
33 | - "*"
34 |
--------------------------------------------------------------------------------
/.github/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "config:recommended"
4 | ],
5 | "addLabels": [
6 | "type: dependency-upgrade"
7 | ],
8 | "schedule": [
9 | "after 10pm"
10 | ],
11 | "prHourlyLimit": 1,
12 | "prConcurrentLimit": 20,
13 | "timezone": "Europe/Prague",
14 | "packageRules": [
15 | {
16 | "dependencyDashboardApproval": true,
17 | "matchUpdateTypes": [
18 | "patch"
19 | ],
20 | "matchCurrentVersion": "!/^0/",
21 | "automerge": true,
22 | "matchPackageNames": [
23 | "/actions.*/"
24 | ]
25 | },
26 | {
27 | "matchUpdateTypes": [
28 | "patch"
29 | ],
30 | "matchCurrentVersion": "!/^0/",
31 | "automerge": true
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | dist/
2 | .DS_Store
3 | target/
4 | .gradle/
5 | .idea/
6 | build/
7 | !build-logic/src/main/java/io/micronaut/build
8 | classes/
9 | out/
10 | *.db
11 | *.log
12 | *.iml
13 | .classpath
14 | .factorypath
15 | bin/
16 | .settings/
17 | .project
18 | */test/
19 | */META-INF/
20 | *.ipr
21 | *.iws
22 | .kotlintest
23 | */.kotlintest/
24 |
25 | # ignore resources, are downloaded via a gradle task from micronaut_docs
26 | src/main/docs/resources/css/highlight/*.css
27 | src/main/docs/resources/css/highlight/*.png
28 | src/main/docs/resources/css/highlight/*.jpg
29 | src/main/docs/resources/css/*.css
30 | src/main/docs/resources/js/*.js
31 | src/main/docs/resources/style/*.html
32 | src/main/docs/resources/img/micronaut-logo-white.svg
33 |
34 | # Ignore files generated by test-resources
35 | **/.micronaut/test-resources/
36 |
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Thanks for reporting an issue, please review the task list below before submitting the
2 | issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
3 |
4 | NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
5 |
6 | ### Task List
7 |
8 | - [ ] Steps to reproduce provided
9 | - [ ] Stacktrace (if present) provided
10 | - [ ] Example that reproduces the problem uploaded to GitHub
11 | - [ ] Full description of the issue provided (see below)
12 |
13 | ### Steps to Reproduce
14 |
15 | 1. TODO
16 | 2. TODO
17 | 3. TODO
18 |
19 | ### Expected Behaviour
20 |
21 | Tell us what should happen
22 |
23 | ### Actual Behaviour
24 |
25 | Tell us what happens instead
26 |
27 | ### Environment Information
28 |
29 | - **Operating System**: TODO
30 | - **Micronaut Version:** TODO
31 | - **JDK Version:** TODO
32 |
33 | ### Example Application
34 |
35 | - TODO: link to GitHub repository with example that reproduces the issue
36 |
37 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | We release patches for security vulnerabilities. Which versions are eligible
4 | receiving such patches depend on the CVSS v3.0 Rating:
5 |
6 | | CVSS v3.0 | Supported Versions |
7 | |-----------|-------------------------------------------|
8 | | 9.0-10.0 | Releases within the previous three months |
9 | | 4.0-8.9 | Most recent release |
10 |
11 | ## Reporting a Vulnerability
12 |
13 | Please responsibly disclose (suspected) security vulnerabilities to
14 | **[The Micronaut Foundation](foundation@micronaut.io)**. You will receive a response from
15 | us within 48 hours. If the issue is confirmed, we will release a patch as soon
16 | as possible depending on complexity but historically within a few days.
17 |
--------------------------------------------------------------------------------
/build-logic/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'groovy-gradle-plugin'
3 | }
4 |
5 | repositories {
6 | mavenCentral()
7 | gradlePluginPortal()
8 | }
9 |
10 | dependencies {
11 | implementation(libs.micronaut.gradle.plugin)
12 | implementation(libs.sonatype.scan)
13 | }
14 |
--------------------------------------------------------------------------------
/build-logic/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "build-logic"
2 |
3 | dependencyResolutionManagement {
4 | versionCatalogs {
5 | libs {
6 | from(files("../gradle/libs.versions.toml"))
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/build-logic/src/main/groovy/io.micronaut.build.internal.openapi-base.gradle:
--------------------------------------------------------------------------------
1 | repositories {
2 | mavenCentral()
3 | }
4 |
5 | tasks.withType(Test).configureEach {
6 | useJUnitPlatform()
7 | testLogging {
8 | exceptionFormat = 'full'
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/build-logic/src/main/groovy/io.micronaut.build.internal.openapi-module.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("io.micronaut.build.internal.openapi-base")
3 | id("io.micronaut.build.internal.module")
4 | id("org.sonatype.gradle.plugins.scan")
5 | }
6 | String ossIndexUsername = System.getenv("OSS_INDEX_USERNAME") ?: project.properties["ossIndexUsername"]
7 | String ossIndexPassword = System.getenv("OSS_INDEX_PASSWORD") ?: project.properties["ossIndexPassword"]
8 | boolean sonatypePluginConfigured = ossIndexUsername != null && ossIndexPassword != null
9 | if (sonatypePluginConfigured) {
10 | ossIndexAudit {
11 | username = ossIndexUsername
12 | password = ossIndexPassword
13 | }
14 | }
15 |
16 | repositories {
17 | mavenCentral()
18 | google()
19 | }
20 |
--------------------------------------------------------------------------------
/build-logic/src/main/groovy/io.micronaut.build.internal.openapi-simple-module.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("io.micronaut.build.internal.openapi-base")
3 | id("io.micronaut.build.internal.base-module")
4 | id("java-test-fixtures")
5 | }
6 |
7 | components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() }
8 | components.java.withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) { skip() }
9 |
--------------------------------------------------------------------------------
/build-logic/src/main/groovy/io.micronaut.build.internal.openapi-test-java.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("io.micronaut.build.internal.openapi-base")
3 | id("java-library")
4 | }
5 |
6 | dependencies {
7 | testAnnotationProcessor(mn.micronaut.inject.java)
8 | testImplementation(mnTest.micronaut.test.junit5)
9 | testRuntimeOnly(mnTest.junit.jupiter.engine)
10 | testRuntimeOnly(mnLogging.logback.classic)
11 | }
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "io.micronaut.build.internal.docs"
3 | id "io.micronaut.build.internal.quality-reporting"
4 | alias(mn.plugins.kotlin.jvm) apply(false)
5 | alias(mn.plugins.kotlin.kapt) apply(false)
6 | alias(mn.plugins.kotlin.allopen) apply(false)
7 | alias(mn.plugins.ksp) apply(false)
8 | }
9 |
10 | repositories {
11 | mavenCentral()
12 | }
13 |
--------------------------------------------------------------------------------
/config/HEADER:
--------------------------------------------------------------------------------
1 | Copyright ${year} original authors
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | https://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/config/checkstyle/HEADER:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-20\d\d original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 \(the "License"\);
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
--------------------------------------------------------------------------------
/config/checkstyle/custom-suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/config/checkstyle/suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/config/spotless.license.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-$YEAR original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
--------------------------------------------------------------------------------
/docs-examples/example-groovy/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "groovy"
3 | }
4 |
5 | repositories {
6 | mavenCentral()
7 | }
8 |
9 | dependencies {
10 |
11 | testCompileOnly(mn.micronaut.inject.groovy)
12 | testCompileOnly(projects.micronautOpenapi)
13 |
14 | testImplementation(mn.micronaut.http)
15 | testImplementation(mnGroovy.micronaut.runtime.groovy)
16 | testImplementation(mnValidation.validation)
17 | testImplementation(mn.reactor)
18 |
19 | testRuntimeOnly(mnLogging.logback.classic)
20 | }
21 |
22 | test {
23 | jvmArgs '-Duser.country=US'
24 | jvmArgs '-Duser.language=en'
25 | testLogging {
26 | exceptionFormat = 'full'
27 | }
28 | failFast = true
29 | }
30 |
31 | tasks.withType(GroovyCompile).configureEach {
32 | groovyOptions.forkOptions.jvmArgs.add('-Dgroovy.parameters=true')
33 | }
34 |
35 | ext.skipDocumentation=true
36 |
--------------------------------------------------------------------------------
/docs-examples/example-groovy/src/test/groovy/io/micronaut/configuration/openapi/docs/Application.groovy:
--------------------------------------------------------------------------------
1 | package io.micronaut.configuration.openapi.docs
2 |
3 | import io.micronaut.runtime.Micronaut
4 | // tag::imports[]
5 |
6 | import io.swagger.v3.oas.annotations.OpenAPIDefinition
7 | import io.swagger.v3.oas.annotations.info.Contact
8 | import io.swagger.v3.oas.annotations.info.Info
9 | import io.swagger.v3.oas.annotations.info.License
10 |
11 | // end::imports[]
12 | // tag::clazz[]
13 | @OpenAPIDefinition(
14 | info = @Info(
15 | title = "Hello World",
16 | version = "0.0",
17 | description = "My API",
18 | license = @License(name = "Apache 2.0", url = "https://foo.bar"),
19 | contact = @Contact(url = "https://gigantic-server.com", name = "Fred", email = "Fred@gigagantic-server.com")
20 | )
21 | )
22 | class Application {
23 | static void main(String[] args) {
24 | Micronaut.run(Application)
25 | }
26 | }
27 | // end::clazz[]
--------------------------------------------------------------------------------
/docs-examples/example-groovy/src/test/groovy/io/micronaut/configuration/openapi/docs/controllers/HelloController.groovy:
--------------------------------------------------------------------------------
1 | package io.micronaut.configuration.openapi.docs.controllers
2 |
3 | // tag::imports[]
4 | import io.micronaut.http.MediaType
5 |
6 | import io.micronaut.http.annotation.Controller
7 | import io.micronaut.http.annotation.Get
8 | import reactor.core.publisher.Mono
9 |
10 | // end::imports[]
11 | // tag::clazz[]
12 | @Controller("/")
13 | class HelloController {
14 |
15 | /**
16 | * @param name The person's name
17 | * @return The greeting
18 | */
19 | @Get(uri = "/hello/{name}", produces = MediaType.TEXT_PLAIN)
20 | Mono index(String name) {
21 | return Single.just("Hello $name!")
22 | }
23 | }
24 | // end::clazz[]
25 |
--------------------------------------------------------------------------------
/docs-examples/example-groovy/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs-examples/example-java/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "java"
3 | }
4 |
5 | repositories {
6 | mavenCentral()
7 | }
8 |
9 | dependencies {
10 |
11 | testAnnotationProcessor(mn.micronaut.inject.java)
12 | testAnnotationProcessor(projects.micronautOpenapi)
13 |
14 | testCompileOnly(mn.micronaut.inject.java)
15 | testCompileOnly(projects.micronautOpenapiAnnotations)
16 |
17 | testImplementation(mn.micronaut.http)
18 | testImplementation(mn.reactor)
19 | testImplementation(mnValidation.validation)
20 |
21 | testRuntimeOnly(mnTest.junit.jupiter.engine)
22 | testRuntimeOnly(mnLogging.logback.classic)
23 | }
24 |
25 | compileJava.options.compilerArgs += '-parameters'
26 | compileTestJava.options.compilerArgs += '-parameters'
27 |
28 | test {
29 | jvmArgs '-Duser.country=US'
30 | jvmArgs '-Duser.language=en'
31 | useJUnitPlatform()
32 | testLogging {
33 | exceptionFormat = 'full'
34 | }
35 | failFast = true
36 | }
37 | ext.skipDocumentation=true
38 |
--------------------------------------------------------------------------------
/docs-examples/example-java/src/test/java/io/micronaut/configuration/openapi/docs/Application.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.configuration.openapi.docs;
2 | // tag::imports[]
3 | import io.micronaut.runtime.Micronaut;
4 | import io.swagger.v3.oas.annotations.OpenAPIDefinition;
5 | import io.swagger.v3.oas.annotations.info.Contact;
6 | import io.swagger.v3.oas.annotations.info.Info;
7 | import io.swagger.v3.oas.annotations.info.License;
8 |
9 | // end::imports[]
10 | // tag::clazz[]
11 | @OpenAPIDefinition(
12 | info = @Info(
13 | title = "Hello World",
14 | version = "0.0",
15 | description = "My API",
16 | license = @License(name = "Apache 2.0", url = "https://foo.bar"),
17 | contact = @Contact(url = "https://gigantic-server.com", name = "Fred", email = "Fred@gigagantic-server.com")
18 | )
19 | )
20 | public class Application {
21 |
22 | public static void main(String[] args) {
23 | Micronaut.run(Application.class);
24 | }
25 | }
26 | //end::clazz[]
27 |
--------------------------------------------------------------------------------
/docs-examples/example-java/src/test/java/io/micronaut/configuration/openapi/docs/controllers/HelloController.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.configuration.openapi.docs.controllers;
2 |
3 | // tag::imports[]
4 | import io.micronaut.http.MediaType;
5 | import io.micronaut.http.annotation.Controller;
6 | import io.micronaut.http.annotation.Get;
7 | import reactor.core.publisher.Mono;
8 |
9 | // end::imports[]
10 | // tag::clazz[]
11 | @Controller
12 | public class HelloController {
13 |
14 | /**
15 | * @param name The person's name
16 | * @return The greeting
17 | */
18 | @Get(uri = "/hello/{name}", produces = MediaType.TEXT_PLAIN)
19 | public Mono index(String name) {
20 | return Mono.just("Hello " + name + "!");
21 | }
22 | }
23 | // end::clazz[]
24 |
--------------------------------------------------------------------------------
/docs-examples/example-java/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs-examples/example-kotlin/.kotlintest/spec_failures:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micronaut-projects/micronaut-openapi/e6b3998ce46a2dc3f229efd02e61a6e6a3df30f5/docs-examples/example-kotlin/.kotlintest/spec_failures
--------------------------------------------------------------------------------
/docs-examples/example-kotlin/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | alias(mn.plugins.kotlin.jvm)
3 | alias(mn.plugins.ksp)
4 | alias(mn.plugins.kotlin.allopen)
5 | }
6 |
7 | repositories {
8 | mavenCentral()
9 | }
10 |
11 | dependencies {
12 |
13 | kspTest(mn.micronaut.inject.kotlin)
14 | kspTest(mnValidation.micronaut.validation)
15 | kspTest(projects.micronautOpenapi)
16 |
17 | testCompileOnly(projects.micronautOpenapiAnnotations)
18 | testCompileOnly(mn.micronaut.inject.kotlin)
19 |
20 | testImplementation(mn.micronaut.http)
21 | testImplementation(mn.reactor)
22 | testImplementation(mnValidation.validation)
23 | testImplementation(mn.kotlin.stdlib.asProvider())
24 | testImplementation(mn.kotlin.reflect)
25 |
26 | testRuntimeOnly(mnTest.junit.jupiter.engine)
27 | testRuntimeOnly(mnLogging.logback.classic)
28 | }
29 |
30 | ksp {
31 | arg("micronaut.openapi.project.dir", projectDir.toString())
32 | }
33 |
34 | test {
35 | jvmArgs '-Duser.country=US'
36 | jvmArgs '-Duser.language=en'
37 | useJUnitPlatform()
38 | testLogging {
39 | exceptionFormat = 'full'
40 | }
41 | failFast = true
42 | }
43 |
44 | kotlin {
45 | jvmToolchain {
46 | languageVersion.set(JavaLanguageVersion.of(17))
47 | }
48 | }
49 | ext.skipDocumentation=true
50 |
--------------------------------------------------------------------------------
/docs-examples/example-kotlin/src/test/kotlin/io/micronaut/configuration/openapi/docs/Application.kt:
--------------------------------------------------------------------------------
1 | package io.micronaut.configuration.openapi.docs
2 | // tag::imports[]
3 | import io.micronaut.runtime.Micronaut
4 | import io.swagger.v3.oas.annotations.OpenAPIDefinition
5 | import io.swagger.v3.oas.annotations.info.Contact
6 | import io.swagger.v3.oas.annotations.info.Info
7 | import io.swagger.v3.oas.annotations.info.License
8 |
9 | // end::imports[]
10 | // tag::clazz[]
11 | @OpenAPIDefinition(
12 | info = Info(
13 | title = "Hello World",
14 | version = "0.0",
15 | description = "My API",
16 | license = License(name = "Apache 2.0", url = "https://foo.bar"),
17 | contact = Contact(url = "https://gigantic-server.com", name = "Fred", email = "Fred@gigagantic-server.com")
18 | )
19 | )
20 | object Application {
21 |
22 | @JvmStatic
23 | fun main(args: Array) {
24 | Micronaut.run(Application.javaClass)
25 | }
26 | }
27 | // end::clazz[]
--------------------------------------------------------------------------------
/docs-examples/example-kotlin/src/test/kotlin/io/micronaut/configuration/openapi/docs/controllers/HelloController.kt:
--------------------------------------------------------------------------------
1 | package io.micronaut.configuration.openapi.docs.controllers
2 |
3 | // tag::imports[]
4 | import io.micronaut.http.MediaType
5 | import io.micronaut.http.annotation.Controller
6 | import io.micronaut.http.annotation.Get
7 | import reactor.core.publisher.Mono
8 |
9 | // end::imports[]
10 | // tag::clazz[]
11 | @Controller("/")
12 | open class HelloController {
13 |
14 | /**
15 | * @param name The person's name
16 | * @return The greeting
17 | */
18 | @Get(uri = "/hello/{name}", produces = [MediaType.TEXT_PLAIN])
19 | open fun index(name: String): Mono {
20 | return Mono.just("Hello $name!")
21 | }
22 | }
23 | // end::clazz[]
--------------------------------------------------------------------------------
/docs-examples/example-kotlin/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/gradle/license.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.github.hierynomus.license'
2 |
3 | license {
4 | header = rootProject.file('config/HEADER')
5 | strictCheck = true
6 | ignoreFailures = true
7 | mapping {
8 | kt = 'SLASHSTAR_STYLE'
9 | java = 'SLASHSTAR_STYLE'
10 | groovy = 'SLASHSTAR_STYLE'
11 | }
12 | ext.year = '2017-2024'
13 |
14 | exclude "**/transaction/**"
15 | exclude '**/*.txt'
16 | exclude '**/*.html'
17 | exclude '**/*.xml'
18 | exclude '**/*.json'
19 | exclude '**/build-info.properties'
20 | exclude '**/git.properties'
21 | exclude '**/othergit.properties'
22 | }
23 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micronaut-projects/micronaut-openapi/e6b3998ce46a2dc3f229efd02e61a6e6a3df30f5/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/openapi-adoc/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'io.micronaut.build.internal.openapi-simple-module'
3 | }
4 |
5 | micronautBuild {
6 | binaryCompatibility {
7 | enabled = false
8 | }
9 | }
10 |
11 | dependencies {
12 |
13 | api(libs.managed.pegdown)
14 | api(libs.managed.parboiled)
15 | api(libs.managed.jsoup)
16 | api(libs.managed.freemarker)
17 |
18 | implementation(projects.micronautOpenapiCommon)
19 |
20 | testImplementation(mnTest.micronaut.test.junit5)
21 |
22 | testRuntimeOnly(mnTest.junit.jupiter.engine)
23 | }
24 |
25 | test {
26 | useJUnitPlatform()
27 | }
28 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/examples.ftl:
--------------------------------------------------------------------------------
1 | <#if examples?has_content>
2 | *Examples:*
3 | <#list examples as exampleName, ex>
4 |
5 | .${exampleName}
6 | <#if ex.get$ref()?has_content>
7 | <#assign example = components.getExamples()[ex.get$ref()?remove_beginning("#/components/examples/")] />
8 | <#else>
9 | <#assign example = ex />
10 | #if>
11 | <#if example.getSummary()?has_content>
12 |
13 | ${example.getSummary()}
14 | #if>
15 | <#if example.getDescription()?has_content>
16 |
17 | ${example.getDescription()}
18 | #if>
19 | <#if example.getExternalValue()?has_content>
20 |
21 | ${example.getExternalValue()}[Link]
22 | #if>
23 | <#if example.getValue()??>
24 | [source]
25 | ----
26 | ${JSON.writeValueAsString(example.getValue())}
27 | ----
28 | #if>
29 | <#-- <#if example.get$ref()?has_content><<${example.get$ref()?replace("#", "")?replace("/", "_")},${example.get$ref()?remove_beginning("#/components/examples/")}>>#if>-->
30 | #list>
31 | <#elseif example??>
32 | *Example:*
33 | [source]
34 | ----
35 | ${example}
36 | ----
37 | #if>
38 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/externalDocs.ftl:
--------------------------------------------------------------------------------
1 | <#if externalDocs?has_content>
2 | ${externalDocs.getUrl()?has_content?then(externalDocs.getUrl() + '[' + externalDocs.getDescription() + ']', externalDocs.getDescription())} +
3 | #if>
4 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/links.ftl:
--------------------------------------------------------------------------------
1 | <#if links?has_content>
2 | <#list links as name, link>
3 | <#if link.get$ref()?has_content && components?? && components.getLinks()?has_content>
4 | <#assign l = components.getLinks()[link.get$ref()?remove_beginning("#/components/links/")] />
5 | <#else>
6 | <#assign l = link />
7 | #if>
8 | *${name}* +
9 | <#if l.getDescription()?has_content>
10 |
11 | ${l.getDescription()}
12 | #if>
13 | <#if l.getOperationId()?has_content>
14 |
15 | __Operation__: `${l.getOperationId()}` +
16 | #if>
17 | <#if l.getParameters()?has_content>
18 |
19 | __Parameters__: { +
20 | <#list l.getParameters() as name, value>
21 | "${name}": "${value}"${name?has_next?then(',', '')} +
22 | #list>
23 | } +
24 | #if>
25 | #list>
26 | <#else>
27 | No links
28 | #if>
29 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/openApiDoc.ftl:
--------------------------------------------------------------------------------
1 | <#include template_overview />
2 | <#include template_paths />
3 | <#include template_definitions />
4 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/paths.ftl:
--------------------------------------------------------------------------------
1 | <#if paths?has_content>
2 |
3 | == Paths
4 | <#list paths as pathsStr, path>
5 | <#list path.readOperationsMap() as method, operation>
6 |
7 | === __${method}__ `${pathsStr}`<#if operation.getSummary()?has_content> ${operation.getSummary()?trim}#if>
8 | <#if operation.getDescription()?has_content>
9 | ${operation.getDescription()?trim}
10 |
11 | #if>
12 | <#if operation.getRequestBody()??>
13 | <#assign requestBody = operation.getRequestBody() />
14 | <#include template_requestBody />
15 | #if>
16 | <#if operation.getParameters()?has_content>
17 | <#assign parameters = operation.getParameters() />
18 | <#include template_parameters />
19 | #if>
20 | <#if operation.getResponses()?has_content>
21 | <#assign responses = operation.getResponses() />
22 | <#include template_responses />
23 | #if>
24 | <#assign securityReqs = operation.getSecurity()?has_content?then(operation.getSecurity(), []) />
25 | <#include template_securityRequirements />
26 | #list>
27 | #list>
28 | #if>
29 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/properties.ftl:
--------------------------------------------------------------------------------
1 | <#if schemaProperties?has_content>
2 | .Properties
3 | [%header,caption=,cols=".^4a,.^16a,.^4a"]
4 | |===
5 | <.<|Name
6 | <.<|Description
7 | <.<|Type
8 | <#list schemaProperties as propName, propSchema>
9 |
10 | <.<|${propName}
11 | <#if propSchema.getRequired()?has_content && propSchema.getRequired()?seq_contains(propName)>
12 | __required__
13 | #if>
14 | <.<|<#include template_propertyDescription />
15 | <.<|<#assign schemaType = propSchema /><#include template_schemaType />
16 | #list>
17 | |===
18 | #if>
19 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/requestBody.ftl:
--------------------------------------------------------------------------------
1 | <#if requestBody??>
2 | <#if requestBody.get$ref()?has_content>
3 | <#assign request = components.getRequestBodies()[requestBody.get$ref()?remove_beginning("#/components/requestBodies/")] />
4 | <#else>
5 | <#assign request = requestBody />
6 | #if>
7 | ==== Request
8 | <#if request.getDescription()?has_content>
9 |
10 | ${request.getDescription()}
11 | #if>
12 | <#if request.getRequired()?? && request.getRequired()>
13 |
14 | __required__
15 | #if>
16 | <#if request.getContent()?has_content>
17 |
18 | <#assign content = request.getContent() />
19 | <#include template_content />
20 | #if>
21 | #if>
22 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/responses.ftl:
--------------------------------------------------------------------------------
1 | <#if responses?has_content>
2 |
3 | .Responses
4 | [%header,caption=,cols=".^2a,.^14a,.^4a"]
5 | |===
6 | <.<|Code
7 | <.<|Description
8 | <.<|Links
9 |
10 | <#list responses as code, response>
11 | <.<|${code}
12 | <.<|<#compress>
13 | <#if response.get$ref()?has_content>
14 | <#assign response = response.get$ref()?remove_beginning("#/components/responses/") />
15 | #if>
16 | <#if response.getDescription()?has_content>${response.getDescription()}#if>
17 | #compress>
18 | <#if response.getHeaders()?has_content>
19 |
20 | <#assign headers = response.getHeaders() />
21 | <#include template_headers />
22 | #if>
23 | <#if response.getContent()?has_content>
24 | <#assign content = response.getContent() />
25 | <#include template_content />
26 | #if>
27 |
28 | <.<|<#assign links = response.getLinks()?has_content?then(response.getLinks(), []) /><#include template_links />
29 | #list>
30 | |===
31 | #if>
32 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/schemaType.ftl:
--------------------------------------------------------------------------------
1 | <#compress>
2 | <#if schemaType.getItems()??>
3 | <#if schemaType.getItems().getType()??>
4 | < ${schemaType.getItems().getType()} > array
5 | <#elseif schemaType.getItems().get$ref()?has_content>
6 | < <<${schemaType.getItems().get$ref()?replace("#", "")?replace("/", "_")},${schemaType.getItems().get$ref()?remove_beginning("#/components/schemas/")}>> > array
7 | <#else>
8 | < object > array
9 | #if>
10 | <#elseif schemaType.getEnum()?has_content>
11 | enum (${schemaType.getEnum()?join(", ")})
12 | <#else>
13 | <#if schemaType.getType()??>
14 | ${schemaType.getType()}
15 | <#else>
16 | <<${schemaType.get$ref()?replace("#", "")?replace("/", "_")},${schemaType.get$ref()?remove_beginning("#/components/schemas/")}>>
17 | #if>
18 | <#if schemaType.getFormat()?has_content>
19 | (${schemaType.getFormat()})
20 | #if>
21 | #if>
22 | #compress>
23 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/securityRequirements.ftl:
--------------------------------------------------------------------------------
1 | <#assign allSecurityReqs = globalSecurityRequirements?has_content?then(globalSecurityRequirements, []) />
2 | <#assign allSecurityReqs += securityReqs />
3 | <#if allSecurityReqs?has_content>
4 |
5 | .Security
6 | [%header,caption=,cols=".^3a,.^4a,.^13a"]
7 | |===
8 | <.<|Name
9 | <.<|Type
10 | <.<|Scopes
11 | <#list allSecurityReqs as securityReq>
12 | <#list securityReq as securityReqName, securityReqScopes>
13 |
14 | <.<|${securityReqName}
15 | <.<|**${securityReqScopes?has_content?then("oauth2", "apiKey")}**
16 | <.<|${securityReqScopes?join(", ")}
17 | #list>
18 | #list>
19 | |===
20 | #if>
21 |
--------------------------------------------------------------------------------
/openapi-adoc/src/main/resources/template/servers.ftl:
--------------------------------------------------------------------------------
1 | <#if servers?has_content>
2 |
3 | == Servers
4 | <#list servers as server>
5 |
6 | === __Server__: ${server.getUrl()}
7 | <#if server.getDescription()?has_content>
8 |
9 | ${server.getDescription()}
10 | #if>
11 | <#if server.getVariables()?has_content>
12 |
13 | .Server Variables
14 | [%header,caption=,cols=".^2a,.^9a,.^3a,.^4a"]
15 | |===
16 | <.<|Variable
17 | <.<|Description
18 | <.<|Possible Values
19 | <.<|Default
20 | <#list server.getVariables() as varName, var>
21 |
22 | <.<|${varName}
23 | <.<|${var.getDescription()}
24 | <.<|${var.getEnum()?has_content?then(var.getEnum()?join(", "), "Any")}
25 | <.<|${var.getDefault()}
26 | #list>
27 | |===
28 | #if>
29 | #list>
30 | #if>
31 |
--------------------------------------------------------------------------------
/openapi-adoc/src/test/resources/customDir/links1.ftl:
--------------------------------------------------------------------------------
1 | !!!!!!test custom template
2 |
--------------------------------------------------------------------------------
/openapi-annotations/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'io.micronaut.build.internal.openapi-module'
3 | }
4 |
5 | dependencies {
6 | api(libs.managed.swagger.annotations)
7 | }
8 |
--------------------------------------------------------------------------------
/openapi-bom/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "io.micronaut.build.internal.bom"
3 | }
4 |
5 | micronautBom {
6 | suppressions {
7 | acceptedVersionRegressions.add("swagger-compat")
8 | acceptedLibraryRegressions.add("swagger")
9 | acceptedVersionRegressions.add("slf4j")
10 | acceptedLibraryRegressions.add("slf4j-nop")
11 |
12 | acceptedVersionRegressions.add("jakarta-validation-api")
13 | acceptedLibraryRegressions.add("jakarta-validation-api")
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/openapi-common/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "io.micronaut.build.internal.binary-compatibility-check"
3 | id 'io.micronaut.build.internal.openapi-simple-module'
4 | }
5 |
6 | micronautBuild {
7 | binaryCompatibility {
8 | enabled = false
9 | }
10 | }
11 |
12 | dependencies {
13 | api(mn.jackson.databind)
14 | api(mn.jackson.dataformat.yaml)
15 | api(mn.jackson.datatype.jsr310)
16 | api(libs.managed.swagger.models)
17 | }
18 |
19 | test {
20 | useJUnitPlatform()
21 | }
22 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/jackson/mixin/Discriminator31Mixin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.jackson.mixin;
17 |
18 | import java.util.Map;
19 |
20 | import com.fasterxml.jackson.annotation.JsonAnyGetter;
21 | import com.fasterxml.jackson.annotation.JsonAnySetter;
22 |
23 | /**
24 | * This class is copied from swagger-core library.
25 | *
26 | * @since 4.6.0
27 | */
28 | public abstract class Discriminator31Mixin {
29 |
30 | @JsonAnyGetter
31 | public abstract Map getExtensions();
32 |
33 | @JsonAnySetter
34 | public abstract void addExtension(String name, Object value);
35 | }
36 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/jackson/mixin/DiscriminatorMixin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.jackson.mixin;
17 |
18 | import java.util.Map;
19 |
20 | import com.fasterxml.jackson.annotation.JsonIgnore;
21 |
22 | /**
23 | * This class is copied from swagger-core library.
24 | *
25 | * @since 4.6.0
26 | */
27 | public abstract class DiscriminatorMixin {
28 |
29 | @JsonIgnore
30 | public abstract Map getExtensions();
31 | }
32 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/jackson/mixin/ExtensionsMixin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.jackson.mixin;
17 |
18 | import java.util.Map;
19 |
20 | import com.fasterxml.jackson.annotation.JsonAnyGetter;
21 | import com.fasterxml.jackson.annotation.JsonAnySetter;
22 |
23 | /**
24 | * This class is copied from swagger-core library.
25 | *
26 | * @since 4.6.0
27 | */
28 | public abstract class ExtensionsMixin {
29 |
30 | @JsonAnyGetter
31 | public abstract Map getExtensions();
32 |
33 | @JsonAnySetter
34 | public abstract void addExtension(String name, Object value);
35 | }
36 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/jackson/mixin/Info31Mixin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.jackson.mixin;
17 |
18 | import java.util.Map;
19 |
20 | import com.fasterxml.jackson.annotation.JsonAnyGetter;
21 | import com.fasterxml.jackson.annotation.JsonAnySetter;
22 |
23 | /**
24 | * This class is copied from swagger-core library.
25 | *
26 | * @since 4.6.0
27 | */
28 | public abstract class Info31Mixin {
29 |
30 | @JsonAnyGetter
31 | public abstract Map getExtensions();
32 |
33 | @JsonAnySetter
34 | public abstract void addExtension(String name, Object value);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/util/ApiResponses31Deserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.util;
17 |
18 | /**
19 | * This class is copied from swagger-core library.
20 | *
21 | * @since 4.6.0
22 | */
23 | public class ApiResponses31Deserializer extends ApiResponsesDeserializer {
24 |
25 | public ApiResponses31Deserializer() {
26 | openapi31 = true;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/util/Callback31Deserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.util;
17 |
18 | /**
19 | * This class is copied from swagger-core library.
20 | *
21 | * @since 4.6.0
22 | */
23 | public class Callback31Deserializer extends CallbackDeserializer {
24 |
25 | public Callback31Deserializer() {
26 | openapi31 = true;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/util/Model31Deserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.util;
17 |
18 | /**
19 | * This class is copied from swagger-core library.
20 | *
21 | * @since 4.6.0
22 | */
23 | public class Model31Deserializer extends ModelDeserializer {
24 |
25 | public Model31Deserializer() {
26 | openapi31 = true;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/util/Parameter31Deserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.util;
17 |
18 | /**
19 | * This class is copied from swagger-core library.
20 | *
21 | * @since 4.6.0
22 | */
23 | public class Parameter31Deserializer extends ParameterDeserializer {
24 |
25 | public Parameter31Deserializer() {
26 | openapi31 = true;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/util/Paths31Deserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.util;
17 |
18 | /**
19 | * This class is copied from swagger-core library.
20 | *
21 | * @since 4.6.0
22 | */
23 | public class Paths31Deserializer extends PathsDeserializer {
24 |
25 | public Paths31Deserializer() {
26 | openapi31 = true;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/openapi-common/src/main/java/io/micronaut/openapi/swagger/core/util/SecurityScheme31Deserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.swagger.core.util;
17 |
18 | /**
19 | * This class is copied from swagger-core library.
20 | *
21 | * @since 4.6.0
22 | */
23 | public class SecurityScheme31Deserializer extends SecuritySchemeDeserializer {
24 |
25 | public SecurityScheme31Deserializer() {
26 | openapi31 = true;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/java/io/micronaut/openapi/generator/AuthFilterPatternStyle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.generator;
17 |
18 | /**
19 | * Styles of filter patterns.
20 | */
21 | public enum AuthFilterPatternStyle {
22 | ANT,
23 | REGEX,
24 | }
25 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/java/io/micronaut/openapi/generator/GeneratorOptionsBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.generator;
17 |
18 | /**
19 | * The main interface of the generator options builder.
20 | */
21 | public interface GeneratorOptionsBuilder {
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/java/io/micronaut/openapi/generator/MicronautCodeGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.generator;
17 |
18 | /**
19 | * Marker interface for all Micronaut code generators, used
20 | * to avoid leaking internal types to public APIs.
21 | *
22 | * @param The type of generator options builder.
23 | */
24 | public interface MicronautCodeGenerator {
25 |
26 | T optionsBuilder();
27 | }
28 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/java/io/micronaut/openapi/generator/SerializationLibraryKind.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.generator;
17 |
18 | /**
19 | * The supported serialization libraries.
20 | */
21 | public enum SerializationLibraryKind {
22 | JACKSON,
23 | MICRONAUT_SERDE_JACKSON
24 | }
25 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/client/auth/Authorizations.mustache:
--------------------------------------------------------------------------------
1 | {{>common/licenseInfo}}
2 | package {{invokerPackage}}.auth;
3 |
4 | import io.micronaut.core.bind.annotation.Bindable;
5 |
6 | import java.lang.annotation.Documented;
7 | import java.lang.annotation.Retention;
8 | import java.lang.annotation.Target;
9 | {{#generatedAnnotation}}
10 | import {{javaxPackage}}.annotation.Generated;
11 | {{/generatedAnnotation}}
12 |
13 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
14 | import static java.lang.annotation.ElementType.METHOD;
15 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
16 |
17 | {{#generatedAnnotation}}
18 | {{>common/generatedAnnotation}}
19 | {{/generatedAnnotation}}
20 | @Bindable
21 | @Documented
22 | @Retention(RUNTIME)
23 | @Target({METHOD, ANNOTATION_TYPE})
24 | public @interface Authorizations {
25 |
26 | Authorization[] value();
27 | }
28 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/client/auth/config/ConfigurableAuthorization.mustache:
--------------------------------------------------------------------------------
1 | {{>common/licenseInfo}}
2 | package {{invokerPackage}}.auth.config;
3 |
4 | import io.micronaut.core.annotation.NonNull;
5 | import io.micronaut.http.MutableHttpRequest;
6 | {{#generatedAnnotation}}
7 | import {{javaxPackage}}.annotation.Generated;
8 | {{/generatedAnnotation}}
9 |
10 | {{#generatedAnnotation}}
11 | {{>common/generatedAnnotation}}
12 | {{/generatedAnnotation}}
13 | public interface ConfigurableAuthorization {
14 |
15 | String getName();
16 |
17 | void applyAuthorization(@NonNull MutableHttpRequest> request);
18 | }
19 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/client/params/bodyParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isBodyParam}}@Body {{>common/params/validation}}{{>client/params/type}} {{paramName}}{{/isBodyParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/client/params/cookieParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isCookieParam}}@CookieValue({{#defaultValue}}value = {{/defaultValue}}"{{baseName}}"{{#defaultValue}}, defaultValue = "{{defaultValue}}"{{/defaultValue}}) {{>common/params/validation}}{{>client/params/type}} {{paramName}}{{/isCookieParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/client/params/formParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isFormParam}}{{>common/params/validation}}{{>client/params/type}} {{paramName}}{{/isFormParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/client/params/headerParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isHeaderParam}}@Header({{#defaultValue}}name = {{/defaultValue}}"{{baseName}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/validation}}{{>client/params/type}} {{paramName}}{{/isHeaderParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/client/params/pathParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isPathParam}}@PathVariable({{#defaultValue}}name = {{/defaultValue}}"{{baseName}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/validation}}{{>client/params/type}} {{paramName}}{{/isPathParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/client/params/queryParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isQueryParam}}@QueryValue({{#defaultValue}}value = {{/defaultValue}}"{{{baseName}}}"{{!default value}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) {{!validation and type}}{{>common/params/validation}}{{>client/params/type}} {{paramName}}{{/isQueryParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/client/params/type.mustache:
--------------------------------------------------------------------------------
1 | {{#isDeprecated}}@Deprecated{{/isDeprecated}}
2 | {{^isDate}}{{^isDateTime}}{{#vendorExtensions.format}}@Format({{{vendorExtensions.format}}}) {{/vendorExtensions.format}}{{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}{{/isDateTime}}{{/isDate}}
3 | {{#isDateTime}}{{#vendorExtensions.formatPattern}}@Format("{{{vendorExtensions.formatPattern}}}"){{/vendorExtensions.formatPattern}}{{^vendorExtensions.formatPattern}}{{#dateTimeFormat}}@Format("{{{dateTimeFormat}}}"){{/dateTimeFormat}}{{/vendorExtensions.formatPattern}} {{{vendorExtensions.baseType}}} {{/isDateTime}}
4 | {{#isDate}}{{#vendorExtensions.formatPattern}}@Format("{{{vendorExtensions.formatPattern}}}"){{/vendorExtensions.formatPattern}}{{^vendorExtensions.formatPattern}}{{#dateFormat}}@Format("{{{dateFormat}}}"){{/dateFormat}}{{/vendorExtensions.formatPattern}} {{{vendorExtensions.baseType}}} {{/isDate}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/configuration/Application.mustache:
--------------------------------------------------------------------------------
1 | package {{invokerPackage}};
2 |
3 | {{#aot}}
4 | import io.micronaut.context.ApplicationContextBuilder;
5 | import io.micronaut.context.ApplicationContextConfigurer;
6 | import io.micronaut.context.annotation.ContextConfigurer;
7 | {{/aot}}
8 | import io.micronaut.runtime.Micronaut;
9 |
10 | public class Application {
11 | {{#aot}}
12 |
13 | @ContextConfigurer
14 | public static class MyConfigurer implements ApplicationContextConfigurer {
15 |
16 | @Override
17 | public void configure(ApplicationContextBuilder context) {
18 | context.deduceEnvironment(false);
19 | }
20 | }
21 | {{/aot}}
22 |
23 | public static void main(String[] args) {
24 | Micronaut.run(Application.class, args);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/configuration/logback.xml.mustache:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | false
6 |
8 |
9 | %cyan(%d{HH:mm:ss.SSS}) %highlight(%-5level) %gray([%thread]) %magenta(%logger{25}) [%file:%line] - %msg%n
10 | UTF-8
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/doc/enum_outer_doc.mustache:
--------------------------------------------------------------------------------
1 | # {{classname}}
2 |
3 | ## Enum
4 |
5 | The class is defined in **[{{classname}}.java](../../{{{modelFolder}}}/{{classname}}.java)**
6 |
7 | {{#allowableValues}}{{#enumVars}}
8 | * `{{name}}` (value: `{{{value}}}`)
9 | {{/enumVars}}{{/allowableValues}}
10 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/doc/model_doc.mustache:
--------------------------------------------------------------------------------
1 | {{#models}}{{#model}}
2 |
3 | {{#isEnum}}{{>common/doc/enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>common/doc/pojo_doc}}{{/isEnum}}
4 | {{/model}}{{/models}}
5 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/generatedAnnotation.mustache:
--------------------------------------------------------------------------------
1 | @Generated({{^hideGenerationTimestamp}}value = {{/hideGenerationTimestamp}}"{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9 | * https://openapi-generator.tech
10 | * Do not edit the class manually.
11 | */
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/model/enumName.mustache:
--------------------------------------------------------------------------------
1 | {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}
2 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/model/oneof_interface.mustache:
--------------------------------------------------------------------------------
1 | {{#formatNoEmptyLines}}
2 | {{#additionalOneOfTypeAnnotations}}
3 | {{{.}}}
4 | {{/additionalOneOfTypeAnnotations}}
5 | {{#generatedAnnotation}}
6 | {{>common/generatedAnnotation}}
7 | {{/generatedAnnotation}}
8 | {{>common/model/typeInfoAnnotation}}
9 | {{>common/model/xmlAnnotation}}
10 | public {{>common/model/sealed}}interface {{classname}}{{#vendorExtensions.x-implements}}{{#-first}} extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}}{{>common/model/permits}} {
11 | {{/formatNoEmptyLines}}
12 |
13 | {{#discriminator}}
14 | {{propertyType}} {{propertyGetter}}();
15 | {{/discriminator}}
16 | }
17 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/model/permits.mustache:
--------------------------------------------------------------------------------
1 | {{#useSealed}}{{#permits}}{{#-first}} permits {{/-first}}{{{.}}}{{^-last}}, {{/-last}}{{/permits}}{{/useSealed}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/model/sealed.mustache:
--------------------------------------------------------------------------------
1 | {{#useSealed}}{{#permits.0}}sealed {{/permits.0}}{{^permits.0}}{{^vendorExtensions.x-is-one-of-interface}}final {{/vendorExtensions.x-is-one-of-interface}}{{/permits.0}}{{/useSealed}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/model/xmlAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#withXml}}
2 | @XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
3 | @XmlAccessorType(XmlAccessType.FIELD)
4 | {{#jackson}}
5 | @JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
6 | {{/jackson}}
7 | {{/withXml}}
8 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/test/model_test.groovy.mustache:
--------------------------------------------------------------------------------
1 | package {{package}}
2 |
3 | {{#imports}}import {{import}}
4 | {{/imports}}
5 | import io.micronaut.test.extensions.spock.annotation.MicronautTest
6 | import spock.lang.Specification
7 | import {{javaxPackage}}.inject.Inject
8 |
9 | /**
10 | * Model tests for {{classname}}
11 | */
12 | @MicronautTest
13 | class {{classname}}Spec extends Specification {
14 |
15 | {{#models}}
16 | {{#model}}
17 | {{^vendorExtensions.x-is-one-of-interface}}
18 | {{^isEnum}}
19 | private final {{classname}} model = null
20 |
21 | {{/isEnum}}
22 | /**
23 | * Model tests for {{classname}}
24 | */
25 | void '{{classname}} test'() {
26 | // TODO: test {{classname}}
27 | }
28 |
29 | {{#allVars}}
30 | /**
31 | * Test the property '{{name}}'
32 | */
33 | void '{{classname}} property {{name}} test'() {
34 | // TODO: test {{name}} property of {{classname}}
35 | }
36 |
37 | {{/allVars}}
38 | {{/vendorExtensions.x-is-one-of-interface}}
39 | {{/model}}
40 | {{/models}}
41 | }
42 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/common/test/model_test.mustache:
--------------------------------------------------------------------------------
1 | package {{package}};
2 |
3 | {{#imports}}import {{import}};
4 | {{/imports}}
5 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
6 | import org.junit.jupiter.api.Test;
7 | import org.junit.jupiter.api.Assertions;
8 |
9 | /**
10 | * Model tests for {{classname}}
11 | */
12 | @MicronautTest
13 | class {{classname}}Test {
14 |
15 | {{#models}}
16 | {{#model}}
17 | {{^vendorExtensions.x-is-one-of-interface}}
18 | {{^isEnum}}
19 | private final {{classname}} model = null;
20 |
21 | {{/isEnum}}
22 | /**
23 | * Model tests for {{classname}}
24 | */
25 | @Test
26 | void test{{classname}}() {
27 | // TODO: test {{classname}}
28 | }
29 |
30 | {{#allVars}}
31 | /**
32 | * Test the property '{{name}}'
33 | */
34 | @Test
35 | void {{name}}Test() {
36 | // TODO: test {{name}}
37 | }
38 |
39 | {{/allVars}}
40 | {{/vendorExtensions.x-is-one-of-interface}}
41 | {{/model}}
42 | {{/models}}
43 | }
44 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/server/doc/README.mustache:
--------------------------------------------------------------------------------
1 | # {{artifactId}}
2 |
3 | This is a generated server based on [Micronaut](https://micronaut.io/) framework.
4 |
5 | ## Configuration
6 |
7 | To run the whole application, use [Application.java]({{{invokerFolder}}}/Application.java) as main class.
8 |
9 | Read **[Micronaut Guide](https://docs.micronaut.io/latest/guide/#ideSetup)** for detailed description on IDE setup and Micronaut Framework features.
10 |
11 | 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)**.
12 |
13 | ## Controller Guides
14 |
15 | Description on how to create Apis is given inside individual api guides:
16 |
17 | {{#apiInfo}}
18 | {{#apis}}
19 | * [{{classFilename}}]({{apiDocPath}}/{{classFilename}}.md)
20 | {{/apis}}
21 | {{/apiInfo}}
22 |
23 | ## Author
24 |
25 | {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
26 | {{/hasMore}}{{/apis}}{{/apiInfo}}
27 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/server/params/annotations.mustache:
--------------------------------------------------------------------------------
1 |
2 | {{#isQueryParam}}
3 | @QueryValue({{#defaultValue}}value = {{/defaultValue}}"{{{baseName}}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}})
4 | {{/isQueryParam}}
5 | {{#isPathParam}}
6 | @PathVariable({{#defaultValue}}name = {{/defaultValue}}"{{baseName}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}})
7 | {{/isPathParam}}
8 | {{#isHeaderParam}}
9 | @Header({{#defaultValue}}name = {{/defaultValue}}"{{baseName}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}})
10 | {{/isHeaderParam}}
11 | {{#isBodyParam}}
12 | {{#vendorExtensions.isPart}}
13 | @Part("{{baseName}}")
14 | {{/vendorExtensions.isPart}}
15 | {{^vendorExtensions.isPart}}
16 | @Body
17 | {{/vendorExtensions.isPart}}
18 | {{/isBodyParam}}
19 | {{#isFormParam}}
20 | {{#vendorExtensions.isPart}}
21 | @Part("{{baseName}}")
22 | {{/vendorExtensions.isPart}}
23 | {{/isFormParam}}
24 | {{#isCookieParam}}
25 | @CookieValue({{#defaultValue}}value = {{/defaultValue}}"{{baseName}}"{{#defaultValue}}, defaultValue = "{{defaultValue}}"{{/defaultValue}})
26 | {{/isCookieParam}}
27 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/java-micronaut/server/params/type.mustache:
--------------------------------------------------------------------------------
1 | {{#isDeprecated}}@Deprecated{{/isDeprecated}}
2 | {{^isEnum}}{{^isDateTime}}{{^isDate}}
3 | {{#vendorExtensions.format}}@Format({{{vendorExtensions.format}}}) {{/vendorExtensions.format}}{{{vendorExtensions.typeWithGenericAnnotations}}}
4 | {{/isDate}}{{/isDateTime}}{{/isEnum}}
5 | {{#isDateTime}}
6 | {{#vendorExtensions.formatPattern}}@Format("{{{.}}}"){{/vendorExtensions.formatPattern}}{{^vendorExtensions.formatPattern}}{{#dateTimeFormat}}@Format("{{{.}}}"){{/dateTimeFormat}}{{/vendorExtensions.formatPattern}} {{#isEnum}}{{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}{{/isEnum}}{{^isEnum}}{{{vendorExtensions.typeWithGenericAnnotations}}}{{/isEnum}}
7 | {{/isDateTime}}
8 | {{#isDate}}
9 | {{#vendorExtensions.formatPattern}}@Format("{{{.}}}"){{/vendorExtensions.formatPattern}}{{^vendorExtensions.formatPattern}}{{#dateFormat}}@Format("{{{.}}}"){{/dateFormat}}{{/vendorExtensions.formatPattern}} {{#isEnum}}{{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}{{/isEnum}}{{^isEnum}}{{{vendorExtensions.typeWithGenericAnnotations}}}{{/isEnum}}
10 | {{/isDate}}
11 | {{#isEnum}}
12 | {{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}
13 | {{/isEnum}}
14 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/auth/Authorization.mustache:
--------------------------------------------------------------------------------
1 | {{>common/licenseInfo}}
2 | package {{invokerPackage}}.auth
3 |
4 | import io.micronaut.core.bind.annotation.Bindable
5 |
6 | import kotlin.annotation.AnnotationRetention.RUNTIME
7 | import kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS
8 | import kotlin.annotation.AnnotationTarget.FUNCTION
9 | {{#generatedAnnotation}}
10 | import {{javaxPackage}}.annotation.Generated
11 | {{/generatedAnnotation}}
12 |
13 | {{#generatedAnnotation}}
14 | {{>common/generatedAnnotation}}
15 | {{/generatedAnnotation}}
16 | @Bindable
17 | @MustBeDocumented
18 | @Retention(RUNTIME)
19 | @Target(FUNCTION, ANNOTATION_CLASS)
20 | {{#javaCompatibility}}
21 | @JvmRepeatable(Authorizations::class)
22 | {{/javaCompatibility}}
23 | {{^javaCompatibility}}
24 | @Repeatable
25 | {{/javaCompatibility}}
26 | annotation class Authorization(
27 |
28 | /**
29 | * The name of the authorization.
30 | */
31 | val value: String = "",
32 |
33 | /**
34 | * The scopes for the oauth authorization.
35 | */
36 | val scopes: Array = [],
37 | )
38 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/auth/Authorizations.mustache:
--------------------------------------------------------------------------------
1 | {{>common/licenseInfo}}
2 | package {{invokerPackage}}.auth
3 |
4 | import io.micronaut.core.bind.annotation.Bindable
5 |
6 | import kotlin.annotation.AnnotationRetention.RUNTIME
7 | import kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS
8 | import kotlin.annotation.AnnotationTarget.FUNCTION
9 |
10 | {{#generatedAnnotation}}
11 | import {{javaxPackage}}.annotation.Generated
12 |
13 | {{/generatedAnnotation}}
14 | {{#generatedAnnotation}}
15 | {{>common/generatedAnnotation}}
16 | {{/generatedAnnotation}}
17 | @Bindable
18 | @MustBeDocumented
19 | @Retention(RUNTIME)
20 | @Target(FUNCTION, ANNOTATION_CLASS)
21 | annotation class Authorizations(
22 |
23 | val value: Array,
24 | )
25 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/auth/config/ConfigurableAuthorization.mustache:
--------------------------------------------------------------------------------
1 | {{>common/licenseInfo}}
2 | package {{invokerPackage}}.auth.config
3 |
4 | import io.micronaut.core.annotation.NonNull
5 | import io.micronaut.http.MutableHttpRequest
6 | {{#generatedAnnotation}}
7 | import {{javaxPackage}}.annotation.Generated
8 | {{/generatedAnnotation}}
9 |
10 | {{#generatedAnnotation}}
11 | {{>common/generatedAnnotation}}
12 | {{/generatedAnnotation}}
13 | interface ConfigurableAuthorization {
14 |
15 | val name: String
16 |
17 | fun applyAuthorization(@NonNull request: MutableHttpRequest<*>)
18 | }
19 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/auth/config/HttpBasicAuthConfig.mustache:
--------------------------------------------------------------------------------
1 | {{>common/licenseInfo}}
2 | package {{invokerPackage}}.auth.config
3 |
4 | import io.micronaut.context.annotation.ConfigurationInject
5 | import io.micronaut.context.annotation.EachProperty
6 | import io.micronaut.context.annotation.Parameter
7 | import io.micronaut.core.annotation.NonNull
8 | import io.micronaut.http.MutableHttpRequest
9 | {{#generatedAnnotation}}
10 | import {{javaxPackage}}.annotation.Generated
11 | {{/generatedAnnotation}}
12 |
13 | {{#generatedAnnotation}}
14 | {{>common/generatedAnnotation}}
15 | {{/generatedAnnotation}}
16 | @EachProperty("security{{#authConfigName}}.{{{authConfigName}}}{{/authConfigName}}.basic-auth")
17 | class HttpBasicAuthConfig @ConfigurationInject constructor(
18 | @Parameter
19 | override val name: String,
20 | @NonNull
21 | var username: String,
22 | @NonNull
23 | var password: String,
24 | ) : ConfigurableAuthorization {
25 |
26 | override fun applyAuthorization(@NonNull request: MutableHttpRequest<*>) {
27 | request.basicAuth(username, password)
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/doc/README.mustache:
--------------------------------------------------------------------------------
1 | # {{artifactId}}
2 |
3 | This is a generated client based on [Micronaut](https://micronaut.io/) framework.
4 |
5 | ## Configuration
6 |
7 | A Micronaut's application can be created by defining a main class and running:
8 | ```kotlin
9 | import io.micronaut.runtime.Micronaut
10 |
11 | fun main(args: Array) {
12 | Micronaut.run(*args)
13 | }
14 | ```
15 |
16 | More detailed description can be found in the [Micronaut Guide](https://docs.micronaut.io/latest/guide/#ideSetup).
17 |
18 | All the properties can be changed in the [application.yml][src/main/resources/application.yml] file or when creating micronaut application as described in [Configuration section of guide](https://docs.micronaut.io/latest/guide/#config).
19 |
20 | ## Api Guides
21 |
22 | Description on how to create Apis is given inside individual api guides:
23 |
24 | {{#apiInfo}}{{#apis}}* [{{classFilename}}]({{apiDocPath}}/{{classFilename}}.md)
25 | {{/apis}}{{/apiInfo}}
26 |
27 | ## Auth methods
28 |
29 | Details on auth methods can be found in the [auth.md](doc/auth.md).
30 |
31 | ## Author
32 |
33 | {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
34 | {{/hasMore}}{{/apis}}{{/apiInfo}}
35 |
36 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/params/bodyParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isBodyParam}}@Body {{>common/params/validation}}{{>client/params/type}}{{{paramName}}}: {{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}{{#vendorExtensions.defaultValueInit}} = {{{.}}}{{/vendorExtensions.defaultValueInit}}{{^vendorExtensions.defaultValueInit}}{{#isNullable}} = null{{/isNullable}}{{^isNullable}}{{^required}} = null{{/required}}{{/isNullable}}{{/vendorExtensions.defaultValueInit}}{{/isBodyParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/params/cookieParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isCookieParam}}@CookieValue("{{baseName}}"{{#defaultValue}}, defaultValue = "{{defaultValue}}"{{/defaultValue}}) {{>common/params/validation}}{{>client/params/type}}{{{paramName}}}: {{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}{{#vendorExtensions.defaultValueInit}} = {{{.}}}{{/vendorExtensions.defaultValueInit}}{{^vendorExtensions.defaultValueInit}}{{#isNullable}} = null{{/isNullable}}{{^isNullable}}{{^required}} = null{{/required}}{{/isNullable}}{{/vendorExtensions.defaultValueInit}}{{/isCookieParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/params/formParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isFormParam}}{{>common/params/validation}}{{>client/params/type}}{{{paramName}}}: {{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}{{#vendorExtensions.defaultValueInit}} = {{{.}}}{{/vendorExtensions.defaultValueInit}}{{^vendorExtensions.defaultValueInit}}{{#isNullable}} = null{{/isNullable}}{{^isNullable}}{{^required}} = null{{/required}}{{/isNullable}}{{/vendorExtensions.defaultValueInit}}{{/isFormParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/params/headerParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isHeaderParam}}@Header("{{baseName}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/validation}}{{>client/params/type}}{{{paramName}}}: {{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}{{#vendorExtensions.defaultValueInit}} = {{{.}}}{{/vendorExtensions.defaultValueInit}}{{^vendorExtensions.defaultValueInit}}{{#isNullable}} = null{{/isNullable}}{{^isNullable}}{{^required}} = null{{/required}}{{/isNullable}}{{/vendorExtensions.defaultValueInit}}{{/isHeaderParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/params/pathParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isPathParam}}@PathVariable("{{baseName}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/validation}}{{>client/params/type}}{{{paramName}}}: {{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}{{#vendorExtensions.defaultValueInit}} = {{{.}}}{{/vendorExtensions.defaultValueInit}}{{^vendorExtensions.defaultValueInit}}{{#isNullable}} = null{{/isNullable}}{{^isNullable}}{{^required}} = null{{/required}}{{/isNullable}}{{/vendorExtensions.defaultValueInit}}{{/isPathParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/params/queryParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isQueryParam}}@QueryValue("{{{baseName}}}"{{!default value}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) {{!validation and type}}{{>common/params/validation}}{{>client/params/type}}{{{paramName}}}: {{{vendorExtensions.typeWithEnumWithGenericAnnotations}}}{{#vendorExtensions.defaultValueInit}} = {{{.}}}{{/vendorExtensions.defaultValueInit}}{{^vendorExtensions.defaultValueInit}}{{#isNullable}} = null{{/isNullable}}{{^isNullable}}{{^required}} = null{{/required}}{{/isNullable}}{{/vendorExtensions.defaultValueInit}}{{/isQueryParam}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/client/params/type.mustache:
--------------------------------------------------------------------------------
1 | {{#isDeprecated}}@java.lang.Deprecated{{/isDeprecated}}
2 | {{#isDateTime}}{{#vendorExtensions.formatPattern}}@Format("{{{vendorExtensions.formatPattern}}}"){{/vendorExtensions.formatPattern}}{{^vendorExtensions.formatPattern}}{{#dateTimeFormat}}@Format("{{{dateTimeFormat}}}"){{/dateTimeFormat}}{{/vendorExtensions.formatPattern}} {{/isDateTime}}
3 | {{#isDate}}{{#vendorExtensions.formatPattern}}@Format("{{{vendorExtensions.formatPattern}}}"){{/vendorExtensions.formatPattern}}{{^vendorExtensions.formatPattern}}{{#dateFormat}}@Format("{{{dateFormat}}}"){{/dateFormat}}{{/vendorExtensions.formatPattern}} {{/isDate}}
4 | {{^isDate}}{{^isDateTime}}{{#vendorExtensions.format}}@Format({{{vendorExtensions.format}}}) {{/vendorExtensions.format}}{{/isDateTime}}{{/isDate}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/configuration/Application.mustache:
--------------------------------------------------------------------------------
1 | package {{invokerPackage}}
2 |
3 | import io.micronaut.runtime.Micronaut
4 |
5 | fun main(args: Array) {
6 | Micronaut.run(*args)
7 | }
8 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/configuration/logback.xml.mustache:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | false
6 |
8 |
9 | %cyan(%d{HH:mm:ss.SSS}) %highlight(%-5level) %gray([%thread]) %magenta(%logger{25}) [%file:%line] - %msg%n
10 | UTF-8
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/doc/enum_outer_doc.mustache:
--------------------------------------------------------------------------------
1 | # {{classname}}
2 |
3 | ## Enum
4 |
5 | The class is defined in **[{{classname}}.kt](../../{{{modelFolder}}}/{{classname}}.kt)**
6 |
7 | {{#allowableValues}}{{#enumVars}}
8 | * `{{name}}` (value: `{{{value}}}`)
9 | {{/enumVars}}{{/allowableValues}}
10 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/doc/model_doc.mustache:
--------------------------------------------------------------------------------
1 | {{#models}}{{#model}}
2 |
3 | {{#isEnum}}{{>common/doc/enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>common/doc/pojo_doc}}{{/isEnum}}
4 | {{/model}}{{/models}}
5 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/generatedAnnotation.mustache:
--------------------------------------------------------------------------------
1 | @Generated({{^hideGenerationTimestamp}}value = {{/hideGenerationTimestamp}}"{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9 | * https://openapi-generator.tech
10 | * Do not edit the class manually.
11 | */
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/model/enumName.mustache:
--------------------------------------------------------------------------------
1 | {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/model/oneof_interface.mustache:
--------------------------------------------------------------------------------
1 | {{#formatNoEmptyLines}}
2 | {{#additionalOneOfTypeAnnotations}}
3 | {{{.}}}
4 | {{/additionalOneOfTypeAnnotations}}
5 | {{#generatedAnnotation}}
6 | {{>common/generatedAnnotation}}
7 | {{/generatedAnnotation}}
8 | {{>common/model/typeInfoAnnotation}}
9 | {{/formatNoEmptyLines}}interface {{classname}}{{#vendorExtensions.x-implements}}{{#-first}} : {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}}{{#discriminator}} {
10 |
11 | val {{propertyName}}: {{propertyType}}
12 | }
13 | {{/discriminator}}
14 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/model/typeInfoAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#discriminator}}
2 | {{#discriminator.propertyBaseName}}
3 | {{#jackson}}
4 | @JsonIgnoreProperties(
5 | value = ["{{{discriminator.propertyBaseName}}}"], // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization
6 | allowSetters = true, // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization
7 | )
8 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "{{{discriminator.propertyBaseName}}}", visible = true)
9 | {{#vendorExtensions.hasMappedModels}}
10 | @JsonSubTypes({{#mappedModels}}
11 | JsonSubTypes.Type(value = {{modelName}}::class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
12 | {{/mappedModels}})
13 | {{/vendorExtensions.hasMappedModels}}
14 | {{/jackson}}
15 | {{/discriminator.propertyBaseName}}
16 | {{/discriminator}}
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/model/xmlAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#withXml}}
2 | @XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
3 | @XmlAccessorType(XmlAccessType.FIELD)
4 | {{#jackson}}
5 | @JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
6 | {{/jackson}}
7 | {{/withXml}}
8 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/common/test/model_test.mustache:
--------------------------------------------------------------------------------
1 | package {{package}}
2 |
3 | {{#imports}}import {{import}}
4 | {{/imports}}
5 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest
6 | import org.junit.jupiter.api.Test
7 | import org.junit.jupiter.api.Assertions
8 |
9 | /**
10 | * Model tests for {{classname}}
11 | */
12 | @MicronautTest
13 | class {{classname}}Test {
14 |
15 | {{#models}}
16 | {{#model}}
17 | {{^vendorExtensions.x-is-one-of-interface}}
18 | {{^isEnum}}
19 | val model: {{classname}}? = null
20 |
21 | {{/isEnum}}
22 | /**
23 | * Model tests for {{classname}}
24 | */
25 | @Test
26 | fun test{{classname}}() {
27 | // TODO: test {{classname}}
28 | }
29 |
30 | {{#allVars}}
31 | /**
32 | * Test the property '{{vendorExtensions.realName}}'
33 | */
34 | @Test
35 | fun {{vendorExtensions.realName}}Test() {
36 | // TODO: test {{vendorExtensions.realName}}
37 | }
38 |
39 | {{/allVars}}
40 | {{/vendorExtensions.x-is-one-of-interface}}
41 | {{/model}}
42 | {{/models}}
43 | }
44 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/server/doc/README.mustache:
--------------------------------------------------------------------------------
1 | # {{artifactId}}
2 |
3 | This is a generated server based on [Micronaut](https://micronaut.io/) framework.
4 |
5 | ## Configuration
6 |
7 | To run the whole application, use [Application.kt]({{{invokerFolder}}}/Application.kt) as main class.
8 |
9 | Read **[Micronaut Guide](https://docs.micronaut.io/latest/guide/#ideSetup)** for detailed description on IDE setup and Micronaut Framework features.
10 |
11 | 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)**.
12 |
13 | ## Controller Guides
14 |
15 | Description on how to create Apis is given inside individual api guides:
16 |
17 | {{#apiInfo}}
18 | {{#apis}}
19 | * [{{classFilename}}]({{apiDocPath}}/{{classFilename}}.md)
20 | {{/apis}}
21 | {{/apiInfo}}
22 |
23 | ## Author
24 |
25 | {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
26 | {{/hasMore}}{{/apis}}{{/apiInfo}}
27 |
--------------------------------------------------------------------------------
/openapi-generator/src/main/resources/templates/kotlin-micronaut/server/params/annotations.mustache:
--------------------------------------------------------------------------------
1 |
2 | {{#isQueryParam}}
3 | @QueryValue("{{{baseName}}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}})
4 | {{/isQueryParam}}
5 | {{#isPathParam}}
6 | @PathVariable("{{baseName}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}})
7 | {{/isPathParam}}
8 | {{#isHeaderParam}}
9 | @Header("{{baseName}}"{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}})
10 | {{/isHeaderParam}}
11 | {{#isBodyParam}}
12 | {{#vendorExtensions.isPart}}
13 | @Part("{{baseName}}")
14 | {{/vendorExtensions.isPart}}
15 | {{^vendorExtensions.isPart}}
16 | @Body
17 | {{/vendorExtensions.isPart}}
18 | {{/isBodyParam}}
19 | {{#isFormParam}}
20 | {{/isFormParam}}
21 | {{#isCookieParam}}
22 | @CookieValue("{{baseName}}"{{#defaultValue}}, defaultValue = "{{defaultValue}}"{{/defaultValue}})
23 | {{/isCookieParam}}
24 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/1794/paths/invoice.yml:
--------------------------------------------------------------------------------
1 | post:
2 | tags:
3 | - Invoice
4 | operationId: createInvoice
5 | summary: Creates new sale invoice
6 | requestBody:
7 | required: true
8 | content:
9 | application/json:
10 | schema:
11 | $ref: '../schemas/invoice.yml#/InvoiceCreateDto'
12 | responses:
13 | 201:
14 | description: File uploaded correctly
15 | content:
16 | application/json:
17 | schema:
18 | $ref: '../schemas/invoice.yml#/InvoiceIdDto'
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/1794/schemas/invoice.yml:
--------------------------------------------------------------------------------
1 | InvoiceCreateDto:
2 | type: object
3 | properties:
4 | message:
5 | type: string
6 | InvoiceIdDto:
7 | type: object
8 | properties:
9 | id:
10 | type: string
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/body-enum.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.1.0
2 | info:
3 | version: '1.0.0'
4 | title: 'OpenAPI BUG REST API'
5 | servers:
6 | - url: 'localhost:3000'
7 |
8 | paths:
9 | /api/v1/colors/{name}:
10 | post:
11 | tags: [ my-custom ]
12 | operationId: "selectColor"
13 | requestBody:
14 | required: true
15 | content:
16 | application/json:
17 | schema:
18 | $ref: "#/components/schemas/Color"
19 | responses:
20 | "200":
21 | description: "OK"
22 | content:
23 | application/json:
24 | schema:
25 | type: string
26 |
27 | components:
28 | schemas:
29 |
30 | Color:
31 | type: string
32 | enum:
33 | - GREEN
34 | - RED
35 | - WHITE
36 | - BLACK
37 | - YELLOW
38 | - BLUE
39 |
40 | tags:
41 | - name: my-custom
42 | description: 'All API operations'
43 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/controller-enum2.yml:
--------------------------------------------------------------------------------
1 | swagger: '2.0'
2 | info:
3 | description: docs FINTECH REST API
4 | version: '1'
5 | title: FINTECH
6 | contact: { }
7 | basePath: /fintech/api
8 | paths:
9 | /v1/business-cards:
10 | get:
11 | tags:
12 | - BusinessCards
13 | operationId: getBusinessCardsUsingGET
14 | consumes:
15 | - application/json
16 | produces:
17 | - '*/*'
18 | parameters:
19 | - name: Authorization
20 | in: header
21 | description: Access token
22 | required: true
23 | type: string
24 | - name: statusCodes
25 | in: query
26 | description: Список статусов бизнес-карт
27 | required: false
28 | type: array
29 | items:
30 | type: string
31 | collectionFormat: multi
32 | enum:
33 | - ACTIVE
34 | - BLOCKED
35 | - TO_BE_REISSUED
36 | - TO_BE_BLOCKED
37 | - NOT_DELIVERED
38 | - name: page
39 | in: query
40 | description: Номер страницы (начиная с 1)
41 | required: true
42 | type: integer
43 | format: int32
44 | responses:
45 | '200':
46 | description: OK
47 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/date-time-format.yml:
--------------------------------------------------------------------------------
1 | openapi: '3.0.3'
2 | info:
3 | title: 'Library API'
4 | description: |
5 | Example Service
6 | contact:
7 | name: 'Example Team'
8 | version: '1.0'
9 | tags:
10 | - name: texts
11 |
12 | paths:
13 |
14 | components:
15 | schemas:
16 | DateTimeResponse:
17 | type: object
18 | required:
19 | - message
20 | properties:
21 | message:
22 | type: string
23 | timestamp:
24 | type: string
25 | format: date-time
26 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/enum-implements.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.0
2 | info:
3 | title: Sample API
4 | description: API description in Markdown.
5 | version: 1.0.0
6 | paths:
7 | /ponies:
8 | get:
9 | summary: Returns all animals.
10 | description: Optional extended description in Markdown.
11 | responses:
12 | 200:
13 | description: OK
14 | content:
15 | application/json:
16 | schema:
17 | type: array
18 | items:
19 | $ref: '#/components/schemas/Pony'
20 | components:
21 | schemas:
22 | Pony:
23 | type: object
24 | properties:
25 | type:
26 | $ref: '#/components/schemas/Type'
27 | Type:
28 | type: string
29 | x-implements: java.io.Serializable
30 | enum:
31 | - Earth
32 | - Pegasi
33 | - Unicorn
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/file-download.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.1
2 | info:
3 | title: Test resource
4 | version: 8.0-SNAPSHOT
5 | paths:
6 | /{id}:
7 | get:
8 | summary: Fetch data
9 | operationId: fetchData
10 | parameters:
11 | - name: id
12 | in: path
13 | required: true
14 | schema:
15 | format: int64
16 | minimum: 0
17 | type: integer
18 | nullable: false
19 | responses:
20 | "200":
21 | description: Job found
22 | headers:
23 | Content-Disposition:
24 | description: File name for the download
25 | style: simple
26 | content:
27 | application/zip:
28 | schema:
29 | format: binary
30 | type: string
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/file.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.1
2 | info:
3 | title: test
4 | description: desc
5 | version: 0.0.1
6 | paths:
7 | /sendFile:
8 | put:
9 | operationId: sendFile
10 | tags: [ requestBody ]
11 | description: A method to send file as a request body
12 | requestBody:
13 | required: true
14 | content:
15 | multipart/form-data:
16 | schema:
17 | type: object
18 | properties:
19 | file:
20 | type: string
21 | format: binary
22 | responses:
23 | 200:
24 | description: Success
25 | content:
26 | application/json:
27 | schema:
28 | type: string
29 | format: byte
30 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/inputStream.yml:
--------------------------------------------------------------------------------
1 | openapi: "3.0.3"
2 | info:
3 | version: "v1"
4 | title: "Dummy"
5 | paths:
6 | /assets:export:
7 | get:
8 | operationId: "Dummy"
9 | description: ""
10 | parameters:
11 | - name: "query"
12 | in: "query"
13 | description: ""
14 | required: false
15 | schema:
16 | type: "string"
17 | responses:
18 | "200":
19 | description: ""
20 | content:
21 | '*/*':
22 | schema:
23 | type: "string"
24 | format: "binary"
25 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/issue_19393_map_of_inner_enum.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.0
2 | info:
3 | version: 1.0.0
4 | title: OpenAPI Test API
5 | license:
6 | name: Apache-2.0
7 | url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
8 | paths:
9 | /status:
10 | get:
11 | responses:
12 | '200':
13 | description: desc
14 | components:
15 | schemas:
16 | EmployeeWithMapOfEnum:
17 | type: object
18 | properties:
19 | projectRole:
20 | type: object
21 | additionalProperties:
22 | type: string
23 | enum:
24 | - DEVELOPER
25 | - TESTER
26 | - OWNER
27 | EmployeeWithMultiMapOfEnum:
28 | type: object
29 | properties:
30 | projectRoles:
31 | type: object
32 | additionalProperties:
33 | uniqueItems: true
34 | type: array
35 | items:
36 | type: string
37 | enum:
38 | - DEVELOPER
39 | - TESTER
40 | - OWNER
41 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/javaReservedWords.yml:
--------------------------------------------------------------------------------
1 | openapi: "3.0.0"
2 | info:
3 | version: 1.0.0
4 | title: Compute API
5 | description: API for the Compute Service
6 | servers:
7 | - url: localhost:8000/api
8 | description: The api server
9 |
10 | paths:
11 | /sendEnum:
12 | get:
13 | operationId: interface
14 | tags: [ parameters ]
15 | parameters:
16 | - name: class
17 | in: query
18 | required: true
19 | schema:
20 | $ref: "#/components/schemas/package"
21 | - name: while
22 | in: query
23 | required: true
24 | schema:
25 | type: string
26 | responses:
27 | 200:
28 | description: Success
29 | components:
30 | schemas:
31 | package:
32 | required:
33 | - for
34 | type: object
35 | properties:
36 | for:
37 | type: string
38 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/kotlinReservedWords.yml:
--------------------------------------------------------------------------------
1 | openapi: "3.0.0"
2 | info:
3 | version: 1.0.0
4 | title: Compute API
5 | description: API for the Compute Service
6 | servers:
7 | - url: localhost:8000/api
8 | description: The api server
9 |
10 | paths:
11 | /sendEnum:
12 | get:
13 | operationId: interface
14 | tags: [ parameters ]
15 | parameters:
16 | - name: name
17 | in: query
18 | required: true
19 | schema:
20 | $ref: "#/components/schemas/class"
21 | - name: data
22 | in: query
23 | required: true
24 | schema:
25 | type: string
26 | responses:
27 | 200:
28 | description: Success
29 | components:
30 | schemas:
31 | class:
32 | required:
33 | - data
34 | type: object
35 | properties:
36 | data:
37 | type: string
38 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/micronaut/content-type.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.2
2 | info:
3 | title: info
4 | description: info
5 | version: 0.1.0
6 |
7 | paths:
8 | /example/api:
9 | post:
10 | summary: summary
11 | description: description
12 | requestBody:
13 | content:
14 | application/vnd.oracle.resource+json; type=singular:
15 | schema:
16 | type: object
17 | responses:
18 | 200:
19 | description: response
20 | content:
21 | application/vnd.oracle.resource+json; type=collection:
22 | schema:
23 | type: object
24 | default:
25 | description: error
26 | content:
27 | application/vnd.oracle.resource+json; type=error:
28 | schema:
29 | type: object
30 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/micronaut/oauth2.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.2
2 | info:
3 | title: info
4 | description: info
5 | version: 0.1.0
6 |
7 | paths:
8 | /example/api:
9 | get:
10 | summary: summary
11 | description: description
12 | responses:
13 | 200:
14 | description: response
15 |
16 | components:
17 | securitySchemes:
18 | OAuth_2.0_Client_Credentials:
19 | type: oauth2
20 | description: OAuth 2.0 - Client Credentials
21 | flows:
22 | clientCredentials:
23 | tokenUrl: "https://example.com/token"
24 | scopes:
25 | scope: scope description
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/multiple/paths/files.yml:
--------------------------------------------------------------------------------
1 | post:
2 | tags:
3 | - Customer
4 | operationId: uploadFile
5 | summary: Upload customer files
6 | description: Save file in customer file repository
7 | parameters:
8 | - name: id
9 | in: path
10 | required: true
11 | description: Unique identifier of the Customer
12 | schema:
13 | type: string
14 | format: uuid
15 | requestBody:
16 | required: true
17 | content:
18 | application/json:
19 | schema:
20 | $ref: '../schemas/files.yml#/FileCreateDto'
21 |
22 | responses:
23 | 201:
24 | description: File uploaded correctly
25 | content:
26 | application/json:
27 | schema:
28 | $ref: '../schemas/files.yml#/FileId'
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/multiple/schemas/files.yml:
--------------------------------------------------------------------------------
1 | FileCreateDto:
2 | type: object
3 | required:
4 | - typeCode
5 | - orgName
6 | description: Organization customer data
7 | properties:
8 | typeCode:
9 | type: string
10 | pattern: ^ORG$
11 | description: Customer type ORG
12 | default: ORG
13 | example: ORG
14 | orgName:
15 | type: string
16 |
17 | FileId:
18 | type: string
19 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/multiple/swagger.yml:
--------------------------------------------------------------------------------
1 | openapi: "3.0.0"
2 | info:
3 | version: 1.0.0
4 | title: Swagger Sample
5 | description: Multi-file for OpenAPI Specification.
6 | paths:
7 | /api/customer/{id}/files:
8 | $ref: "./paths/files.yml"
9 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/openapi-built-in-prefix.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.3
2 | info:
3 | version: "1"
4 | title: api
5 | paths:
6 | /example-route:
7 | get:
8 | responses:
9 | "200":
10 | description: ""
11 | content:
12 | "application/json":
13 | schema:
14 | type: array
15 | uniqueItems: true
16 | items:
17 | type: string
18 | /example-route2:
19 | get:
20 | responses:
21 | "200":
22 | description: ""
23 | content:
24 | "application/json":
25 | schema:
26 | type: array
27 | uniqueItems: true
28 | items:
29 | type: string
30 | format: uuid
31 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/optional-controller-values.yml:
--------------------------------------------------------------------------------
1 | openapi: "3.0.0"
2 | info:
3 | version: 1.0.0
4 | title: Compute API
5 | description: API for the Compute Service
6 | paths:
7 | /sendPrimitives/{name}:
8 | post:
9 | operationId: sendPrimitives
10 | parameters:
11 | - in: query
12 | name: brand
13 | schema:
14 | type: string
15 | - in: path
16 | name: name
17 | schema:
18 | type: string
19 | - in: cookie
20 | name: coc
21 | schema:
22 | type: string
23 | - in: header
24 | name: head
25 | schema:
26 | type: string
27 | requestBody:
28 | content:
29 | application/json:
30 | schema:
31 | type: string
32 | responses:
33 | 200:
34 | description: Success
35 | content:
36 | application/json:
37 | schema:
38 | type: string
39 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/propWithSecondUpperCaseChar.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.0
2 | info:
3 | description: This is a library API
4 | version: 1.0.0
5 | title: Library
6 | license:
7 | name: Apache-2.0
8 | url: "https://www.apache.org/licenses/LICENSE-2.0.html"
9 | tags:
10 | - name: books
11 | description: Add books
12 | paths:
13 | /add-book:
14 | post:
15 | tags: [books]
16 | summary: Add a new book
17 | operationId: addBook
18 | requestBody:
19 | required: true
20 | content:
21 | "application/json":
22 | schema:
23 | $ref: "#/components/schemas/Book"
24 | responses:
25 | "200":
26 | description: Success
27 | "400":
28 | description: Bad Request
29 | components:
30 | schemas:
31 | Book:
32 | type: object
33 | properties:
34 | tItle:
35 | type: string
36 | maxLength: 10
37 | ISBN: { type: string, pattern: "[0-9]{13}" }
38 | required:
39 | - tItle
40 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/sealed/oneOf_additionalProperties.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.3
2 | info:
3 | version: 1.0.0
4 | title: dummy
5 | paths:
6 | /:
7 | post:
8 | requestBody:
9 | content:
10 | application/json:
11 | schema:
12 | oneOf:
13 | - $ref: '#/components/schemas/schemaA'
14 | - type: object
15 | properties: {}
16 | additionalProperties: true
17 | responses:
18 | '200':
19 | description: OK
20 | components:
21 | schemas:
22 | schemaA:
23 | type: object
24 | properties:
25 | propA:
26 | type: string
27 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/sealed/oneOf_array.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.3
2 | info:
3 | title: oneOf with array inside
4 | version: 1.0.0
5 | paths:
6 | /myExample:
7 | get:
8 | responses:
9 | '200':
10 | description: Response
11 | content:
12 | application/json:
13 | schema:
14 | oneOf:
15 | - type: array
16 | items:
17 | "$ref": "#/components/schemas/OneOf1"
18 | components:
19 | schemas:
20 | OneOf1:
21 | type: object
22 | properties:
23 | message1:
24 | type: string
25 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/sealed/oneOf_duplicateArray.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.1
2 | info:
3 | version: 1.0.0
4 | title: Example - oneOf data type
5 | license:
6 | name: MIT
7 | servers:
8 | - url: http://api.example.xyz/v1
9 | paths:
10 | /example:
11 | get:
12 | operationId: list
13 | responses:
14 | "200":
15 | description: OK
16 | content:
17 | application/json:
18 | schema:
19 | $ref: "#/components/schemas/Example"
20 | components:
21 | schemas:
22 | Example:
23 | oneOf:
24 | - type: array
25 | items:
26 | type: number
27 | - type: array
28 | items:
29 | type: integer
30 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/sealed/oneOf_nonPrimitive.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.1
2 | info:
3 | version: 1.0.0
4 | title: Example - oneOf data type
5 | license:
6 | name: MIT
7 | servers:
8 | - url: http://api.example.xyz/v1
9 | paths:
10 | /example:
11 | get:
12 | operationId: list
13 | responses:
14 | '200':
15 | description: OK
16 | content:
17 | application/json:
18 | schema:
19 | $ref: "#/components/schemas/Example"
20 | components:
21 | schemas:
22 | Example:
23 | oneOf:
24 | - type: string
25 | format: uuid
26 | - type: string
27 | format: date-time
28 | - type: integer
29 | - type: number
30 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/sealed/oneOf_primitive.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.1
2 | info:
3 | version: 1.0.0
4 | title: Example
5 | license:
6 | name: MIT
7 | servers:
8 | - url: http://api.example.xyz/v1
9 | paths:
10 | /example:
11 | get:
12 | operationId: list
13 | responses:
14 | '200':
15 | description: OK
16 | content:
17 | application/json:
18 | schema:
19 | $ref: "#/components/schemas/Example"
20 | components:
21 | schemas:
22 | Child:
23 | type: object
24 | properties:
25 | name:
26 | type: string
27 | Example:
28 | oneOf:
29 | - $ref: '#/components/schemas/Child'
30 | - type: integer
31 | format: int32
32 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/sealed/oneOf_primitiveAndArray.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.1
2 | info:
3 | version: 1.0.0
4 | title: Example - oneOf data type
5 | license:
6 | name: MIT
7 | servers:
8 | - url: http://api.example.xyz/v1
9 | paths:
10 | /example:
11 | get:
12 | operationId: list
13 | responses:
14 | "200":
15 | description: OK
16 | content:
17 | application/json:
18 | schema:
19 | $ref: "#/components/schemas/Example"
20 | components:
21 | schemas:
22 | Example:
23 | oneOf:
24 | - type: string
25 | format: uuid
26 | - type: array
27 | items:
28 | type: integer
29 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/sealed/oneOf_reuseRef.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.1
2 | info:
3 | version: 1.0.0
4 | title: Example
5 | license:
6 | name: MIT
7 | servers:
8 | - url: http://api.example.xyz/v1
9 | paths:
10 | /example:
11 | get:
12 | operationId: get_fruit
13 | responses:
14 | '200':
15 | description: OK
16 | content:
17 | application/json:
18 | schema:
19 | $ref: "#/components/schemas/Fruit"
20 | components:
21 | schemas:
22 | Apple:
23 | type: object
24 | properties:
25 | cultivar:
26 | type: string
27 | pattern: ^[a-zA-Z\s]*$
28 | origin:
29 | type: string
30 | pattern: /^[A-Z\s]*$/i
31 | nullable: true
32 | Banana:
33 | type: object
34 | properties:
35 | lengthCm:
36 | type: number
37 | Fruit:
38 | oneOf:
39 | - $ref: '#/components/schemas/Apple'
40 | - $ref: '#/components/schemas/Apple'
41 | - $ref: '#/components/schemas/Banana'
42 | discriminator:
43 | propertyName: fruitType
44 | mapping:
45 | green_apple: '#/components/schemas/Apple'
46 | banana: '#/components/schemas/Banana'
47 | red_apple: '#/components/schemas/Apple'
48 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/sealed/oneOf_twoPrimitives.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.3
2 | info:
3 | title: oneOf two primitives
4 | description: oneOf with two entries of type string, see https://github.com/OpenAPITools/openapi-generator/issues/10450
5 | version: 1.0.0
6 | paths:
7 | /myExample:
8 | post:
9 | requestBody:
10 | content:
11 | application/json:
12 | schema:
13 | oneOf:
14 | - type: string
15 | format: ipv4
16 | - type: string
17 | format: ipv6
18 | responses:
19 | 200:
20 | description: OK
21 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/security.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.3
2 | info:
3 | description: This is an example of the openapi documentation
4 | title: OpenAPI
5 | version: 0.0.0
6 | paths:
7 | /pet:
8 | post:
9 | operationId: save
10 | security:
11 | - OAuth2: [ write, admin ]
12 | responses:
13 | 200:
14 | description: Successfully saved
15 | get:
16 | operationId: get
17 | security:
18 | - OAuth2: [ read, admin ]
19 | responses:
20 | 200:
21 | description: Successfully retrieved information
22 | components:
23 | securitySchemes:
24 | OAuth2:
25 | type: oauth2
26 | flows:
27 | authorizationCode:
28 | authorizationUrl: https://example.com/oauth/authorize
29 | tokenUrl: https://example.com/oauth/token
30 | scopes:
31 | read: Grants read access
32 | write: Grants write access
33 | admin: Grants access to admin operations
34 | security:
35 | - OAuth2:
36 | - read
37 | - write
38 | - admin
39 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/3_0/underscore.yml:
--------------------------------------------------------------------------------
1 | openapi: "3.0.0"
2 | info:
3 | version: 1.0.0
4 | title: Compute API
5 | description: API for the Compute Service
6 | servers:
7 | - url: localhost:8000/api
8 | description: The api server
9 |
10 | paths:
11 | /sendEnum:
12 | get:
13 | operationId: sendEnum
14 | tags: [ parameters ]
15 | parameters:
16 | - name: name
17 | in: _query
18 | required: true
19 | schema:
20 | $ref: "#/components/schemas/MyModel"
21 | responses:
22 | 200:
23 | description: Success
24 | components:
25 | schemas:
26 | MyModel:
27 | type: object
28 | properties:
29 | _default:
30 | type: number
31 |
--------------------------------------------------------------------------------
/openapi-generator/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 |
6 |
7 | %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/openapi-generator/src/testFixtures/java/io/micronaut/openapi/generator/assertions/ParameterAnnotationAssert.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.generator.assertions;
2 |
3 | import com.github.javaparser.ast.expr.AnnotationExpr;
4 | import org.assertj.core.util.CanIgnoreReturnValue;
5 |
6 | import java.util.List;
7 |
8 | //CHECKSTYLE:OFF
9 | @CanIgnoreReturnValue
10 | public class ParameterAnnotationAssert extends AbstractAnnotationAssert {
11 |
12 | private final ParameterAssert parameterAssert;
13 |
14 | protected ParameterAnnotationAssert(final ParameterAssert parameterAssert, final List annotationExpr) {
15 | super(annotationExpr);
16 | this.parameterAssert = parameterAssert;
17 | }
18 |
19 | public ParameterAssert toParameter() {
20 | return parameterAssert;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/openapi-generator/src/testFixtures/java/io/micronaut/openapi/generator/assertions/PropertyAnnotationAssert.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.generator.assertions;
2 |
3 | import com.github.javaparser.ast.expr.AnnotationExpr;
4 | import org.assertj.core.util.CanIgnoreReturnValue;
5 |
6 | import java.util.List;
7 |
8 | //CHECKSTYLE:OFF
9 | @CanIgnoreReturnValue
10 | public class PropertyAnnotationAssert extends AbstractAnnotationAssert {
11 |
12 | private final PropertyAssert propertyAssert;
13 |
14 | protected PropertyAnnotationAssert(final PropertyAssert propertyAssert, final List annotationExpr) {
15 | super(annotationExpr);
16 | this.propertyAssert = propertyAssert;
17 | }
18 |
19 | public PropertyAssert toProperty() {
20 | return propertyAssert;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/openapi-generator/src/testFixtures/java/io/micronaut/openapi/generator/assertions/TypeAnnotationAssert.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.generator.assertions;
2 |
3 | import com.github.javaparser.ast.expr.AnnotationExpr;
4 | import org.assertj.core.util.CanIgnoreReturnValue;
5 |
6 | import java.util.List;
7 |
8 | //CHECKSTYLE:OFF
9 | @CanIgnoreReturnValue
10 | public class TypeAnnotationAssert extends AbstractAnnotationAssert {
11 |
12 | private final JavaFileAssert fileAssert;
13 |
14 | protected TypeAnnotationAssert(final JavaFileAssert fileAssert, final List annotationExpr) {
15 | super(annotationExpr);
16 | this.fileAssert = fileAssert;
17 | }
18 |
19 | public JavaFileAssert toType() {
20 | return fileAssert;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/openapi-generator/src/testFixtures/java/io/micronaut/openapi/generator/assertions/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * This package contains assertions which are used in OpenAPI generator test.
19 | * It originates from the OpenAPI Generator project, but the assertions fixtures
20 | * are not published in that project.
21 | */
22 | package io.micronaut.openapi.generator.assertions;
23 |
--------------------------------------------------------------------------------
/openapi/openapi-controller-custom-uri.properties:
--------------------------------------------------------------------------------
1 | micronaut.openapi.expand.login.placeholder=/myLoginUrl
2 | micronaut.openapi.expand.logout.placeholder=/myLogoutUrl
3 |
--------------------------------------------------------------------------------
/openapi/openapi-custom-endpoints.properties:
--------------------------------------------------------------------------------
1 | endpoints.enabled=true
2 | endpoints.tags=Management Endpoints
3 | endpoints.routes.class=io.micronaut.management.endpoint.routes.RoutesEndpoint
4 | endpoints.beans.class=io.micronaut.management.endpoint.beans.BeansEndpoint
5 | endpoints.health.class=io.micronaut.management.endpoint.health.HealthEndpoint
6 | endpoints.loggers.class=io.micronaut.management.endpoint.loggers.LoggersEndpoint
7 | endpoints.refresh.class=io.micronaut.management.endpoint.refresh.RefreshEndpoint
8 | endpoints.path=/internal
9 |
--------------------------------------------------------------------------------
/openapi/openapi-custom-schema-for-class.properties:
--------------------------------------------------------------------------------
1 | micronaut.openapi.schema.mapping.io.micronaut.openapi.ObjectId=java.lang.String
2 | micronaut.openapi.schema.mapping.io.micronaut.openapi.JAXBElement=io.micronaut.openapi.MyJaxbElement
3 | micronaut.openapi.schema.mapping.io.micronaut.openapi.JAXBElement=io.micronaut.openapi.MyJaxbElement2
4 | micronaut.openapi.schema.mapping.io.micronaut.openapi.JAXBElement=io.micronaut.openapi.MyJaxbElement3
5 | micronaut.openapi.schema.mapping.io.micronaut.openapi.JAXBElement=io.micronaut.openapi.MyJaxbElement4
6 |
--------------------------------------------------------------------------------
/openapi/openapi-custom-schema-for-iterable-class.properties:
--------------------------------------------------------------------------------
1 | micronaut.openapi.schema.mapping.io.micronaut.data.model.Page=io.micronaut.openapi.SwaggerPage
2 |
--------------------------------------------------------------------------------
/openapi/openapi-disabled-openapi.properties:
--------------------------------------------------------------------------------
1 | micronaut.openapi.enabled = false
2 |
--------------------------------------------------------------------------------
/openapi/openapi-endpoints-with-groups.properties:
--------------------------------------------------------------------------------
1 | endpoints.enabled=true
2 | endpoints.groups=v1, management
3 | endpoints.tags=Management
4 | endpoints.refresh.enabled=false
--------------------------------------------------------------------------------
/openapi/openapi-placeholder-type.properties:
--------------------------------------------------------------------------------
1 | micronaut.openapi.expand.example.version=42
2 |
--------------------------------------------------------------------------------
/openapi/openapi-placeholders.properties:
--------------------------------------------------------------------------------
1 | micronaut.openapi.expand.api.version=2.2.2
2 | micronaut.openapi.expand.another.placeholder.value=monkey
3 |
--------------------------------------------------------------------------------
/openapi/openapi-schema-decorators.properties:
--------------------------------------------------------------------------------
1 | micronaut.openapi.schema.decorator.postfix.io.micronaut.openapi.api.v1_0_0=1_0_0
2 | micronaut.openapi.schema.decorator.postfix.io.micronaut.openapi.api.v2_0_1=2_0_1
3 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/annotation/transformers/InfoRetentionPolicyAnnotationTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.annotation.transformers;
17 |
18 | import io.swagger.v3.oas.annotations.info.Info;
19 |
20 | /**
21 | * Changes the Retention Policy of the annotation to SOURCE.
22 | *
23 | * @author croudet
24 | * @since 2.1
25 | */
26 | public class InfoRetentionPolicyAnnotationTransformer extends AbstractRetentionPolicyAnnotationTransformer {
27 |
28 | /**
29 | * Changes the Retention Policy of the annotation to SOURCE.
30 | */
31 | public InfoRetentionPolicyAnnotationTransformer() {
32 | super(Info.class);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/annotation/transformers/LinkRetentionPolicyAnnotationTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.annotation.transformers;
17 |
18 | import io.swagger.v3.oas.annotations.links.Link;
19 |
20 | /**
21 | * Changes the Retention Policy of the annotation to SOURCE.
22 | *
23 | * @author croudet
24 | * @since 2.1
25 | */
26 | public class LinkRetentionPolicyAnnotationTransformer extends AbstractRetentionPolicyAnnotationTransformer {
27 |
28 | /**
29 | * Changes the Retention Policy of the annotation to SOURCE.
30 | */
31 | public LinkRetentionPolicyAnnotationTransformer() {
32 | super(Link.class);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/annotation/transformers/TagRetentionPolicyAnnotationTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.annotation.transformers;
17 |
18 | import io.swagger.v3.oas.annotations.tags.Tag;
19 |
20 | /**
21 | * Changes the Retention Policy of the annotation to SOURCE.
22 | *
23 | * @author croudet
24 | * @since 2.1
25 | */
26 | public class TagRetentionPolicyAnnotationTransformer extends AbstractRetentionPolicyAnnotationTransformer {
27 |
28 | /**
29 | * Changes the Retention Policy of the annotation to SOURCE.
30 | */
31 | public TagRetentionPolicyAnnotationTransformer() {
32 | super(Tag.class);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/annotation/transformers/WebhookRetentionPolicyAnnotationTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.annotation.transformers;
17 |
18 | import io.swagger.v3.oas.annotations.Webhook;
19 |
20 | /**
21 | * Changes the Retention Policy of the annotation to SOURCE.
22 | *
23 | * @since 6.7.0
24 | */
25 | public class WebhookRetentionPolicyAnnotationTransformer extends AbstractRetentionPolicyAnnotationTransformer {
26 |
27 | /**
28 | * Changes the Retention Policy of the annotation to SOURCE.
29 | */
30 | public WebhookRetentionPolicyAnnotationTransformer() {
31 | super(Webhook.class);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/introspections/CallbackConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.introspections;
17 |
18 | import io.micronaut.core.annotation.Introspected;
19 | import io.swagger.v3.oas.models.callbacks.Callback;
20 |
21 | /**
22 | * OpenApi introspection configuration for Swagger-model.
23 | * Adds introspection of the io.swagger.v3.oas.models.callbacks package
24 | *
25 | * @author Henrique Mota
26 | */
27 | @Introspected(classes = Callback.class)
28 | public class CallbackConfiguration {
29 | }
30 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/introspections/ExampleConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.introspections;
17 |
18 | import io.micronaut.core.annotation.Introspected;
19 | import io.swagger.v3.oas.models.examples.Example;
20 |
21 | /**
22 | * OpenApi introspection configuration for Swagger-model.
23 | * Adds introspection of the io.swagger.v3.oas.models.examples package
24 | *
25 | * @author Henrique Mota
26 | */
27 | @Introspected(classes = Example.class)
28 | public class ExampleConfiguration {
29 | }
30 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/introspections/HeaderConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.introspections;
17 |
18 | import io.micronaut.core.annotation.Introspected;
19 | import io.swagger.v3.oas.models.headers.Header;
20 |
21 | /**
22 | * OpenApi introspection configuration for Swagger-model.
23 | * Adds introspection of the io.swagger.v3.oas.models.headers package
24 | *
25 | * @author Henrique Mota
26 | */
27 | @Introspected(classes = Header.class)
28 | public class HeaderConfiguration {
29 | }
30 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/introspections/InfoConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.introspections;
17 |
18 | import io.micronaut.core.annotation.Introspected;
19 | import io.swagger.v3.oas.models.info.Contact;
20 | import io.swagger.v3.oas.models.info.Info;
21 | import io.swagger.v3.oas.models.info.License;
22 |
23 | /**
24 | * OpenApi introspection configuration for Swagger-model.
25 | * Adds introspection of the io.swagger.v3.oas.models.info package
26 | *
27 | * @author Henrique Mota
28 | */
29 | @Introspected(classes = {
30 | Contact.class,
31 | Info.class,
32 | License.class,
33 | })
34 | public class InfoConfiguration {
35 | }
36 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/introspections/LinksConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.introspections;
17 |
18 | import io.micronaut.core.annotation.Introspected;
19 | import io.swagger.v3.oas.models.links.Link;
20 | import io.swagger.v3.oas.models.links.LinkParameter;
21 |
22 | /**
23 | * OpenApi introspection configuration for Swagger-model.
24 | * Adds introspection of the io.swagger.v3.oas.models.links package
25 | *
26 | * @author Henrique Mota
27 | */
28 | @Introspected(classes = {
29 | Link.class,
30 | LinkParameter.class,
31 | })
32 | public class LinksConfiguration {
33 | }
34 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/introspections/ResponsesConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.introspections;
17 |
18 | import io.micronaut.core.annotation.Introspected;
19 | import io.swagger.v3.oas.models.responses.ApiResponse;
20 | import io.swagger.v3.oas.models.responses.ApiResponses;
21 |
22 | /**
23 | * OpenApi introspection configuration for Swagger-model.
24 | * Adds introspection of the io.swagger.v3.oas.models.responses package
25 | *
26 | * @author Henrique Mota
27 | */
28 | @Introspected(classes = {
29 | ApiResponse.class,
30 | ApiResponses.class,
31 | })
32 | public class ResponsesConfiguration {
33 | }
34 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/introspections/TagsConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.introspections;
17 |
18 | import io.micronaut.core.annotation.Introspected;
19 | import io.swagger.v3.oas.models.tags.Tag;
20 |
21 | /**
22 | * OpenApi introspection configuration for Swagger-model.
23 | * Adds introspection of the io.swagger.v3.oas.models.tags package
24 | *
25 | * @author Henrique Mota
26 | */
27 | @Introspected(classes = Tag.class)
28 | public class TagsConfiguration {
29 | }
30 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/visitor/InternalExt.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2025 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.visitor;
17 |
18 | import io.micronaut.core.annotation.Internal;
19 |
20 | /**
21 | * Internal Micronaut extensions.
22 | *
23 | * @since 4.14.0
24 | */
25 | @Internal
26 | public interface InternalExt {
27 |
28 | String MICRONAUT_OP_POSTFIX = "x-micronaut-op-postfix";
29 | }
30 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/visitor/VisibilityLevel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.micronaut.openapi.visitor;
17 |
18 | /**
19 | * Visibility level for properties, constructors and methods.
20 | */
21 | public enum VisibilityLevel {
22 | PRIVATE,
23 | PACKAGE,
24 | PROTECTED,
25 | PUBLIC
26 | }
27 |
--------------------------------------------------------------------------------
/openapi/src/main/java/io/micronaut/openapi/visitor/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2023 original authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /**
17 | * Classes related with OpenAPI Visitor.
18 | *
19 | * @author Sergio del Amo
20 | * @since 4.8.3
21 | */
22 | @Internal
23 | package io.micronaut.openapi.visitor;
24 |
25 | import io.micronaut.core.annotation.Internal;
26 |
--------------------------------------------------------------------------------
/openapi/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationMapper:
--------------------------------------------------------------------------------
1 | io.micronaut.openapi.annotation.mappers.OpenAPIManagementAnnotationMapper
2 | io.micronaut.openapi.annotation.mappers.OpenAPISecurityAnnotationMapper
3 |
--------------------------------------------------------------------------------
/openapi/src/main/resources/META-INF/services/io.micronaut.inject.visitor.TypeElementVisitor:
--------------------------------------------------------------------------------
1 | io.micronaut.openapi.visitor.OpenApiApplicationVisitor
2 | io.micronaut.openapi.visitor.OpenApiControllerVisitor
3 | io.micronaut.openapi.visitor.OpenApiEndpointVisitor
4 | io.micronaut.openapi.visitor.OpenApiIncludeVisitor
5 | io.micronaut.openapi.visitor.OpenApiJacksonVisitor
6 | io.micronaut.openapi.visitor.OpenApiGroupInfoVisitor
7 | io.micronaut.openapi.visitor.OpenApiExtraSchemaVisitor
8 |
--------------------------------------------------------------------------------
/openapi/src/main/resources/templates/openapi-explorer/res/README.md:
--------------------------------------------------------------------------------
1 | [OpenAPI Explorer](https://github.com/Authress-Engineering/openapi-explorer) is [licensed under the Apache License, Version 2.0](https://github.com/Authress-Engineering/openapi-explorer/blob/release/2.2/LICENSE).
2 |
3 | The minimized version of the OpenAPI Explorer is available at:
4 |
5 | https://cdn.jsdelivr.net/npm/openapi-explorer/dist/browser/openapi-explorer.min.js
6 |
--------------------------------------------------------------------------------
/openapi/src/main/resources/templates/openapi-explorer/res/default.min.css:
--------------------------------------------------------------------------------
1 | .hljs{display:block;overflow-x:auto;padding:.5em;background:#F0F0F0}.hljs,.hljs-subst{color:#444}.hljs-comment{color:#888888}.hljs-keyword,.hljs-attribute,.hljs-selector-tag,.hljs-meta-keyword,.hljs-doctag,.hljs-name{font-weight:bold}.hljs-type,.hljs-string,.hljs-number,.hljs-selector-id,.hljs-selector-class,.hljs-quote,.hljs-template-tag,.hljs-deletion{color:#880000}.hljs-title,.hljs-section{color:#880000;font-weight:bold}.hljs-regexp,.hljs-symbol,.hljs-variable,.hljs-template-variable,.hljs-link,.hljs-selector-attr,.hljs-selector-pseudo{color:#BC6060}.hljs-literal{color:#78A960}.hljs-built_in,.hljs-bullet,.hljs-code,.hljs-addition{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}
2 |
--------------------------------------------------------------------------------
/openapi/src/main/resources/templates/rapidoc/res/README.md:
--------------------------------------------------------------------------------
1 | [RapiDoc](https://github.com/rapi-doc/RapiDoc) is [licensed under the MIT License](https://github.com/rapi-doc/RapiDoc/blob/master/LICENSE.txt).
2 |
3 | The minimized version of the RapiDoc is available at:
4 |
5 | https://cdn.jsdelivr.net/npm/rapidoc/dist/rapidoc-min.js
6 |
--------------------------------------------------------------------------------
/openapi/src/main/resources/templates/redoc/res/README.md:
--------------------------------------------------------------------------------
1 | [Redoc](https://github.com/Redocly/ReDoc/) is [licensed under the MIT License](https://github.com/Redocly/redoc/blob/main/LICENSE).
2 |
3 | The minimized version of the Redoc is available at:
4 |
5 | https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js
6 |
--------------------------------------------------------------------------------
/openapi/src/main/resources/templates/swagger-ui/res/README.md:
--------------------------------------------------------------------------------
1 | [SwaggerUI](https://github.com/swagger-api/swagger-ui) is [licensed under the Apache License Version 2.0](https://github.com/swagger-api/swagger-ui/blob/master/LICENSE).
2 |
3 | The minimized version of the Swagger UI is available at:
4 |
5 | https://cdn.jsdelivr.net/npm/swagger-ui/dist/swagger-ui.js
6 |
--------------------------------------------------------------------------------
/openapi/src/main/resources/templates/swagger-ui/res/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micronaut-projects/micronaut-openapi/e6b3998ce46a2dc3f229efd02e61a6e6a3df30f5/openapi/src/main/resources/templates/swagger-ui/res/favicon-16x16.png
--------------------------------------------------------------------------------
/openapi/src/main/resources/templates/swagger-ui/res/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micronaut-projects/micronaut-openapi/e6b3998ce46a2dc3f229efd02e61a6e6a3df30f5/openapi/src/main/resources/templates/swagger-ui/res/favicon-32x32.png
--------------------------------------------------------------------------------
/openapi/src/main/resources/templates/swagger-ui/res/index.css:
--------------------------------------------------------------------------------
1 | html{box-sizing:border-box;overflow:-moz-scrollbars-vertical;overflow-y:scroll}*,:after,:before{box-sizing:inherit}body{margin:0;background:#fafafa}
--------------------------------------------------------------------------------
/openapi/src/main/resources/templates/swagger-ui/theme/classic.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micronaut-projects/micronaut-openapi/e6b3998ce46a2dc3f229efd02e61a6e6a3df30f5/openapi/src/main/resources/templates/swagger-ui/theme/classic.css
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/AbstractOpenApiTypeElementSpec.groovy:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi
2 |
3 | import io.micronaut.annotation.processing.test.AbstractTypeElementSpec
4 | import io.micronaut.openapi.visitor.OpenApiConfigProperty
5 | import io.micronaut.openapi.visitor.Utils
6 |
7 | abstract class AbstractOpenApiTypeElementSpec extends AbstractTypeElementSpec {
8 |
9 | def setup() {
10 | Utils.clean()
11 | System.clearProperty(OpenApiConfigProperty.MICRONAUT_OPENAPI_ENABLED)
12 | System.setProperty(Utils.ATTR_TEST_MODE, "true")
13 | System.setProperty(OpenApiConfigProperty.MICRONAUT_OPENAPI_ADOC_ENABLED, "false")
14 | }
15 |
16 | def cleanup() {
17 | Utils.clean()
18 | System.clearProperty(Utils.ATTR_TEST_MODE)
19 | System.clearProperty(OpenApiConfigProperty.MICRONAUT_OPENAPI_ADOC_ENABLED)
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/MyJaxbElement.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi;
2 |
3 | class MyJaxbElement {
4 |
5 | private String type;
6 | private T value;
7 |
8 | public String getType() {
9 | return type;
10 | }
11 |
12 | public void setType(String type) {
13 | this.type = type;
14 | }
15 |
16 | public T getValue() {
17 | return value;
18 | }
19 |
20 | public void setValue(T value) {
21 | this.value = value;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/MyJaxbElement2.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi;
2 |
3 | import java.util.List;
4 |
5 | class MyJaxbElement2 {
6 |
7 | private String type;
8 | private List values;
9 |
10 | public String getType() {
11 | return type;
12 | }
13 |
14 | public void setType(String type) {
15 | this.type = type;
16 | }
17 |
18 | public List getValues() {
19 | return values;
20 | }
21 |
22 | public void setValues(List values) {
23 | this.values = values;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/MyJaxbElement3.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi;
2 |
3 | class MyJaxbElement3 {
4 |
5 | private String type;
6 | private String value;
7 |
8 | public String getType() {
9 | return type;
10 | }
11 |
12 | public void setType(String type) {
13 | this.type = type;
14 | }
15 |
16 | public String getValue() {
17 | return value;
18 | }
19 |
20 | public void setValue(String value) {
21 | this.value = value;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/PubGenObject.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi;
2 |
3 | public class PubGenObject {
4 |
5 | public T field;
6 |
7 | public static class ListInnerItem {
8 |
9 | public int field1;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/SwaggerPage.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi;
2 |
3 | import java.util.List;
4 |
5 | public class SwaggerPage {
6 |
7 | public List content;
8 | public int num;
9 | }
10 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/api/v1_0_0/MyDto.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.api.v1_0_0;
2 |
3 | public class MyDto {
4 | }
5 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/api/v2_0_1/MyDto.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.api.v2_0_1;
2 |
3 | public class MyDto {
4 | }
5 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/extra/ExtraModel1.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.extra;
2 |
3 | public class ExtraModel1 {
4 |
5 | public String prop1;
6 | public InternalClass ddd;
7 |
8 | public static class InternalClass {
9 |
10 | public String prop2;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/extra/ExtraModel2.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.extra;
2 |
3 | public class ExtraModel2 {
4 |
5 | public int field1;
6 | }
7 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/extra/internal/ExtraModelInternalPackage.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.extra.internal;
2 |
3 | public class ExtraModelInternalPackage {
4 |
5 | public String prop1;
6 | }
7 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/model/one/Response.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.model.one;
2 |
3 | public record Response(String body) {
4 | }
5 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/model/two/Response.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.model.two;
2 |
3 | public record Response(String body) {
4 | }
5 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/proto/ProductsListProtoOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: products.proto
3 |
4 | // Protobuf Java Version: 3.25.2
5 | package io.micronaut.openapi.proto;
6 |
7 | public interface ProductsListProtoOrBuilder extends
8 | // @@protoc_insertion_point(interface_extends:proto.product.ProductsListProto)
9 | com.google.protobuf.MessageOrBuilder {
10 |
11 | /**
12 | * repeated .proto.product.ProductProto products = 1;
13 | */
14 | java.util.List
15 | getProductsList();
16 | /**
17 | * repeated .proto.product.ProductProto products = 1;
18 | */
19 | ProductProto getProducts(int index);
20 | /**
21 | * repeated .proto.product.ProductProto products = 1;
22 | */
23 | int getProductsCount();
24 | /**
25 | * repeated .proto.product.ProductProto products = 1;
26 | */
27 | java.util.List extends ProductProtoOrBuilder>
28 | getProductsOrBuilderList();
29 | /**
30 | * repeated .proto.product.ProductProto products = 1;
31 | */
32 | ProductProtoOrBuilder getProductsOrBuilder(
33 | int index);
34 | }
35 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/proto/SubObjectProtoOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: products.proto
3 |
4 | // Protobuf Java Version: 3.25.2
5 | package io.micronaut.openapi.proto;
6 |
7 | public interface SubObjectProtoOrBuilder extends
8 | // @@protoc_insertion_point(interface_extends:proto.product.SubObjectProto)
9 | com.google.protobuf.MessageOrBuilder {
10 |
11 | /**
12 | * int32 reqField = 1;
13 | * @return The reqField.
14 | */
15 | int getReqField();
16 | }
17 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/test1/Entity.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test1;
2 |
3 | import io.micronaut.core.annotation.Introspected;
4 |
5 | @Introspected
6 | public class Entity {
7 |
8 | private final String fieldB;
9 |
10 | public Entity(final String fieldB) {
11 | this.fieldB = fieldB;
12 | }
13 |
14 | public String getFieldB() {
15 | return fieldB;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/test1/EntityWithGeneric.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test1;
2 |
3 | import io.micronaut.core.annotation.Introspected;
4 |
5 | @Introspected
6 | public class EntityWithGeneric {
7 |
8 | private final T fieldB;
9 |
10 | public EntityWithGeneric(final T fieldB) {
11 | this.fieldB = fieldB;
12 | }
13 |
14 | public T getFieldB() {
15 | return fieldB;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/test2/Entity.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test2;
2 |
3 | import io.micronaut.core.annotation.Introspected;
4 |
5 | @Introspected
6 | public class Entity {
7 |
8 | private final String fieldA;
9 |
10 | public Entity(final String fieldA) {
11 | this.fieldA = fieldA;
12 | }
13 |
14 | public String getFieldA() {
15 | return fieldA;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/test2/EntityWithGeneric.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test2;
2 |
3 | import io.micronaut.core.annotation.Introspected;
4 |
5 | @Introspected
6 | public class EntityWithGeneric {
7 |
8 | private final T fieldA;
9 |
10 | public EntityWithGeneric(final T fieldA) {
11 | this.fieldA = fieldA;
12 | }
13 |
14 | public T getFieldA() {
15 | return fieldA;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/test3/Entity.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test3;
2 |
3 | import io.micronaut.core.annotation.Introspected;
4 |
5 | @Introspected
6 | public class Entity {
7 |
8 | private final String fieldC;
9 |
10 | public Entity(final String fieldC) {
11 | this.fieldC = fieldC;
12 | }
13 |
14 | public String getFieldC() {
15 | return fieldC;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/test3/EntityWithGeneric.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test3;
2 |
3 | import io.micronaut.core.annotation.Introspected;
4 |
5 | @Introspected
6 | public class EntityWithGeneric {
7 |
8 | private final T fieldC;
9 |
10 | public EntityWithGeneric(final T fieldC) {
11 | this.fieldC = fieldC;
12 | }
13 |
14 | public T getFieldC() {
15 | return fieldC;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/visitor/OpenApiInnerClassSpec.groovy:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.visitor
2 |
3 | import io.micronaut.openapi.AbstractOpenApiTypeElementSpec
4 | import io.swagger.v3.oas.models.OpenAPI
5 |
6 | class OpenApiInnerClassSpec extends AbstractOpenApiTypeElementSpec {
7 |
8 | void "test build OpenAPI inner classes"() {
9 |
10 | when:
11 | buildBeanDefinition('test.MyBean', '''
12 | package test;
13 |
14 | import io.micronaut.http.annotation.Controller;
15 | import io.micronaut.http.annotation.Get;
16 |
17 | import java.util.Collections;
18 | import java.util.List;
19 |
20 | class ParentClass {
21 |
22 | @Controller("/path")
23 | public static class OpenApiController {
24 | @Get("/tags/{tagId}/update")
25 | public void postRaw() {
26 | }
27 | }
28 | }
29 |
30 | @jakarta.inject.Singleton
31 | class MyBean {}
32 | ''')
33 | then: "the state is correct"
34 | Utils.testReference != null
35 |
36 | when: "The OpenAPI is retrieved"
37 | OpenAPI openAPI = Utils.testReference
38 |
39 | then:
40 | openAPI.paths
41 | openAPI.paths.size() == 1
42 | openAPI.paths."/path/tags/{tagId}/update"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/openapi/src/test/groovy/io/micronaut/openapi/visitor/OpenApiPathParamRegexSpec.groovy:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.visitor
2 |
3 | import io.micronaut.openapi.AbstractOpenApiTypeElementSpec
4 | import io.swagger.v3.oas.models.OpenAPI
5 |
6 | class OpenApiPathParamRegexSpec extends AbstractOpenApiTypeElementSpec {
7 |
8 | void "test build OpenAPI path parameters with regex"() {
9 |
10 | when:
11 | buildBeanDefinition('test.MyBean', '''
12 | package test;
13 |
14 | import io.micronaut.http.annotation.Controller;
15 | import io.micronaut.http.annotation.Post;
16 | import io.swagger.v3.oas.annotations.Operation;
17 |
18 | @Controller("/path")
19 | class OpenApiController {
20 |
21 | @Operation(summary = "Update tag", description = "Updates an existing tag", tags = "users_tag")
22 | @Post("/tags/{tagId: \\\\d+}/{path:.*}{.ext}/update{?max,offset}{/id:[a-zA-Z]+}")
23 | public void postRaw() {
24 | }
25 | }
26 |
27 | @jakarta.inject.Singleton
28 | class MyBean {}
29 | ''')
30 | then: "the state is correct"
31 | Utils.testReference != null
32 |
33 | when: "The OpenAPI is retrieved"
34 | OpenAPI openAPI = Utils.testReference
35 |
36 | then:
37 | openAPI.paths
38 | openAPI.paths."/path/tags/{tagId}/{path}/update/{id}"
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/openapi/src/test/java/io/micronaut/sample/FooRecord.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.sample;
2 |
3 | import io.micronaut.serde.annotation.Serdeable;
4 |
5 | @Serdeable
6 | public record FooRecord(
7 | String foo,
8 | String bar
9 | ) {
10 | }
11 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-additional-files.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | openapi:
3 | additional:
4 | files-merge-mode: append
5 | files:
6 | - project:src/test/resources/swagger/openapi.yml
7 | - classpath:/swagger/petstore.yml
8 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-additional-files2.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | openapi:
3 | additional:
4 | files-merge-mode: append
5 | files:
6 | - project:src/test/resources/merge/option-endpoints.yml
7 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-additional-files3.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | openapi:
3 | additional:
4 | files-merge-mode: append
5 | files:
6 | - project:src/test/resources/merge/diff-media-type.yml
7 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-disabled-openapi.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | openapi:
3 | enabled: false
4 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-endpoints.yml:
--------------------------------------------------------------------------------
1 | endpoints:
2 | health:
3 | enabled: false
4 | routes:
5 | enabled: false
6 | beans:
7 | path: /test
8 | description: This is test description
9 | extensions:
10 | ext1: '{"prop1": true, "prop2": 123, "prop3": "value"}'
11 |
12 |
13 | management:
14 | endpoints:
15 | web:
16 | path-mapping:
17 | health: /test
18 | base-path: /actuator
19 | server:
20 | base-path: /my
21 | port: 9090
22 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-expand-props.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | openapi:
3 | expand:
4 | url1: /expandUrl1
5 | url2: /expandUrl2
6 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-info.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | application:
3 | name: openapi-test
4 |
5 | views:
6 | folder: static
7 |
8 | router:
9 | static-resources:
10 | default:
11 | enabled: true
12 | mapping: /**/*
13 | paths:
14 | - classpath:static
15 |
16 | swagger:
17 | paths: classpath:META-INF/swagger
18 | mapping: /swagger/**
19 |
20 | server:
21 | multipart:
22 | max-file-size: 10485760 # 10 MiB
23 |
24 | netty:
25 | default:
26 | allocator:
27 | max-order: 3
28 |
29 | api:
30 | title: "Example API"
31 | version: "1.0"
32 | description: "API for ..."
33 |
34 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-local.yml:
--------------------------------------------------------------------------------
1 | props-from-env-test:
2 | paths:
3 | my-controller:
4 | get: this/is/path/from/local/env
5 | put: this/is/path/from/local/env
6 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-local2.yml:
--------------------------------------------------------------------------------
1 | env-logout:
2 | placeholder: /fromEnvLogoutUrl
3 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-schemadecorator.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | openapi:
3 | schema:
4 | decorator:
5 | postfix:
6 | io.micronaut.openapi.api.v1_0_0: '1_0_0'
7 | io.micronaut.openapi.api.v2_0_1: '2_0_1'
8 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-schemaforclass.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | openapi:
3 | schema:
4 | mapping:
5 | io.micronaut.openapi.ObjectId: java.lang.String
6 | io.micronaut.openapi.JAXBElement: io.micronaut.openapi.MyJaxbElement
7 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-security.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | security:
3 | enabled: true
4 | reject-not-found: false
5 | redirect:
6 | forbidden:
7 | enabled: false
8 | unauthorized:
9 | enabled: false
10 | token:
11 | enabled: true
12 | intercept-url-map:
13 | - pattern: /swagger/*
14 | http-method: GET
15 | access: isAnonymous()
16 | - pattern: /swagger-ui/*
17 | http-method: GET
18 | access: isAnonymous()
19 | - pattern: /fromfile/*
20 | access: isAuthenticated()
21 | - pattern: /from-file2/*
22 | http-method: PUT
23 | access: role1,role2
24 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application-spring-actuator.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: test-suite-java-spring
4 | main:
5 | banner-mode: off
6 |
7 | management:
8 | endpoints:
9 | web:
10 | path-mapping:
11 | health: /test
12 | base-path: /actuator
13 | exposure:
14 | include: health, beans, metrics, prometheus, unknown
15 | server:
16 | base-path: /my
17 | port: 9090
18 |
19 | logging:
20 | pattern:
21 | console: '%cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n'
22 | level:
23 | root: info
24 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/application.yml:
--------------------------------------------------------------------------------
1 | props-from-env-test:
2 | paths:
3 | my-controller:
4 | post: this/is/path/from/default/env
5 | put: this/is/path/from/default/env
6 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/merge/option-endpoints.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.0.1
2 | info:
3 | title: demo
4 | version: "0.0"
5 | paths:
6 | /resources/{id}:
7 | options:
8 | operationId: resourcesOptions
9 | responses:
10 | "200":
11 | description: Success
12 | headers:
13 | Access-Control-Allow-Origin:
14 | schema:
15 | type: string
16 | Access-Control-Allow-Credentials:
17 | schema:
18 | type: string
19 | Access-Control-Allow-Methods:
20 | schema:
21 | type: string
22 | Access-Control-Allow-Headers:
23 | schema:
24 | type: string
25 | content:
26 | application/json: {}
27 |
--------------------------------------------------------------------------------
/openapi/src/test/resources/swagger/openapi.yml:
--------------------------------------------------------------------------------
1 | openapi: 3.1.0
2 | info:
3 | version: "1"
4 | title: api
5 | paths:
6 | /example-route:
7 | get:
8 | responses:
9 | "200":
10 | content:
11 | "application/json":
12 | schema:
13 | type: string
14 | description: this is my unique description
15 | components:
16 | schemas:
17 | BusinessObject:
18 | type: string
--------------------------------------------------------------------------------
/src/main/docs/guide/breaks.adoc:
--------------------------------------------------------------------------------
1 | This section documents breaking changes between Micronaut OpenAPI versions:
2 |
3 | == Micronaut OpenAPI 4.0.0
4 |
5 | Micronaut OpenAPI no longer generates `200` or `default` HTTP status code responses when using `@ApiResponse` annotation. It's up to the user to define all the appropriate status codes.
6 |
--------------------------------------------------------------------------------
/src/main/docs/guide/cli.adoc:
--------------------------------------------------------------------------------
1 | To create a project with OpenAPI/Swagger support using the Micronaut CLI, supply the `openapi` feature to the `features` flag. For example:
2 |
3 | [source,commandline]
4 | ----
5 | $ mn create-app my-openapi-app --features openapi
6 | ----
7 |
8 | This will create a project with the minimum necessary configuration for OpenAPI.
9 |
10 | If you have already created a Micronaut project and will like to add Swagger support, you can simply follow instructions in subsequent sections.
11 |
--------------------------------------------------------------------------------
/src/main/docs/guide/configuration.adoc:
--------------------------------------------------------------------------------
1 | It is possible to tweak the OpenAPI processing with system properties or with
2 | a properties file. Options specified with system properties have priority over
3 | those defined in the `openapi.properties` file.
4 |
--------------------------------------------------------------------------------
/src/main/docs/guide/configuration/applicationConfiguration.adoc:
--------------------------------------------------------------------------------
1 | It is possible to tweak the OpenAPI processing via standard way with micronaut environments (application.yml file).
2 |
3 | .application.yml Example
4 | [source,yaml]
5 | ----
6 | micronaut:
7 | openapi:
8 | target:
9 | file: myspecfile.yml
10 | property:
11 | naming:
12 | strategy: KEBAB_CASE
13 | ----
14 |
15 | Also, you can use properties from `application.yml` file for placeholders.
16 |
17 | .application.yml Sample properties for placeholders
18 | [source,yaml]
19 | ----
20 | my:
21 | api:
22 | version: 1.0.0
23 | title: My title
24 | api-description: My description
25 | ----
26 |
27 | .Application.java Simple Application
28 | [source,java]
29 | ----
30 | @OpenAPIDefinition(
31 | info = @Info(
32 | title = "${my.api.version}",
33 | version = "${my.api.title}",
34 | description = "${my.api.api-description}"
35 | )
36 | )
37 | public class Application {
38 |
39 | public static void main(String[] args) {
40 | Micronaut.run(Application.class);
41 | }
42 | }
43 | ----
44 |
--------------------------------------------------------------------------------
/src/main/docs/guide/configuration/systemPropertyConfiguration.adoc:
--------------------------------------------------------------------------------
1 | It is possible to tweak the OpenAPI processing via system properties.
2 |
3 | For instance in gradle:
4 |
5 | .Gradle
6 | [source,groovy]
7 | ----
8 | tasks.withType(JavaCompile) {
9 | options.fork = true
10 | options.forkOptions.jvmArgs << '-Dmicronaut.openapi.property.naming.strategy=SNAKE_CASE'
11 |
12 | ...
13 | }
14 | ----
15 |
16 | or in gradle.properties
17 | [source,properties]
18 | ----
19 | org.gradle.jvmargs=-Dmicronaut.openapi.property.naming.strategy=SNAKE_CASE
20 | ----
21 |
22 | or in maven:
23 |
24 | .Maven
25 | [source,xml]
26 | ----
27 |
28 |
29 |
30 | org.apache.maven.plugins
31 | maven-compiler-plugin
32 |
33 | true
34 |
35 | -J-Dmicronaut.openapi.property.naming.strategy=SNAKE_CASE
36 | ...
37 |
38 |
39 |
40 |
41 |
42 | ----
43 |
--------------------------------------------------------------------------------
/src/main/docs/guide/endpoints.adoc:
--------------------------------------------------------------------------------
1 | It is possible to expose management Endpoints in the OpenAPI specification file.
2 |
--------------------------------------------------------------------------------
/src/main/docs/guide/endpoints/enableendpoints.adoc:
--------------------------------------------------------------------------------
1 | To process user defined endpoints simply add:
2 |
3 | .openapi.properties
4 | ----
5 | endpoints.enabled=true
6 | ...
7 | ..
8 | .
9 | ----
10 |
--------------------------------------------------------------------------------
/src/main/docs/guide/endpoints/endpointservers.adoc:
--------------------------------------------------------------------------------
1 | You can also provide some servers for all endpoints with the `endpoints.servers=` flag, for instance:
2 | [source,properties]
3 | ----
4 | endpoints.servers=[ \
5 | { \
6 | "url": "https://{username}.gigantic-server.com:{port}/{basePath}", \
7 | "description": "The production API server", \
8 | "variables": { \
9 | "username": { \
10 | "default": "demo", \
11 | "description": "this value is assigned by the service provider, in this example `gigantic-server.com`" \
12 | }, \
13 | "port": { \
14 | "enum": [ \
15 | "8443", \
16 | "443" \
17 | ], \
18 | "default": "8443" \
19 | }, \
20 | "basePath": { \
21 | "default": "v2" \
22 | } \
23 | } \
24 | } \
25 | ]
26 | ----
27 |
--------------------------------------------------------------------------------
/src/main/docs/guide/endpoints/endpointspath.adoc:
--------------------------------------------------------------------------------
1 | If you are using a custom path for your endpoints use `endpoints.path` to set it:
2 |
3 | .openapi.properties *endpoints.path* property
4 | [source,properties]
5 | ----
6 | endpoints.path=/endpoints
7 | ...
8 | ..
9 | .
10 | ----
11 |
--------------------------------------------------------------------------------
/src/main/docs/guide/endpoints/endpointssecurityrequirements.adoc:
--------------------------------------------------------------------------------
1 | You can also provide some security requirements for all endpoints with the `endpoints.security-requirements=` flag, for instance:
2 |
3 | .openapi.properties endpoints.security-requirement property
4 | [source,properties]
5 | ----
6 | endpoints.security-requirements=[{"api_key": []}]
7 | ...
8 | ..
9 | .
10 | ----
11 |
12 | Don't forget to declare the referenced `SecurityScheme`.
13 |
--------------------------------------------------------------------------------
/src/main/docs/guide/endpoints/endpointstags.adoc:
--------------------------------------------------------------------------------
1 | You can also provide some tags for all endpoints with the `endpoints.tags=` flag, for instance:
2 |
3 | .openapi.properties
4 | [source,properties]
5 | ----
6 | endpoints.tags=Management Endpoints
7 | ----
8 |
--------------------------------------------------------------------------------
/src/main/docs/guide/exposingSwaggerOutput.adoc:
--------------------------------------------------------------------------------
1 | If you wish to expose the generated OpenAPI yaml output from your running application you can simply add the necessary static resource to the application configuration. For example:
2 |
3 | .Exposing OpenAPI YAML
4 | [configuration]
5 | ----
6 | micronaut:
7 | router:
8 | static-resources:
9 | swagger:
10 | paths: classpath:META-INF/swagger
11 | mapping: /swagger/**
12 | ----
13 |
14 | With the above configuration in place when you run your application you can access your Swagger documentation at `http://localhost:8080/swagger/hello-world-0.0.yml`.
15 |
--------------------------------------------------------------------------------
/src/main/docs/guide/gettingStarted.adoc:
--------------------------------------------------------------------------------
1 | To get started add Micronaut's `openapi` to the annotation processor scope of your build configuration:
2 |
3 | dependency:micronaut-openapi[scope="annotationProcessor", groupId="io.micronaut.openapi"]
4 |
5 | [NOTE]
6 | ====
7 | For Kotlin the `openapi` dependency should be in the `kapt` or `ksp` scope and for Groovy in the `compileOnly` scope.
8 | ====
9 |
10 | To use the https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Annotations[Swagger Annotations] or Micronaut OpenAPI annotations add them to compile classpath
11 |
12 | dependency:micronaut-openapi-annotations[scope="compileOnly", groupId="io.micronaut.openapi"]
13 |
14 | [NOTE]
15 | ====
16 | Also, do not forget that for the correct operation of the annotation processor, the correct parameter
17 | names in the controllers are required, therefore it is recommended that all libraries from which you plan
18 | to add controllers be compiled with the `-parameters` flag. For example like this (with gradle build):
19 | [source,groovy]
20 | ----
21 | tasks.withType(JavaCompile).configureEach {
22 | options.compilerArgs = [
23 | '-parameters'
24 | ]
25 | }
26 | ----
27 | ====
28 |
--------------------------------------------------------------------------------
/src/main/docs/guide/introduction.adoc:
--------------------------------------------------------------------------------
1 | Micronaut includes support for producing https://www.openapis.org[OpenAPI] (Swagger) YAML at compilation time. Micronaut will at compile time produce a OpenAPI 3.x compliant YAML file just based on the regular Micronaut annotations and the javadoc comments within your code.
2 |
3 | You can customize the generated Swagger using the standard <>.
4 |
--------------------------------------------------------------------------------
/src/main/docs/guide/kotlin.adoc:
--------------------------------------------------------------------------------
1 | To support incremental annotation processing, you need to explicitly set the path to
2 | the project directory through the annotation processor setting `micronaut.openapi.project.dir` like this:
3 |
4 | .Gradle
5 | [source,groovy]
6 | ----
7 | kapt {
8 | arguments {
9 | arg("micronaut.openapi.project.dir", projectDir.toString())
10 | }
11 | }
12 | ----
13 |
--------------------------------------------------------------------------------
/src/main/docs/guide/micronautOpenApiAnnotations.adoc:
--------------------------------------------------------------------------------
1 | Several annotations (api:openapi.annotation.OpenAPIDecorator[]
2 | api:openapi.annotation.OpenAPIGroup[]
3 | api:openapi.annotation.OpenAPIGroupInfo[]
4 | api:openapi.annotation.OpenAPIInclude[]
5 | api:openapi.annotation.OpenAPIManagement[])
6 | api:openapi.annotation.OpenAPISecurity[]
7 | are available to enhance the generated OpenAPI.
8 |
9 | To use them add Micronaut's `openapi` to to compile classpath of your application:
10 |
11 | dependency:micronaut-openapi-annotations[scope="compileOnly", groupId="io.micronaut.openapi"]
12 |
--------------------------------------------------------------------------------
/src/main/docs/guide/micronautOpenApiAnnotations/openapidecorator.adoc:
--------------------------------------------------------------------------------
1 | The annotation can be used to add suffix and prefix for operationIds.
2 | This solves the problem when you have several different controllers, but with same operation names.
3 |
4 | For example, when you have 2 controllers with same operations, but use generics:
5 | [source,java]
6 | ----
7 | @OpenAPIDecorator(opIdPrefix = "cats-", opIdSuffix = "-suffix")
8 | @Controller("/cats")
9 | interface MyCatsOperations extends Api {
10 | }
11 |
12 | @OpenAPIDecorator("dogs-")
13 | @Controller("/dogs")
14 | interface MyDogsOperations extends Api {
15 | }
16 | ----
17 |
--------------------------------------------------------------------------------
/src/main/docs/guide/micronautOpenApiAnnotations/openapiextraschema.adoc:
--------------------------------------------------------------------------------
1 | You can add extra schemas (unused in endpoints) to final specification file. To add unused schemas to openapi file
2 | you can use `@OpenAPIExtraSchema` annotaion.
3 |
4 | To add current class to openapi file just add `@OpenAPIExtraSchema` annotation without any parameters:
5 |
6 | [source,java]
7 | ----
8 | @OpenAPIExtraSchema
9 | class UnusedSchema {
10 |
11 | public String field1;
12 | }
13 | ----
14 |
15 | Another way, you can set classnames or packages to include / exclude extra schemas from final openapi file:
16 |
17 | [source,java]
18 | ----
19 | @OpenAPIExtraSchema(
20 | // classes to add
21 | classes = UnusedModel1.class,
22 | // excluded classes, which marked with `@OpenAPIExtraSchema` annotation
23 | excludeClasses = ExcludedModel.class,
24 | // exclude classes by packages
25 | excludePackages = "io.micronaut.openapi.exclude",
26 | // include classes by packages
27 | packages = "io.micronaut.openapi.extra"
28 | )
29 | class Application {
30 | }
31 | ----
32 |
--------------------------------------------------------------------------------
/src/main/docs/guide/micronautOpenApiAnnotations/openapimanagement.adoc:
--------------------------------------------------------------------------------
1 | api:openapi.annotation.OpenAPIManagement[] adds management endpoints.
2 |
3 | api:openapi.annotation.OpenAPIManagement[] is mapped to:
4 |
5 | [source,java]
6 | ----
7 | @OpenAPIInclude(classes = {
8 | io.micronaut.management.endpoint.beans.BeansEndpoint.class,
9 | io.micronaut.management.endpoint.env.EnvironmentEndpoint.class,
10 | io.micronaut.management.endpoint.health.HealthEndpoint.class,
11 | io.micronaut.management.endpoint.info.InfoEndpoint.class,
12 | io.micronaut.management.endpoint.loggers.LoggersEndpoint.class,
13 | io.micronaut.management.endpoint.refresh.RefreshEndpoint.class,
14 | io.micronaut.management.endpoint.routes.RoutesEndpoint.class,
15 | io.micronaut.management.endpoint.stop.ServerStopEndpoint.class,
16 | io.micronaut.management.endpoint.threads.ThreadDumpEndpoint.class
17 | })
18 | ----
19 |
--------------------------------------------------------------------------------
/src/main/docs/guide/micronautOpenApiAnnotations/openapisecurity.adoc:
--------------------------------------------------------------------------------
1 | api:openapi.annotation.OpenAPISecurity[] adds security endpoints.
2 |
3 | It is mapped to:
4 |
5 | [source,java]
6 | ----
7 | @OpenAPIInclude(classes = {
8 | io.micronaut.security.endpoints.LoginController.class,
9 | io.micronaut.security.endpoints.LogoutController.class
10 | })
11 | ----
12 |
--------------------------------------------------------------------------------
/src/main/docs/guide/namingStrategy.adoc:
--------------------------------------------------------------------------------
1 | You can control how the Schema property names are dumped by setting the `micronaut.openapi.property.naming.strategy` system property. It accepts one of
2 | the following *jackson*'s `PropertyNamingStrategy`:
3 |
4 | * *LOWER_CAMEL_CASE*
5 | * *UPPER_CAMEL_CASE*
6 | * *SNAKE_CASE*
7 | * *UPPER_SNAKE_CASE*
8 | * *LOWER_CASE*
9 | * *KEBAB_CASE*
10 | * *LOWER_DOT_CASE*
11 |
--------------------------------------------------------------------------------
/src/main/docs/guide/openApiDefinition.adoc:
--------------------------------------------------------------------------------
1 | You can add a `@OpenAPIDefinition` annotation to your `Application` class or another class to describe global components (security schemas, servers etc.) and common information, like license, contact, version etc.:
2 |
3 | .Example @OpenAPIDefinition usage
4 | snippet::io.micronaut.configuration.openapi.docs.Application[tags="imports,clazz", project-base="docs-examples/example"]
5 |
6 | With that in place, you compile your project and a OpenAPI YAML file will be generated to the `META-INF/swagger` directory of your project's class output. For example, the above configuration generates:
7 |
8 | * For Java `build/classes/java/main/META-INF/swagger/hello-world-0.0.yml`
9 | * For Kotlin KAPT `build/tmp/kapt3/classes/main/META-INF/swagger/hello-world-0.0.yml`
10 | * For Kotlin KSP `build/generated/ksp/main/resources/META-INF/swagger/hello-world-0.0.yml`
11 |
12 | The previously defined annotations will produce YAML like the following:
13 |
14 | .Generated OpenAPI YAML
15 | [source,yaml]
16 | ----
17 | openapi: 3.0.3
18 | info:
19 | title: the title
20 | description: My API
21 | contact:
22 | name: Fred
23 | url: https://gigantic-server.com
24 | email: Fred@gigagantic-server.com
25 | license:
26 | name: Apache 2.0
27 | url: https://foo.bar
28 | version: "0.0"
29 | ----
30 |
--------------------------------------------------------------------------------
/src/main/docs/guide/openApiGenerator.adoc:
--------------------------------------------------------------------------------
1 | If you wish to generate Micronaut code (e.g. Client/Server) from OpenAPI definition files, utilize the https://micronaut-projects.github.io/micronaut-gradle-plugin/latest/#_openapi_code_generation[Micronaut OpenAPI Gradle Plugin]. Refer to the https://guides.micronaut.io/latest/micronaut-openapi-generator-server["Micronaut server generation with OpenAPI" guide] or the https://guides.micronaut.io/latest/micronaut-openapi-generator-client["Micronaut Client generation with OpenAPI" guide] for details.
2 |
3 |
4 | [WARNING]
5 | ====
6 | Micronaut stopped contributing to https://openapi-generator.tech/[OpenAPIGenerator] with Micronaut 3.X. You will
7 | notice the `helpTxt` in the https://openapi-generator.tech/docs/generators/java-micronaut-client/[generators] have been updated to reflect this. You must use the https://micronaut-projects.github.io/micronaut-gradle-plugin/latest/#_openapi_code_generation[Micronaut OpenAPI Gradle Plugin].
8 | ====
9 |
--------------------------------------------------------------------------------
/src/main/docs/guide/openApiGuides.adoc:
--------------------------------------------------------------------------------
1 | See the following list of guides to learn more about working with OpenAPI in the Micronaut Framework:
2 |
3 | https://guides.micronaut.io/latest/tag-open_api.html
4 |
--------------------------------------------------------------------------------
/src/main/docs/guide/openApiViews.adoc:
--------------------------------------------------------------------------------
1 | Micronaut can generate views for your generated OpenAPI specification. Currently, https://github.com/swagger-api/swagger-ui[Swagger Ui], https://github.com/Redocly/redoc[Redoc], https://github.com/Authress-Engineering/openapi-explorer[OpenAPI Explorer], https://github.com/scalar/scalar[Scalar] and https://github.com/rapi-doc/RapiDoc[RapiDoc] are supported.
2 | You can also use https://mrin9.github.io/RapiPdf/[RapiPdf] to generate a PDF from your spec file.
3 |
4 | You can enable multiple views generation in a single application.
5 |
6 | The resources needed to render the views (javascript, css, ...) are loaded from CDNs: https://cdn.jsdelivr.net[cdn.jsdelivr.net] and https://fonts.googleapis.com/[fonts.googleapis.com].
7 |
--------------------------------------------------------------------------------
/src/main/docs/guide/openApiViews/mappingPath.adoc:
--------------------------------------------------------------------------------
1 | The path from where the swagger specification will be served by the http server defaults to `swagger`. You can change it via the `mapping.path` property.
2 |
3 | Thus, by default, the views expect to find the `yaml` under `/swagger`.
4 |
5 | If you change this mapping to something else:
6 |
7 | .Exposing Swagger YAML
8 | [configuration]
9 | ----
10 | micronaut:
11 | router:
12 | static-resources:
13 | swagger:
14 | paths: classpath:META-INF/swagger
15 | mapping: /swaggerYAML/**
16 | ----
17 | You will need to set the `mapping.path` property accordingly: `micronaut.openapi.views.spec=mapping.path=swaggerYAML...`.
18 |
--------------------------------------------------------------------------------
/src/main/docs/guide/openApiViews/viewsGenerationWithPropertiesFile.adoc:
--------------------------------------------------------------------------------
1 | By default, the generation of views is disabled. You can enable views generation with a <>.
2 |
3 | .openapi.properties Example Views Generation Swagger UI, ReDoc, RapiDoc, OpenAPI Explorer, Scalar
4 | [source,properties]
5 | ----
6 | micronaut.openapi.views.spec = swagger-ui.enabled=true,\
7 | redoc.enabled=true, \
8 | openapi-explorer.enabled=true, \
9 | scalar.enabled=true, \
10 | rapidoc.enabled=true, \
11 | rapidoc.bg-color=#14191f, \
12 | rapidoc.text-color=#aec2e0, \
13 | rapidoc.sort-endpoints-by=method
14 | ----
15 |
--------------------------------------------------------------------------------
/src/main/docs/guide/releaseHistory.adoc:
--------------------------------------------------------------------------------
1 | For this project, you can find a list of releases (with release notes) here:
2 |
3 | https://github.com/{githubSlug}/releases[https://github.com/{githubSlug}/releases]
4 |
--------------------------------------------------------------------------------
/src/main/docs/guide/repository.adoc:
--------------------------------------------------------------------------------
1 | You can find the source code of this project in this repository:
2 |
3 | https://github.com/{githubSlug}[https://github.com/{githubSlug}]
--------------------------------------------------------------------------------
/src/main/docs/guide/schemaDecorators.adoc:
--------------------------------------------------------------------------------
1 | If you have some classes with same names in different packages you can set postfix like this:
2 |
3 | [configuration]
4 | ----
5 | micronaut:
6 | openapi:
7 | schema-postfix:
8 | org.api.v1_0_0: 1_0_0
9 | org.api.v2_0_0: 2_0_0
10 | ----
11 |
12 | or by system properties:
13 |
14 | [source,commandline]
15 | ----
16 | -Dmicronaut.openapi.schema-postfix.org.api.v1_0_0=1_0_0 -Dmicronaut.openapi.schema-postfix.org.api.v2_0_0=2_0_0
17 | ----
18 |
19 | or by openapi.properties
20 |
21 | [source,properties]
22 | ----
23 | micronaut.openapi.schema-postfix.org.api.v1_0_0=1_0_0
24 | micronaut.openapi.schema-postfix.org.api.v2_0_0=2_0_0
25 | ----
26 |
27 | [IMPORTANT]
28 | ====
29 | After changing these settings, a complete recompilation of the project is necessary to ensure that the new settings are applied correctly.
30 | ====
31 |
--------------------------------------------------------------------------------
/src/main/docs/guide/serverContext.adoc:
--------------------------------------------------------------------------------
1 | In the micronaut configuration file you can define a server context path (with `micronaut.server.context-path`) which serves as a base path for all routes.
2 | Since the yaml specification file and the views are generated at compile time, these resources are not aware of changes during runtime (e.g. context-path is determined by a reverse proxy).
3 |
4 | It is still possible for the views to work in case a context path is defined:
5 |
6 | * Set `micronaut.openapi.server.context.path` property for compile time resolution, or
7 | * Use a `HttpServerFilter` that will add a cookie, or
8 | * Add a parameter to the url.
9 |
10 | The view will first look for the cookie and if not present for the parameter.
--------------------------------------------------------------------------------
/src/main/docs/guide/serverContext/compileResolution.adoc:
--------------------------------------------------------------------------------
1 | Either set `micronaut.openapi.server.context.path` as a System Property or in `openapi.properties`, then all paths will be prepended with the specified value at compile time.
2 |
3 | If you want the resolution of the context path at runtime use one of the following methods:
4 |
--------------------------------------------------------------------------------
/src/main/docs/guide/serverContext/urlParameter.adoc:
--------------------------------------------------------------------------------
1 | Just add a parameter to the view url. For instance if the context path is set to `/context/path` you will access your view with `http://localhost:8080/context/path/swagger-ui?contextPath=%2Fcontext%2Fpath`.
--------------------------------------------------------------------------------
/src/main/docs/guide/spring.adoc:
--------------------------------------------------------------------------------
1 | You can use `micronaut-openapi` to build OpenAPI specification for `Spring` / `Spring Boot` applications. In this case, you do not need to change anything in the code. You can continue to use spring, and use micronaut as a replacement for such libraries as `springdoc-openapi`, `springfox`, `swagger` etc.
2 |
--------------------------------------------------------------------------------
/src/main/docs/guide/spring/springBootActuator.adoc:
--------------------------------------------------------------------------------
1 | If you use `spring-boot-actuator` and want to see actuator endpoints in your Open API specification file - just enable endpoints processing by property `enpoints.enabled = true`.
2 |
3 | By default, all standard Spring Boot Actuator endpoints will be processed. It will also take into account your configuration and what endpoints you currently have enabled. You can also exclude unnecessary endpoints from the specification if you don't need them.
4 |
5 | More information you can read in <> section
6 |
--------------------------------------------------------------------------------
/src/main/docs/guide/spring/springWithGradle.adoc:
--------------------------------------------------------------------------------
1 | To use micronaut-openapi with spring in gradle add this code to you `build.gradle`:
2 |
3 | .build.gradle
4 | [source,groovy]
5 | ----
6 | dependencies {
7 |
8 | // add to annotationProcessor and compileOnly blocks next libraries:
9 |
10 | annotationProcessor("io.micronaut:micronaut-inject-java:$micronautCoreVersion")
11 | annotationProcessor(platfom("io.micronaut.spring:micronaut-spring-bom:$micronautSpringVersion"))
12 | annotationProcessor("io.micronaut.spring:micronaut-spring-annotation")
13 | annotationProcessor("io.micronaut.spring:micronaut-spring-web-annotation")
14 | annotationProcessor("io.micronaut.spring:micronaut-spring-boot-annotation")
15 | annotationProcessor("io.micronaut.openapi:micronaut-openapi:$micronautOpenapiVersion")
16 |
17 | compileOnly("io.micronaut:micronaut-inject-java:$micronautCoreVersion")
18 | compileOnly("io.micronaut.openapi:micronaut-openapi-annotations:$micronautOpenapiVersion")
19 | compileOnly("io.micronaut.serde:micronaut-serde-api:$micronautSerdeVersion")
20 |
21 | }
22 | ----
23 |
24 | For kotlin just change block `annotationProcessor` to `kapt` or `ksp`.
25 |
--------------------------------------------------------------------------------
/src/main/docs/guide/spring/springWithOpenApiView.adoc:
--------------------------------------------------------------------------------
1 | To use micronaut openapi views (Swagger UI, OpenAPi Explorer, Scalar, ReDoc, RapiDoc) you need to add static resources to Spring configuration like this:
2 |
3 | .Example Swagger UI resources routing config
4 | snippet::io.micronaut.openapi.spring.WebConfig[tags="imports,clazz", project-base="test-suite-java-spring"]
5 |
--------------------------------------------------------------------------------
/src/main/docs/guide/swaggerAnnotations/schemasAndGenerics.adoc:
--------------------------------------------------------------------------------
1 | If a method return type includes generics then these will be included when calculating the schema name. For example the following:
2 |
3 | .Swagger returns types and generics
4 | [source,java]
5 | ----
6 | class Response {
7 |
8 | private T r;
9 |
10 | public T getResult() {
11 | return r;
12 | }
13 |
14 | public void setResult(T r) {
15 | this.r = r;
16 | }
17 | }
18 |
19 | @Controller("/")
20 | class MyController {
21 |
22 | @Put("/")
23 | public Response updatePet(Pet pet) {
24 | ...
25 | }
26 | }
27 | ----
28 |
29 | Will result in a schema called `#/components/schemas/Response` being generated. If you wish to alter the name of the schema you can do so with the `@Schema` annotation:
30 |
31 | .Changing the name of response schema
32 | [source,java]
33 | ----
34 | @Put("/")
35 | @Schema(name = "ResponseOfPet")
36 | public Response updatePet(Pet pet) {
37 | ...
38 | }
39 | ----
40 |
41 | In the above case the generated schema will be named `#/components/schemas/ResponseOfPet`.
42 |
--------------------------------------------------------------------------------
/src/main/docs/guide/swaggerAnnotations/schemasAndMetaAnnotations.adoc:
--------------------------------------------------------------------------------
1 | If you don't have control of the source code and don't want to have to annotate each parameter with `@Schema` then it can be convenient to instead use a meta annotation.
2 |
3 | For example if the aforementioned `Pet` class cannot be annotated with `@Schema` you can define a meta annotation:
4 |
5 | .Swagger Meta Annotation
6 | [source,java]
7 | ----
8 | @Documented
9 | @Retention(RUNTIME)
10 | @Target({ElementType.PARAMETER, ElementType.FIELD})
11 | @Schema(name = "MyPet", description = "Pet description")
12 | @interface MyAnn {
13 | }
14 | ----
15 |
16 | Then whenever `Pet` is used as a parameter you can annotate the parameter with `@MyAnn`.
17 |
--------------------------------------------------------------------------------
/src/main/docs/guide/swaggerAnnotations/schemasAnnotationResolution.adoc:
--------------------------------------------------------------------------------
1 | You can apply `@Schema` annotation to type or property. But it's important to note, that Micronaut will prioritize `@Schema` on property over `@Schema` on type.
2 |
3 | .Schema annotation resolution
4 | [source,java]
5 | ----
6 | import io.swagger.v3.oas.annotations.media.Schema;
7 |
8 | @Schema(description="Pet") // <1>
9 | class Pet {
10 | }
11 |
12 | class Owner {
13 |
14 | private Pet cat;
15 | private Pet dog;
16 |
17 | public Pet getCat() { // <2>
18 | return cat;
19 | }
20 |
21 | @Schema(name="MyPet", description="This is my pet") // <3>
22 | public Pet getDog() {
23 | return dog;
24 | }
25 |
26 | }
27 | ----
28 |
29 | <1> Micronaut will detect this annotation
30 | <2> Micronaut will use annotation <1> from type since there is none on property
31 | <3> Micronaut will use this annotation even if there exists one on Pet type
--------------------------------------------------------------------------------
/src/main/docs/guide/versionsAndGroups.adoc:
--------------------------------------------------------------------------------
1 | Micronaut OpenAPI allows you to split the description of endpoints into several
2 | files. To do this, you can use the versioning mechanism built into Micronaut
3 | (using the `@Version` annotation) and / or group endpoints using the `@OpenAPIGroup`
4 | annotation or configuration.
5 |
--------------------------------------------------------------------------------
/src/main/docs/guide/versionsAndGroups/include.adoc:
--------------------------------------------------------------------------------
1 | [separator=::]
2 | = OpenAPI groups:: Integration with Swagger UI
3 |
--------------------------------------------------------------------------------
/src/main/docs/resources/img/swagger-ui-with-groups.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micronaut-projects/micronaut-openapi/e6b3998ce46a2dc3f229efd02e61a6e6a3df30f5/src/main/docs/resources/img/swagger-ui-with-groups.png
--------------------------------------------------------------------------------
/test-suite-generator-util/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "application"
3 | }
4 |
5 | application {
6 | mainClass = "io.micronaut.openapi.testsuite.GeneratorMain"
7 | }
8 |
9 | dependencies {
10 | implementation(projects.micronautOpenapiGenerator)
11 | }
12 |
--------------------------------------------------------------------------------
/test-suite-java-client-generator/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'io.micronaut.build.internal.openapi-java-generator-test-suite'
3 | id 'groovy'
4 | }
5 |
6 | description = """
7 | This project tests that the generated client sources can be compiled and
8 | that tests can be ran with Micronaut 4
9 | """
10 |
11 | dependencies {
12 |
13 | annotationProcessor(mnValidation.micronaut.validation.processor)
14 |
15 | implementation(mn.micronaut.http.client)
16 | implementation(mnSerde.micronaut.serde.jackson)
17 | implementation(mn.jakarta.annotation.api)
18 | implementation(mnValidation.micronaut.validation)
19 | implementation(mnReactor.micronaut.reactor)
20 |
21 | runtimeOnly(mnLogging.logback.classic)
22 |
23 | testImplementation(mnTest.micronaut.test.spock)
24 |
25 | testRuntimeOnly(mn.snakeyaml)
26 | }
27 |
--------------------------------------------------------------------------------
/test-suite-java-client-generator/src/test/groovy/io/micronaut/openapi/test/api/ClientSpec.groovy:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test.api
2 |
3 | import spock.lang.Specification
4 |
5 | import static io.micronaut.openapi.test.util.TestUtils.assertFileContains
6 |
7 | class ClientSpec extends Specification {
8 |
9 | String outputPath = "build/generated/openapi"
10 |
11 | void "test client id"() {
12 | expect:
13 | assertFileContains(outputPath + "/src/main/java/io/micronaut/openapi/test/api/PetApi.java",
14 | '@Client(id = "myClient", path = "${myClient.base-path}")');
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/test-suite-java-jaxrs/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("io.micronaut.build.internal.openapi-test-java")
3 | }
4 |
5 | dependencies {
6 | testAnnotationProcessor(mnJaxrs.micronaut.jaxrs.processor)
7 | testAnnotationProcessor(mnSerde.micronaut.serde.processor)
8 | testAnnotationProcessor(projects.micronautOpenapi)
9 |
10 | testCompileOnly(projects.micronautOpenapiAnnotations)
11 |
12 | testImplementation(mnJaxrs.micronaut.jaxrs.server)
13 | testImplementation(mn.micronaut.http.server.netty)
14 | testImplementation(mnSerde.micronaut.serde.jackson)
15 | testImplementation(mn.micronaut.http.client)
16 | testImplementation(mn.snakeyaml)
17 | }
18 |
--------------------------------------------------------------------------------
/test-suite-java-jaxrs/src/test/java/io/micronaut/openapi/jaxrs/Application.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.jaxrs;
2 |
3 | import io.micronaut.runtime.Micronaut;
4 | import io.swagger.v3.oas.annotations.OpenAPIDefinition;
5 | import io.swagger.v3.oas.annotations.info.Info;
6 |
7 | @OpenAPIDefinition(
8 | info = @Info(
9 | title = "demo",
10 | version = "0.0"
11 | )
12 | )
13 | public class Application {
14 |
15 | public static void main(String[] args) {
16 | Micronaut.run(Application.class, args);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/test-suite-java-jaxrs/src/test/java/io/micronaut/openapi/jaxrs/OpenApiExposedTest.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.jaxrs;
2 |
3 | import io.micronaut.http.client.BlockingHttpClient;
4 | import io.micronaut.http.client.HttpClient;
5 | import io.micronaut.http.client.annotation.Client;
6 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
7 | import org.junit.jupiter.api.Test;
8 |
9 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
10 |
11 | @MicronautTest
12 | class OpenApiExposedTest {
13 |
14 | @Test
15 | void openApi(@Client("/") HttpClient httpClient) {
16 | BlockingHttpClient client = httpClient.toBlocking();
17 | assertDoesNotThrow(() -> client.exchange("/swagger/demo-0.0.yml"));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/test-suite-java-jaxrs/src/test/java/io/micronaut/openapi/jaxrs/OpenApiGeneratedTest.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.jaxrs;
2 |
3 | import io.micronaut.core.io.ResourceLoader;
4 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
5 | import org.junit.jupiter.api.Test;
6 |
7 | import static org.junit.jupiter.api.Assertions.assertTrue;
8 |
9 | @MicronautTest(startApplication = false)
10 | class OpenApiGeneratedTest {
11 |
12 | @Test
13 | void buildGeneratesOpenApi(ResourceLoader resourceLoader) {
14 | assertTrue(resourceLoader.getResource("META-INF/swagger/demo-0.0.yml").isPresent());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/test-suite-java-jaxrs/src/test/java/io/micronaut/openapi/jaxrs/TestController.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.jaxrs;
2 |
3 | import jakarta.ws.rs.GET;
4 | import jakarta.ws.rs.Path;
5 | import jakarta.ws.rs.PathParam;
6 | import jakarta.ws.rs.Produces;
7 |
8 | @Path("/user")
9 | class TestController {
10 |
11 | @GET
12 | @Path("/{userId}")
13 | @Produces("application/json")
14 | public String getUser(@PathParam("userId") String userId) {
15 | return "Pong version " + userId;
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/test-suite-java-jaxrs/src/test/java/io/micronaut/openapi/jaxrs/model/one/Response.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.jaxrs.model.one;
2 |
3 | public record Response(String body) {
4 | }
5 |
--------------------------------------------------------------------------------
/test-suite-java-jaxrs/src/test/java/io/micronaut/openapi/jaxrs/model/two/Response.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.jaxrs.model.two;
2 |
3 | public record Response(String body) {
4 | }
5 |
--------------------------------------------------------------------------------
/test-suite-java-jaxrs/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | micronaut.router.static-resources.swagger.paths=classpath:META-INF/swagger
2 | micronaut.router.static-resources.swagger.mapping=/swagger/**
3 |
--------------------------------------------------------------------------------
/test-suite-java-jaxrs/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-suite-java-server-generator/src/test/resources/application-test.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | server:
3 | context-path: /api
4 |
--------------------------------------------------------------------------------
/test-suite-java-spring/openapi.properties:
--------------------------------------------------------------------------------
1 | micronaut.openapi.views.spec=swagger-ui.enabled=true
2 | endpoints.enabled=true
3 |
--------------------------------------------------------------------------------
/test-suite-java-spring/src/main/java/io/micronaut/openapi/spring/Application.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.spring;
2 |
3 | import io.swagger.v3.oas.annotations.OpenAPIDefinition;
4 | import io.swagger.v3.oas.annotations.info.Info;
5 | import org.springframework.boot.Banner;
6 | import org.springframework.boot.SpringApplication;
7 | import org.springframework.boot.autoconfigure.SpringBootApplication;
8 |
9 | @SpringBootApplication
10 | @OpenAPIDefinition(
11 | info = @Info(
12 | version = "${app.version}"
13 | )
14 | )
15 | public class Application {
16 |
17 | public static void main(String[] args) {
18 | var application = new SpringApplication(Application.class);
19 | application.setBannerMode(Banner.Mode.OFF);
20 | application.run(args);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/test-suite-java-spring/src/main/java/io/micronaut/openapi/spring/WebConfig.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.spring;
2 | // tag::imports[]
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.web.servlet.config.annotation.EnableWebMvc;
5 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
7 |
8 | // end::imports[]
9 | // tag::clazz[]
10 | @Configuration
11 | @EnableWebMvc
12 | public class WebConfig implements WebMvcConfigurer {
13 |
14 | @Override
15 | public void addResourceHandlers(ResourceHandlerRegistry registry) {
16 | registry.addResourceHandler("/swagger-ui/**")
17 | .addResourceLocations("classpath:/META-INF/swagger/views/swagger-ui/");
18 | registry.addResourceHandler("/swagger/**")
19 | .addResourceLocations("classpath:/META-INF/swagger/");
20 | }
21 | }
22 | //end::clazz[]
23 |
--------------------------------------------------------------------------------
/test-suite-java-spring/src/main/java/io/micronaut/openapi/spring/api/dto/User.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.spring.api.dto;
2 |
3 | public class User {
4 |
5 | private long id;
6 | private String name;
7 | private int age;
8 |
9 | public long getId() {
10 | return id;
11 | }
12 |
13 | public void setId(long id) {
14 | this.id = id;
15 | }
16 |
17 | public String getName() {
18 | return name;
19 | }
20 |
21 | public void setName(String name) {
22 | this.name = name;
23 | }
24 |
25 | public int getAge() {
26 | return age;
27 | }
28 |
29 | public void setAge(int age) {
30 | this.age = age;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/test-suite-java-spring/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: test-suite-java-spring
4 | main:
5 | banner-mode: off
6 |
7 | management:
8 | endpoints:
9 | web:
10 | path-mapping:
11 | health: /test
12 | base-path: /actuator
13 | exposure:
14 | include: health, beans, metrics
15 | server:
16 | base-path: /my
17 | port: 9090
18 |
19 | logging:
20 | pattern:
21 | console: '%cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n'
22 | level:
23 | root: info
24 |
--------------------------------------------------------------------------------
/test-suite-java-spring/src/test/java/io/micronaut/openapi/spring/TestConfig.java:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.spring;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.web.client.RestClient;
7 |
8 | @Configuration
9 | public class TestConfig {
10 |
11 | public static final String APP_NAME = "test-suite-java-spring";
12 | public static final String APP_VERSION = "myVersion";
13 |
14 | @Bean
15 | RestClient restClient(@Value("${server.port:8080}") int port) {
16 | return RestClient.builder()
17 | .baseUrl("http://localhost:" + port)
18 | .build();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/test-suite-java-spring/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-suite-kotlin-kapt-client-generator/src/test/kotlin/io/micronaut/openapi/test/api/ClientTest.kt:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test.api
2 |
3 | import io.micronaut.openapi.test.util.TestUtils.assertFileContains
4 | import org.junit.jupiter.api.Test
5 |
6 | class ClientTest {
7 |
8 | private val outputPath: String = "build/generated/openapi"
9 |
10 | @Test
11 | fun testClientId() {
12 | assertFileContains("$outputPath/src/main/kotlin/io/micronaut/openapi/test/api/PetApi.kt",
13 | "@Client(id = \"myClient\", path = \"\\\${myClient.base-path}\")")
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/test-suite-kotlin-kapt-server-generator/src/main/kotlin/io/micronaut/openapi/test/dated/DatedResponse.kt:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test.dated
2 |
3 | import io.micronaut.core.annotation.NonNull
4 | import io.micronaut.core.annotation.Nullable
5 | import java.time.ZonedDateTime
6 |
7 | /**
8 | * A response that contains information about last modification.
9 | *
10 | * @param The response body type.
11 | */
12 | data class DatedResponse(
13 | @NonNull
14 | var body: T,
15 | @Nullable
16 | var lastModified: ZonedDateTime?,
17 | )
18 |
--------------------------------------------------------------------------------
/test-suite-kotlin-kapt-server-generator/src/test/resources/application-test.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | server:
3 | context-path: /api
4 |
--------------------------------------------------------------------------------
/test-suite-kotlin-ksp-client-generator/src/test/groovy/io/micronaut/openapi/test/api/ClientSpec.groovy:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test.api
2 |
3 | import spock.lang.Specification
4 |
5 | import static io.micronaut.openapi.test.util.TestUtils.assertFileContains
6 |
7 | class ClientSpec extends Specification {
8 |
9 | String outputPath = "build/generated/openapi"
10 |
11 | void "test client id"() {
12 | expect:
13 | assertFileContains(outputPath + "/src/main/java/io/micronaut/openapi/test/api/PetApi.java",
14 | '@Client(id = "myClient", path = "${openapi-micronaut-client-base-path}")');
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/test-suite-kotlin-ksp-client-generator/src/test/kotlin/io/micronaut/openapi/test/api/ClientTest.kt:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test.api
2 |
3 | import io.micronaut.openapi.test.util.TestUtils.assertFileContains
4 | import org.junit.jupiter.api.Test
5 |
6 | class ClientTest {
7 |
8 | private val outputPath: String = "build/generated/openapi"
9 |
10 | @Test
11 | fun testClientId() {
12 | assertFileContains("$outputPath/src/main/kotlin/io/micronaut/openapi/test/api/PetApi.kt",
13 | "@Client(id = \"myClient\", path = \"\\\${myClient.base-path}\")")
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/test-suite-kotlin-ksp-server-generator/src/main/kotlin/io/micronaut/openapi/test/dated/DatedResponse.kt:
--------------------------------------------------------------------------------
1 | package io.micronaut.openapi.test.dated
2 |
3 | import io.micronaut.core.annotation.NonNull
4 | import io.micronaut.core.annotation.Nullable
5 | import java.time.ZonedDateTime
6 |
7 | /**
8 | * A response that contains information about last modification.
9 | *
10 | * @param The response body type.
11 | */
12 | data class DatedResponse(
13 | @NonNull
14 | var body: T,
15 | @Nullable
16 | var lastModified: ZonedDateTime?,
17 | )
18 |
--------------------------------------------------------------------------------
/test-suite-kotlin-ksp-server-generator/src/test/resources/application-test.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | server:
3 | context-path: /api
4 |
--------------------------------------------------------------------------------