├── .circleci └── config.yml ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── build-badges-branch.yml │ └── publish-documentation.yml ├── .gitignore ├── LICENSE ├── README.md ├── create-release-bundle.sh ├── docs ├── .nojekyll ├── README.md ├── _navbar.md ├── _sidebar.md ├── configuration.md ├── fr │ ├── README.md │ ├── _sidebar.md │ ├── configuration.md │ ├── quick-start.md │ └── thank-you-section.md ├── index.html ├── quick-start.md └── thank-you-section.md ├── integration-tests ├── pom.xml └── src │ └── test │ ├── java │ └── io │ │ └── github │ │ └── kbuntrock │ │ └── it │ │ └── BasicIT.java │ ├── resources-its │ └── io │ │ └── github │ │ └── kbuntrock │ │ └── it │ │ ├── BasicIT │ │ ├── .predefined-repo │ │ │ └── readme.txt │ │ ├── nominal_test_case_jdk11 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── kbuntrock │ │ │ │ └── sample │ │ │ │ ├── Constants.java │ │ │ │ ├── dto │ │ │ │ ├── Authority.java │ │ │ │ └── UserDto.java │ │ │ │ └── enpoint │ │ │ │ └── UserController.java │ │ ├── nominal_test_case_jdk17 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── kbuntrock │ │ │ │ └── sample │ │ │ │ ├── Constants.java │ │ │ │ ├── dto │ │ │ │ ├── Authority.java │ │ │ │ ├── RecordDto.java │ │ │ │ └── UserDto.java │ │ │ │ └── enpoint │ │ │ │ └── UserController.java │ │ ├── nominal_test_case_jdk21 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── kbuntrock │ │ │ │ └── sample │ │ │ │ ├── Constants.java │ │ │ │ ├── dto │ │ │ │ ├── Authority.java │ │ │ │ ├── RecordDto.java │ │ │ │ └── UserDto.java │ │ │ │ └── enpoint │ │ │ │ └── UserController.java │ │ └── nominal_test_case_jdk8 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── kbuntrock │ │ │ └── sample │ │ │ ├── Constants.java │ │ │ ├── dto │ │ │ ├── Authority.java │ │ │ └── UserDto.java │ │ │ └── enpoint │ │ │ └── UserController.java │ │ └── pom.xml │ └── resources │ └── it │ └── BasicIT │ ├── nominal_test_case-jdk11.yml │ ├── nominal_test_case-jdk17.yml │ ├── nominal_test_case-jdk21.yml │ └── nominal_test_case-jdk8.yml ├── openapi-maven-plugin ├── .idea │ ├── codeStyles │ │ ├── Project.xml │ │ └── codeStyleConfig.xml │ └── saveactions_settings.xml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── kbuntrock │ │ │ ├── ApiResourceScanner.java │ │ │ ├── DocumentationMojo.java │ │ │ ├── JavaClassAnalyser.java │ │ │ ├── MojoRuntimeException.java │ │ │ ├── TagLibrary.java │ │ │ ├── TagLibraryHolder.java │ │ │ ├── configuration │ │ │ ├── ApiConfiguration.java │ │ │ ├── CommonApiConfiguration.java │ │ │ ├── EnumConfig.java │ │ │ ├── EnumConfigHolder.java │ │ │ ├── JavadocConfiguration.java │ │ │ ├── NullableConfigurationHolder.java │ │ │ ├── Operation.java │ │ │ ├── OperationIdHelper.java │ │ │ ├── Substitution.java │ │ │ ├── Tag.java │ │ │ ├── library │ │ │ │ ├── Library.java │ │ │ │ ├── TagAnnotation.java │ │ │ │ └── reader │ │ │ │ │ ├── AstractLibraryReader.java │ │ │ │ │ ├── ClassLoaderUtils.java │ │ │ │ │ ├── JakartaRsReader.java │ │ │ │ │ ├── JavaxRsReader.java │ │ │ │ │ └── SpringMvcReader.java │ │ │ └── parser │ │ │ │ ├── CommonParserUtils.java │ │ │ │ ├── JsonParserUtils.java │ │ │ │ └── YamlParserUtils.java │ │ │ ├── javadoc │ │ │ ├── ClassDocumentation.java │ │ │ ├── CommentType.java │ │ │ ├── JavadocMap.java │ │ │ ├── JavadocParser.java │ │ │ └── JavadocWrapper.java │ │ │ ├── model │ │ │ ├── DataObject.java │ │ │ ├── Endpoint.java │ │ │ ├── OperationType.java │ │ │ ├── ParameterObject.java │ │ │ ├── Tag.java │ │ │ └── annotation │ │ │ │ └── OperationAnnotationInfo.java │ │ │ ├── reflection │ │ │ ├── AdditionnalSchemaLibrary.java │ │ │ ├── GenericArrayTypeImpl.java │ │ │ ├── GenericityResolver.java │ │ │ ├── ParameterizedTypeImpl.java │ │ │ └── ReflectionsUtils.java │ │ │ ├── utils │ │ │ ├── FileUtils.java │ │ │ ├── JavadocUtils.java │ │ │ ├── Logger.java │ │ │ ├── ObjectsUtils.java │ │ │ ├── OpenApiConstants.java │ │ │ ├── OpenApiDataFormat.java │ │ │ ├── OpenApiDataType.java │ │ │ ├── OpenApiResolvedType.java │ │ │ ├── OpenApiTypeResolver.java │ │ │ ├── ParameterLocation.java │ │ │ ├── ProduceConsumeUtils.java │ │ │ ├── UnwrappingEntry.java │ │ │ └── UnwrappingType.java │ │ │ └── yaml │ │ │ ├── YamlWriter.java │ │ │ └── model │ │ │ ├── Content.java │ │ │ ├── ContentType.java │ │ │ ├── Info.java │ │ │ ├── Items.java │ │ │ ├── Operation.java │ │ │ ├── ParameterElement.java │ │ │ ├── Property.java │ │ │ ├── RequestBody.java │ │ │ ├── Response.java │ │ │ ├── Schema.java │ │ │ ├── Server.java │ │ │ ├── Specification.java │ │ │ └── TagElement.java │ └── resources │ │ ├── java-class-assignability.yml │ │ ├── non-documentable-parameters.yml │ │ ├── openapi-model-associations.yml │ │ ├── openapi-model.yml │ │ └── unwrapping-configuration.yml │ └── test │ ├── java │ └── io │ │ └── github │ │ └── kbuntrock │ │ ├── AbstractTest.java │ │ ├── AllLibraryClassAnalyser.java │ │ ├── JavaSourceAnalysisTest.java │ │ ├── JavadocParserTest.java │ │ ├── JaxrsClassAnalyserTest.java │ │ ├── ModelSubstitutionTest.java │ │ ├── PackageSettings.java │ │ ├── ReflectionUtilsTest.java │ │ ├── SpringClassAnalyserTest.java │ │ ├── it │ │ └── BasicIT.java │ │ ├── json │ │ └── JsonMergingTest.java │ │ ├── model │ │ ├── EndpointTest.java │ │ └── TagTest.java │ │ ├── resources │ │ ├── Constants.java │ │ ├── annotation │ │ │ └── MyRestController.java │ │ ├── dto │ │ │ ├── AccountDto.java │ │ │ ├── AdminUserDto.java │ │ │ ├── ArrayDto.java │ │ │ ├── Authority.java │ │ │ ├── ChildAccountDto.java │ │ │ ├── EnumTest1Dto.java │ │ │ ├── GenericAggregationDto.java │ │ │ ├── InterfaceDto.java │ │ │ ├── KeyAndPasswordDto.java │ │ │ ├── ManagedUserDto.java │ │ │ ├── NumberDto.java │ │ │ ├── PageArrayDto.java │ │ │ ├── PageDto.java │ │ │ ├── ParentInterfaceDto.java │ │ │ ├── PasswordChangeDto.java │ │ │ ├── PersistentTokenDto.java │ │ │ ├── SliceDto.java │ │ │ ├── SpeAccountDto.java │ │ │ ├── TerritoryEnum.java │ │ │ ├── TimeDto.java │ │ │ ├── TimeDtoV2.java │ │ │ ├── TypedDto.java │ │ │ ├── UserGroupDto.java │ │ │ ├── WrapperDto.java │ │ │ ├── collision │ │ │ │ └── AccountDto.java │ │ │ ├── criteria │ │ │ │ ├── BaseSearchCriteria.java │ │ │ │ ├── CriteriaDateType.java │ │ │ │ ├── CriteriaWithDateType.java │ │ │ │ ├── MyDateType.java │ │ │ │ ├── SearchCriteria.java │ │ │ │ ├── SearchCriteriaChildV6.java │ │ │ │ ├── SearchCriteriaV2.java │ │ │ │ ├── SearchCriteriaV3.java │ │ │ │ ├── SearchCriteriaV4.java │ │ │ │ ├── SearchCriteriaV42.java │ │ │ │ ├── SearchCriteriaV5.java │ │ │ │ ├── SearchCriteriaV52.java │ │ │ │ └── SearchCriteriaV6.java │ │ │ ├── genericity │ │ │ │ ├── ActionDto.java │ │ │ │ ├── EntityDto.java │ │ │ │ ├── StatusImplDto.java │ │ │ │ ├── extendsList │ │ │ │ │ └── ExtendsListUUID.java │ │ │ │ ├── extendsMap │ │ │ │ │ ├── ChildExtendMapUUID.java │ │ │ │ │ ├── ExtendsMapLong.java │ │ │ │ │ ├── ExtendsMapUUID.java │ │ │ │ │ ├── GenericExtendsList.java │ │ │ │ │ └── GenericExtendsObjectMap.java │ │ │ │ ├── issue144 │ │ │ │ │ ├── BaseRequestDto.java │ │ │ │ │ ├── BaseRequestDtoInterface.java │ │ │ │ │ ├── BaseRequestItem.java │ │ │ │ │ ├── BaseRequestItemInterface.java │ │ │ │ │ ├── ChildRequestDto.java │ │ │ │ │ ├── ChildRequestDtoInterface.java │ │ │ │ │ ├── ChildRequestItem.java │ │ │ │ │ └── ChildRequestItemInterface.java │ │ │ │ ├── issue89 │ │ │ │ │ ├── Bar.java │ │ │ │ │ ├── Boo.java │ │ │ │ │ ├── Foo.java │ │ │ │ │ ├── IBar.java │ │ │ │ │ ├── IBoo.java │ │ │ │ │ ├── IFoo.java │ │ │ │ │ ├── IPair.java │ │ │ │ │ ├── ISingle.java │ │ │ │ │ ├── IX.java │ │ │ │ │ ├── Pair.java │ │ │ │ │ └── Single.java │ │ │ │ ├── issue95 │ │ │ │ │ ├── BaseValue.java │ │ │ │ │ ├── ErrorDto.java │ │ │ │ │ └── ErrorFoo.java │ │ │ │ └── mappingObject │ │ │ │ │ └── MapWithObject.java │ │ │ ├── ignore │ │ │ │ ├── JsonIgnoreDto.java │ │ │ │ └── SecondJsonIgnoreDto.java │ │ │ ├── jackson │ │ │ │ └── SimpleUserDto.java │ │ │ ├── multipartformdata │ │ │ │ └── MetadataDto.java │ │ │ ├── nullable │ │ │ │ ├── MyNotNull.java │ │ │ │ ├── MyNullable.java │ │ │ │ ├── NullableDto.java │ │ │ │ └── NullableGettersSettersDto.java │ │ │ ├── optional │ │ │ │ └── object │ │ │ │ │ ├── OptionalClassDto.java │ │ │ │ │ └── OptionalInterfaceDto.java │ │ │ └── recursive │ │ │ │ ├── GenericInterfaceRecursiveListDto.java │ │ │ │ ├── GenericRecursiveDto.java │ │ │ │ ├── GenericRecursiveInterfaceDto.java │ │ │ │ ├── GenericRecursiveListDto.java │ │ │ │ └── RecursiveDto.java │ │ ├── endpoint │ │ │ ├── account │ │ │ │ ├── AccountController.java │ │ │ │ ├── AccountJakartaController.java │ │ │ │ └── AccountJaxrsController.java │ │ │ ├── annotation │ │ │ │ └── AnnotatedController.java │ │ │ ├── collection │ │ │ │ └── CollectionController.java │ │ │ ├── collision │ │ │ │ ├── FirstEndpoint.java │ │ │ │ └── SecondEndpoint.java │ │ │ ├── enumeration │ │ │ │ ├── TestEnumeration1Controller.java │ │ │ │ ├── TestEnumeration2Controller.java │ │ │ │ ├── TestEnumeration3Controller.java │ │ │ │ ├── TestEnumeration4Controller.java │ │ │ │ ├── TestEnumeration5Controller.java │ │ │ │ ├── TestEnumeration6Controller.java │ │ │ │ └── TestEnumeration7Controller.java │ │ │ ├── error │ │ │ │ └── SameOperationController.java │ │ │ ├── file │ │ │ │ ├── FileUploadController.java │ │ │ │ └── StreamResponseController.java │ │ │ ├── generic │ │ │ │ ├── AbstractGenericData.java │ │ │ │ ├── ActionResource.java │ │ │ │ ├── EntityDtoResource.java │ │ │ │ ├── ExtendsGenericObjectMap.java │ │ │ │ ├── ExtendsList.java │ │ │ │ ├── ExtendsListV2.java │ │ │ │ ├── ExtendsMap.java │ │ │ │ ├── GenericDataController.java │ │ │ │ ├── GenericMapInBody.java │ │ │ │ ├── GenericMappingObject.java │ │ │ │ ├── GenericityTestEight.java │ │ │ │ ├── GenericityTestEleven.java │ │ │ │ ├── GenericityTestFive.java │ │ │ │ ├── GenericityTestFour.java │ │ │ │ ├── GenericityTestNine.java │ │ │ │ ├── GenericityTestOne.java │ │ │ │ ├── GenericityTestSeven.java │ │ │ │ ├── GenericityTestSix.java │ │ │ │ ├── GenericityTestTen.java │ │ │ │ ├── GenericityTestThree.java │ │ │ │ ├── GenericityTestTwelve.java │ │ │ │ ├── GenericityTestTwo.java │ │ │ │ ├── Issue144.java │ │ │ │ ├── Issue144ByInterface.java │ │ │ │ ├── Issue89.java │ │ │ │ ├── Issue95.java │ │ │ │ ├── MappingObject.java │ │ │ │ └── StatusResources.java │ │ │ ├── header │ │ │ │ └── MultipartFileWithHeaderController.java │ │ │ ├── ignore │ │ │ │ └── JsonIgnoreController.java │ │ │ ├── interfacedto │ │ │ │ └── InterfaceController.java │ │ │ ├── issues │ │ │ │ └── Issue138.java │ │ │ ├── jackson │ │ │ │ └── JacksonJsonPropertyController.java │ │ │ ├── javadoc │ │ │ │ └── inheritance │ │ │ │ │ ├── ChildClassOne.java │ │ │ │ │ ├── GrandParentAbstract.java │ │ │ │ │ ├── GrandParentInterface.java │ │ │ │ │ ├── ParentAbstract.java │ │ │ │ │ ├── ParentInterface.java │ │ │ │ │ ├── three │ │ │ │ │ ├── ChildClassThree.java │ │ │ │ │ └── IChildClassThree.java │ │ │ │ │ └── two │ │ │ │ │ ├── ChildClassTwo.java │ │ │ │ │ └── IChildClassTwo.java │ │ │ ├── javasource │ │ │ │ ├── ControllerOne.java │ │ │ │ ├── ControllerThree.java │ │ │ │ └── ControllerTwo.java │ │ │ ├── jaxrs │ │ │ │ ├── AbstractJaxrsController.java │ │ │ │ ├── ResponseJaxrsController.java │ │ │ │ └── ResponseType.java │ │ │ ├── map │ │ │ │ └── MapController.java │ │ │ ├── multipartformdata │ │ │ │ └── MultipartFormDataController.java │ │ │ ├── namecollision │ │ │ │ ├── one │ │ │ │ │ └── MyController.java │ │ │ │ ├── three │ │ │ │ │ └── MyController.java │ │ │ │ └── two │ │ │ │ │ └── MyController.java │ │ │ ├── nesting │ │ │ │ └── NestedDtosController.java │ │ │ ├── nullable │ │ │ │ ├── NullableController.java │ │ │ │ └── NullableGettersSettersController.java │ │ │ ├── number │ │ │ │ └── NumberController.java │ │ │ ├── operation │ │ │ │ ├── MultipleHeadersOnSameOperation.java │ │ │ │ ├── MultipleProducedContentTypes.java │ │ │ │ └── MultipleProducedContentTypesParameterIncoherence.java │ │ │ ├── optional │ │ │ │ └── object │ │ │ │ │ └── OptionalController.java │ │ │ ├── path │ │ │ │ ├── SpringPathEnhancementOneController.java │ │ │ │ └── SpringPathEnhancementTwoController.java │ │ │ ├── queryparam │ │ │ │ ├── EmptyValueParameterController.java │ │ │ │ ├── QueryParamDtoBindingController.java │ │ │ │ ├── QueryParamFlatMixNestedDtoBindingController.java │ │ │ │ └── QueryParamInMappingController.java │ │ │ ├── recursive │ │ │ │ ├── GenericRecursiveDtoController.java │ │ │ │ ├── GenericRecursiveInterfaceDtoController.java │ │ │ │ ├── GenericRecursiveInterfaceListDtoInParameterController.java │ │ │ │ ├── GenericRecursiveListDtoController.java │ │ │ │ ├── RecursiveDtoController.java │ │ │ │ └── RecursiveDtoInParameterController.java │ │ │ ├── spring │ │ │ │ ├── OptionalController.java │ │ │ │ ├── PackagePrivateResource.java │ │ │ │ └── ResponseEntityController.java │ │ │ ├── time │ │ │ │ └── TimeController.java │ │ │ └── uuid │ │ │ │ └── UuidController.java │ │ └── implementation │ │ │ └── account │ │ │ └── AccountControllerImpl.java │ │ └── utils │ │ ├── FileUtilsTest.java │ │ └── OperationIdHelperTest.java │ ├── resources-its │ └── io │ │ └── github │ │ └── kbuntrock │ │ └── it │ │ ├── BasicIT │ │ ├── nominal_test_case │ │ │ ├── openapi │ │ │ │ ├── default_errors.json │ │ │ │ ├── free_fields.json │ │ │ │ └── merged_free_fields.json │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── kbuntrock │ │ │ │ └── sample │ │ │ │ ├── Constants.java │ │ │ │ ├── annotation │ │ │ │ └── MyNotNull.java │ │ │ │ ├── dto │ │ │ │ ├── Authority.java │ │ │ │ └── UserDto.java │ │ │ │ ├── enpoint │ │ │ │ └── UserController.java │ │ │ │ └── implementation │ │ │ │ └── UserControllerImpl.java │ │ ├── nominal_test_case_jaxrs │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── kbuntrock │ │ │ │ └── sample │ │ │ │ ├── Constants.java │ │ │ │ ├── dto │ │ │ │ ├── Authority.java │ │ │ │ └── UserDto.java │ │ │ │ └── enpoint │ │ │ │ └── UserController.java │ │ └── sealed_class │ │ │ ├── pom.xml │ │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── kbuntrock │ │ │ └── sample │ │ │ ├── dto │ │ │ ├── CircleDto.java │ │ │ ├── RecordStatusDto.java │ │ │ └── ShapeDto.java │ │ │ └── enpoint │ │ │ └── ShapeController.java │ │ └── pom.xml │ └── resources │ ├── io │ └── github │ │ └── kbuntrock │ │ ├── AllLibraryClassAnalyser.genericity_on_endpoint.approved.txt │ │ ├── JavadocParserTest.default_error_responses.approved.txt │ │ ├── JavadocParserTest.inheritance_test_one.approved.txt │ │ ├── JavadocParserTest.inheritance_test_three.approved.txt │ │ ├── JavadocParserTest.inheritance_test_two.approved.txt │ │ ├── JavadocParserTest.inheritance_test_two_package_success.approved.txt │ │ ├── JavadocParserTest.inheritance_test_two_package_warning.approved.txt │ │ ├── JaxrsClassAnalyserTest.jakarta_basic.approved.txt │ │ ├── JaxrsClassAnalyserTest.jaxrs_basic.approved.txt │ │ ├── JaxrsClassAnalyserTest.optional_unmapping_jakarta.approved.txt │ │ ├── JaxrsClassAnalyserTest.optional_unmapping_jaxrs.approved.txt │ │ ├── JaxrsClassAnalyserTest.response_jaxrs_jakarta.approved.txt │ │ ├── JaxrsClassAnalyserTest.response_jaxrs_javax.approved.txt │ │ ├── ModelSubstitutionTest.enum_substitution.approved.txt │ │ ├── ModelSubstitutionTest.object_substitution.approved.txt │ │ ├── ModelSubstitutionTest.object_substitution_json_content.approved.txt │ │ ├── SpringClassAnalyserTest.annotated_controller.approved.txt │ │ ├── SpringClassAnalyserTest.black_list_class.approved.txt │ │ ├── SpringClassAnalyserTest.black_list_class_method.approved.txt │ │ ├── SpringClassAnalyserTest.black_list_method.approved.txt │ │ ├── SpringClassAnalyserTest.collection.approved.txt │ │ ├── SpringClassAnalyserTest.empty_value_query_parameter.approved.txt │ │ ├── SpringClassAnalyserTest.enpoint_path_collision.approved.txt │ │ ├── SpringClassAnalyserTest.enumeration_test_1.approved.txt │ │ ├── SpringClassAnalyserTest.enumeration_test_2.approved.txt │ │ ├── SpringClassAnalyserTest.enumeration_test_3.approved.txt │ │ ├── SpringClassAnalyserTest.enumeration_test_4.approved.txt │ │ ├── SpringClassAnalyserTest.enumeration_test_5.approved.txt │ │ ├── SpringClassAnalyserTest.enumeration_test_6.approved.txt │ │ ├── SpringClassAnalyserTest.enumeration_test_7.approved.txt │ │ ├── SpringClassAnalyserTest.error_same_operation.approved.txt │ │ ├── SpringClassAnalyserTest.extends_list.approved.txt │ │ ├── SpringClassAnalyserTest.extends_list2.approved.txt │ │ ├── SpringClassAnalyserTest.extends_map.approved.txt │ │ ├── SpringClassAnalyserTest.extra_classes.approved.txt │ │ ├── SpringClassAnalyserTest.file_upload.approved.txt │ │ ├── SpringClassAnalyserTest.generic_object_mapping.approved.txt │ │ ├── SpringClassAnalyserTest.generic_object_mapping2.approved.txt │ │ ├── SpringClassAnalyserTest.generic_parent_bound_by_child.approved.txt │ │ ├── SpringClassAnalyserTest.generic_parent_bound_by_child_extrends_interface.approved.txt │ │ ├── SpringClassAnalyserTest.generic_recursive_dto.approved.txt │ │ ├── SpringClassAnalyserTest.generic_recursive_interface_dto.approved.txt │ │ ├── SpringClassAnalyserTest.generic_recursive_interface_list_dto.approved.txt │ │ ├── SpringClassAnalyserTest.generic_recursive_list_dto.approved.txt │ │ ├── SpringClassAnalyserTest.generically_typed_controller.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_cross_reference.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_cross_reference_in_super_constructor.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_extends.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_extends_class_in_parameter.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_extends_class_in_parameter_v2.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_in_super_constructor.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_list_long.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_reference_self_class.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_typed_wrapped_dto.approved.txt │ │ ├── SpringClassAnalyserTest.genericity_wrapped_dto.approved.txt │ │ ├── SpringClassAnalyserTest.interface_dto.approved.txt │ │ ├── SpringClassAnalyserTest.issue_138.approved.txt │ │ ├── SpringClassAnalyserTest.issue_89.approved.txt │ │ ├── SpringClassAnalyserTest.issue_95.approved.txt │ │ ├── SpringClassAnalyserTest.jacksonJsonProperty.approved.txt │ │ ├── SpringClassAnalyserTest.json_ignore.approved.txt │ │ ├── SpringClassAnalyserTest.map_objects.approved.txt │ │ ├── SpringClassAnalyserTest.multipart_formdata.approved.txt │ │ ├── SpringClassAnalyserTest.multiple_content_type.approved.txt │ │ ├── SpringClassAnalyserTest.multiple_content_type_parameter_incoherence.approved.txt │ │ ├── SpringClassAnalyserTest.multiple_genericity.approved.txt │ │ ├── SpringClassAnalyserTest.multiple_headers_on_same_operation.approved.txt │ │ ├── SpringClassAnalyserTest.name_collision.approved.txt │ │ ├── SpringClassAnalyserTest.nested_dtos.approved.txt │ │ ├── SpringClassAnalyserTest.nested_genericity.approved.txt │ │ ├── SpringClassAnalyserTest.nullable_default.approved.txt │ │ ├── SpringClassAnalyserTest.nullable_default_custom_annotation.approved.txt │ │ ├── SpringClassAnalyserTest.nullable_default_non_nullable.approved.txt │ │ ├── SpringClassAnalyserTest.nullable_default_non_nullable_custom_annotation.approved.txt │ │ ├── SpringClassAnalyserTest.nullable_getters_setters.approved.txt │ │ ├── SpringClassAnalyserTest.nullable_getters_setters_default_non_nullable.approved.txt │ │ ├── SpringClassAnalyserTest.numbers.approved.txt │ │ ├── SpringClassAnalyserTest.object_mapping.approved.txt │ │ ├── SpringClassAnalyserTest.optional.approved.txt │ │ ├── SpringClassAnalyserTest.optional_unmapping.approved.txt │ │ ├── SpringClassAnalyserTest.package_private.approved.txt │ │ ├── SpringClassAnalyserTest.pathEnhancement.approved.txt │ │ ├── SpringClassAnalyserTest.query_param_dto_binding.approved.txt │ │ ├── SpringClassAnalyserTest.query_param_flat_mix_nested_dto_binding.approved.txt │ │ ├── SpringClassAnalyserTest.query_param_in_mapping.approved.txt │ │ ├── SpringClassAnalyserTest.recursive_dto.approved.txt │ │ ├── SpringClassAnalyserTest.recursive_dto_in_parameter.approved.txt │ │ ├── SpringClassAnalyserTest.request_headers.approved.txt │ │ ├── SpringClassAnalyserTest.response_entity.approved.txt │ │ ├── SpringClassAnalyserTest.stream_download.approved.txt │ │ ├── SpringClassAnalyserTest.tag_name_collision.approved.txt │ │ ├── SpringClassAnalyserTest.time_objects.approved.txt │ │ ├── SpringClassAnalyserTest.uuid.approved.txt │ │ ├── SpringClassAnalyserTest.white_list_class.approved.txt │ │ ├── SpringClassAnalyserTest.white_list_class_method.approved.txt │ │ ├── SpringClassAnalyserTest.white_list_method.approved.txt │ │ └── SpringClassAnalyserTest.white_list_method2.approved.txt │ ├── it │ └── BasicIT │ │ ├── nominal_test_case.yml │ │ ├── nominal_test_case_impl.yml │ │ ├── nominal_test_case_jaxrs.yml │ │ └── sealed_class.yml │ └── ut │ ├── AllLibraryClassAnalyser │ └── genericity_on_endpoint.yml │ ├── JavadocParserTest │ └── freeFields │ │ ├── default_error_responses.txt │ │ └── default_error_responses_free_fields.txt │ ├── ModelSubstitutionTest │ ├── enum_substitution │ │ ├── custom-model-association.yml │ │ └── custom-openapi-model.yml │ └── object_substitution │ │ ├── custom-model-association.yml │ │ └── custom-openapi-model.yml │ ├── SpringClassAnalyserTest │ └── springPathEnhancementTwo.yml │ └── json │ └── merging │ ├── base_file.json │ ├── non_existing_contact │ ├── merged.json │ └── to_merge.json │ ├── semi_existing_contact │ ├── base_file.json │ ├── merged.json │ └── to_merge.json │ ├── server_full │ ├── merged.json │ └── to_merge.json │ └── title │ ├── merged.json │ └── to_merge.json ├── update-version-manually.sh └── update-version.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # Automatically normalize line endings for all text-based files 2 | # http://git-scm.com/docs/gitattributes#_end_of_line_conversion 3 | * text=auto 4 | *.sh text eol=lf 5 | **/src/test/resources/it/** text eol=lf 6 | **/src/test/resources/ut/** text eol=lf 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Configure the github "dependabot" for : 2 | # - Disables npm security scan (the angular sample projet does not need security updates since it is not part of the product) 3 | # - Enables updates for the maven dependencies 4 | 5 | version: 2 6 | updates: 7 | - package-ecosystem: "maven" 8 | directory: "/openapi-maven-plugin" 9 | schedule: 10 | interval: "weekly" 11 | -------------------------------------------------------------------------------- /.github/workflows/publish-documentation.yml: -------------------------------------------------------------------------------- 1 | 2 | name: publish documentation 3 | 4 | on: 5 | push: 6 | tags: 7 | - '*' 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Regular checkout 17 | uses: actions/checkout@v4 18 | with: 19 | ref: doc 20 | 21 | - name: Merge and push 22 | run: | 23 | echo "Merge dev and push to doc" 24 | git config --global user.name 'github-actions' 25 | git config --global user.email 'github-actions[bot]@users.noreply.github.com' 26 | git merge dev -m "Auto-merge dev to doc" 27 | git push -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | release/ 3 | openapi-maven-plugin/target/ 4 | pom.xml.tag 5 | pom.xml.releaseBackup 6 | pom.xml.versionsBackup 7 | pom.xml.next 8 | release.properties 9 | dependency-reduced-pom.xml 10 | buildNumber.properties 11 | .mvn/timing.properties 12 | # https://github.com/takari/maven-wrapper#usage-without-binary-jar 13 | .mvn/wrapper/maven-wrapper.jar 14 | openapi-maven-plugin/src/test/resources/**/*.received.txt 15 | 16 | # WSL / Windows artefacts 17 | **/*:Zone.Identifier 18 | 19 | # IDEs and editors 20 | **/.idea/* 21 | !**/.idea/runConfigurations/ 22 | !**/.idea/codeStyleSettings.xml 23 | !**/.idea/saveactions_settings.xml 24 | !**/.idea/codeStyles 25 | .idea/* 26 | **/openapi-maven-plugin.iml 27 | !.idea/runConfigurations/ 28 | !.idea/codeStyles 29 | !.idea/saveactions_settings.xml 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Kévin Buntrock 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbuntrock/openapi-maven-plugin/a2e6282cdc9248f3ef3f05c00f7170af5e7cab60/docs/.nojekyll -------------------------------------------------------------------------------- /docs/_navbar.md: -------------------------------------------------------------------------------- 1 | - Translations 2 | - [:uk: English](/) 3 | - [:fr: Français](/fr/) -------------------------------------------------------------------------------- /docs/_sidebar.md: -------------------------------------------------------------------------------- 1 | * [Presentation](/) 2 | * [Quick start](quick-start.md) 3 | * [Configuration](configuration.md) 4 | * [Thank you section](thank-you-section.md) -------------------------------------------------------------------------------- /docs/fr/_sidebar.md: -------------------------------------------------------------------------------- 1 | * [Présentation](fr/) 2 | * [Comment démarrer](fr/quick-start.md) 3 | * [Configuration](fr/configuration.md) 4 | * [Remerciements](fr/thank-you-section.md) 5 | -------------------------------------------------------------------------------- /docs/fr/thank-you-section.md: -------------------------------------------------------------------------------- 1 | # Remerciement 2 | 3 | Ce plugin ne pourrait pas évoluer sans les projets qui l'utilisent. Merci à eux! 4 | 5 | Un remerciement également particulier à certains projets open-source sur lesquels ce plugin s'appuie : 6 | 7 | - Karl Heinz Marbaise et son super "maven-it-extension-plugin". Un des projets les mieux documenté que j'ai pu renconter : https://github.com/khmarbaise/maven-it-extension 8 | - L'équipe derrière "java parser", qui a rendu l'extraction de la javadoc si facile : https://github.com/javaparser/javaparser 9 | - Ronmamo et sa librairie "Reflections" qui aide déjà de si nombreux projets : https://github.com/ronmamo/reflections -------------------------------------------------------------------------------- /docs/thank-you-section.md: -------------------------------------------------------------------------------- 1 | # Work in progress -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/.predefined-repo/readme.txt: -------------------------------------------------------------------------------- 1 | copy repository here -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk11/src/main/java/io/github/kbuntrock/sample/Constants.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample; 2 | 3 | public class Constants { 4 | 5 | public static final String BASE_PATH = "/api"; 6 | 7 | // Regex for acceptable logins 8 | public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$"; 9 | 10 | public static final int PASSWORD_MIN_LENGTH = 4; 11 | 12 | public static final int PASSWORD_MAX_LENGTH = 100; 13 | 14 | private Constants() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk11/src/main/java/io/github/kbuntrock/sample/dto/Authority.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.dto; 2 | 3 | public enum Authority { 4 | ACCESS_APP, 5 | READ_USER, 6 | UPDATE_USER 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk11/src/main/java/io/github/kbuntrock/sample/enpoint/UserController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.enpoint; 2 | 3 | import io.github.kbuntrock.sample.Constants; 4 | import io.github.kbuntrock.sample.dto.UserDto; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import java.util.List; 8 | 9 | @RequestMapping(path = Constants.BASE_PATH + "/user") 10 | public interface UserController { 11 | 12 | @PutMapping("/update") 13 | UserDto updateUser(@RequestBody UserDto userDto); 14 | 15 | @GetMapping("/user-dtos") 16 | List getUserDtos(); 17 | } 18 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk17/src/main/java/io/github/kbuntrock/sample/Constants.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample; 2 | 3 | public class Constants { 4 | 5 | public static final String BASE_PATH = "/api"; 6 | 7 | // Regex for acceptable logins 8 | public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$"; 9 | 10 | public static final int PASSWORD_MIN_LENGTH = 4; 11 | 12 | public static final int PASSWORD_MAX_LENGTH = 100; 13 | 14 | private Constants() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk17/src/main/java/io/github/kbuntrock/sample/dto/Authority.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.dto; 2 | 3 | public enum Authority { 4 | ACCESS_APP, 5 | READ_USER, 6 | UPDATE_USER 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk17/src/main/java/io/github/kbuntrock/sample/enpoint/UserController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.enpoint; 2 | 3 | import io.github.kbuntrock.sample.Constants; 4 | import io.github.kbuntrock.sample.dto.UserDto; 5 | import io.github.kbuntrock.sample.dto.RecordDto; 6 | import org.springframework.web.bind.annotation.*; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * User related apis 12 | */ 13 | @RequestMapping(path = Constants.BASE_PATH + "/user") 14 | public interface UserController { 15 | 16 | @PutMapping("/update") 17 | UserDto updateUser(@RequestBody UserDto userDto); 18 | 19 | @GetMapping("/user-dtos") 20 | List getUserDtos(); 21 | 22 | /** 23 | * List all the records 24 | * 25 | * @return all the available records 26 | */ 27 | @GetMapping("/records") 28 | List getRecords(); 29 | } 30 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk21/src/main/java/io/github/kbuntrock/sample/Constants.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample; 2 | 3 | public class Constants { 4 | 5 | public static final String BASE_PATH = "/api"; 6 | 7 | // Regex for acceptable logins 8 | public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$"; 9 | 10 | public static final int PASSWORD_MIN_LENGTH = 4; 11 | 12 | public static final int PASSWORD_MAX_LENGTH = 100; 13 | 14 | private Constants() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk21/src/main/java/io/github/kbuntrock/sample/dto/Authority.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.dto; 2 | 3 | public enum Authority { 4 | ACCESS_APP, 5 | READ_USER, 6 | UPDATE_USER 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk21/src/main/java/io/github/kbuntrock/sample/enpoint/UserController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.enpoint; 2 | 3 | import io.github.kbuntrock.sample.Constants; 4 | import io.github.kbuntrock.sample.dto.UserDto; 5 | import io.github.kbuntrock.sample.dto.RecordDto; 6 | import org.springframework.web.bind.annotation.*; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * User related apis 12 | */ 13 | @RequestMapping(path = Constants.BASE_PATH + "/user") 14 | public interface UserController { 15 | 16 | @PutMapping("/update") 17 | UserDto updateUser(@RequestBody UserDto userDto); 18 | 19 | @GetMapping("/user-dtos") 20 | List getUserDtos(); 21 | 22 | /** 23 | * List all the records 24 | * 25 | * @return all the available records 26 | */ 27 | @GetMapping("/records") 28 | List getRecords(); 29 | } 30 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk8/src/main/java/io/github/kbuntrock/sample/Constants.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample; 2 | 3 | public class Constants { 4 | 5 | public static final String BASE_PATH = "/api"; 6 | 7 | // Regex for acceptable logins 8 | public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$"; 9 | 10 | public static final int PASSWORD_MIN_LENGTH = 4; 11 | 12 | public static final int PASSWORD_MAX_LENGTH = 100; 13 | 14 | private Constants() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk8/src/main/java/io/github/kbuntrock/sample/dto/Authority.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.dto; 2 | 3 | public enum Authority { 4 | ACCESS_APP, 5 | READ_USER, 6 | UPDATE_USER 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jdk8/src/main/java/io/github/kbuntrock/sample/enpoint/UserController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.enpoint; 2 | 3 | import io.github.kbuntrock.sample.Constants; 4 | import io.github.kbuntrock.sample.dto.UserDto; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import java.util.List; 8 | 9 | @RequestMapping(path = Constants.BASE_PATH + "/user") 10 | public interface UserController { 11 | 12 | @PutMapping("/update") 13 | UserDto updateUser(@RequestBody UserDto userDto); 14 | 15 | @GetMapping("/user-dtos") 16 | List getUserDtos(); 17 | } 18 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources-its/io/github/kbuntrock/it/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 4.0.0 7 | 8 | io.github.kbuntrock.openapi.it 9 | parent-it-module 10 | 0.0 11 | pom 12 | 13 | 14 | BasicIT/nominal_test_case_jdk8 15 | BasicIT/nominal_test_case_jdk11 16 | BasicIT/nominal_test_case_jdk17 17 | BasicIT/nominal_test_case_jdk21 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /openapi-maven-plugin/.idea/saveactions_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/MojoRuntimeException.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock; 2 | 3 | /** 4 | * @author Kevin Buntrock 5 | */ 6 | public class MojoRuntimeException extends RuntimeException { 7 | 8 | public MojoRuntimeException(String message) { 9 | super(message); 10 | } 11 | 12 | public MojoRuntimeException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/TagLibraryHolder.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public enum TagLibraryHolder { 7 | INSTANCE; 8 | 9 | private TagLibrary tagLibrary; 10 | 11 | public TagLibrary getTagLibrary() { 12 | return tagLibrary; 13 | } 14 | 15 | public void setTagLibrary(final TagLibrary tagLibrary) { 16 | this.tagLibrary = tagLibrary; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/configuration/EnumConfig.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.configuration; 2 | 3 | import org.apache.maven.plugins.annotations.Parameter; 4 | 5 | /** 6 | * @author Kévin Buntrock 7 | */ 8 | public class EnumConfig { 9 | 10 | @Parameter 11 | private String canonicalName; 12 | @Parameter 13 | private String valueField; 14 | 15 | public EnumConfig() { 16 | } 17 | 18 | public EnumConfig(final EnumConfig enumConfig) { 19 | this.canonicalName = enumConfig.canonicalName; 20 | this.valueField = enumConfig.valueField; 21 | } 22 | 23 | public String getCanonicalName() { 24 | return canonicalName; 25 | } 26 | 27 | public void setCanonicalName(final String canonicalName) { 28 | this.canonicalName = canonicalName; 29 | } 30 | 31 | public String getValueField() { 32 | return valueField; 33 | } 34 | 35 | public void setValueField(final String valueField) { 36 | this.valueField = valueField; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/configuration/EnumConfigHolder.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.configuration; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * @author Kévin Buntrock 9 | */ 10 | public final class EnumConfigHolder { 11 | 12 | private static final Map map = new HashMap<>(); 13 | 14 | public static void storeConfig(final List enumConfigList) { 15 | for(final EnumConfig config : enumConfigList) { 16 | map.put(config.getCanonicalName(), config.getValueField()); 17 | } 18 | } 19 | 20 | public static String getValueFieldForEnum(final String canonicalName) { 21 | return map.get(canonicalName); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/configuration/Substitution.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.configuration; 2 | 3 | import org.apache.maven.plugins.annotations.Parameter; 4 | 5 | public class Substitution { 6 | 7 | @Parameter 8 | private String type; 9 | @Parameter(required = true) 10 | private String regex; 11 | @Parameter 12 | private String substitute = ""; 13 | 14 | public Substitution() { 15 | } 16 | 17 | public Substitution(final Substitution substitution) { 18 | this.type = substitution.type; 19 | this.regex = substitution.regex; 20 | this.substitute = substitution.substitute; 21 | } 22 | 23 | public String getType() { 24 | return type; 25 | } 26 | 27 | public void setType(final String type) { 28 | this.type = type; 29 | } 30 | 31 | public String getRegex() { 32 | return regex; 33 | } 34 | 35 | public void setRegex(final String regex) { 36 | this.regex = regex; 37 | } 38 | 39 | public String getSubstitute() { 40 | return substitute; 41 | } 42 | 43 | public void setSubstitute(final String substitute) { 44 | this.substitute = substitute; 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/configuration/Tag.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.configuration; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import org.apache.maven.plugins.annotations.Parameter; 6 | 7 | public class Tag { 8 | 9 | @Parameter 10 | private List substitutions = new ArrayList<>(); 11 | 12 | public Tag() { 13 | } 14 | 15 | public Tag(final Tag tag) { 16 | for(final Substitution substitution : tag.getSubstitutions()) { 17 | substitutions.add(new Substitution(substitution)); 18 | } 19 | } 20 | 21 | public List getSubstitutions() { 22 | return substitutions; 23 | } 24 | 25 | public void setSubstitutions(final List substitutions) { 26 | this.substitutions = substitutions; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/configuration/library/TagAnnotation.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.configuration.library; 2 | 3 | /** 4 | * @author Kevin Buntrock 5 | */ 6 | public enum TagAnnotation { 7 | SPRING_MVC_REQUEST_MAPPING("org.springframework.web.bind.annotation.RequestMapping"), 8 | SPRING_REST_CONTROLLER("org.springframework.web.bind.annotation.RestController"), 9 | JAVAX_RS_PATH("javax.ws.rs.Path"), 10 | JAKARTA_RS_PATH("jakarta.ws.rs.Path"); 11 | 12 | private final String annotatedElement; 13 | 14 | TagAnnotation(final String annotatedElement) { 15 | this.annotatedElement = annotatedElement; 16 | } 17 | 18 | public String getAnnotationClassName() { 19 | return annotatedElement; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/javadoc/JavadocMap.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.javadoc; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * @author Kevin Buntrock 8 | */ 9 | public enum JavadocMap { 10 | INSTANCE; 11 | 12 | private Map javadocMap = new HashMap<>(); 13 | 14 | public Map getJavadocMap() { 15 | return javadocMap; 16 | } 17 | 18 | public void setJavadocMap(Map javadocMap) { 19 | this.javadocMap = javadocMap; 20 | } 21 | 22 | public boolean isPresent() { 23 | return this.javadocMap != null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/model/annotation/OperationAnnotationInfo.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.model.annotation; 2 | 3 | /** 4 | * Store everything extracted from io.swagger.v3.oas.annotations.Operation or similar annotation 5 | */ 6 | public class OperationAnnotationInfo { 7 | 8 | private String operationId; 9 | 10 | private String summary; 11 | 12 | private String description; 13 | 14 | public String getOperationId() { 15 | return operationId; 16 | } 17 | 18 | public void setOperationId(String operationId) { 19 | this.operationId = operationId; 20 | } 21 | 22 | public String getSummary() { 23 | return summary; 24 | } 25 | 26 | public void setSummary(String summary) { 27 | this.summary = summary; 28 | } 29 | 30 | public String getDescription() { 31 | return description; 32 | } 33 | 34 | public void setDescription(String description) { 35 | this.description = description; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/reflection/AdditionnalSchemaLibrary.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.reflection; 2 | 3 | import io.github.kbuntrock.model.DataObject; 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | 7 | /** 8 | * MUST be reset between each api scan. 9 | *

10 | * Used to stored dataObject which we initially didn't want to save in the schema section, but we are forced to do it 11 | * in order to handle recursivity (typically generic recursive objects) 12 | * 13 | * @author Kevin Buntrock 14 | */ 15 | public final class AdditionnalSchemaLibrary { 16 | 17 | private static final Map map = new LinkedHashMap<>(); 18 | 19 | public static void reset() { 20 | map.clear(); 21 | } 22 | 23 | public static void addDataObject(final String signature, final DataObject dataObject) { 24 | map.put(signature, dataObject); 25 | } 26 | 27 | public static Map getMap() { 28 | return map; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/reflection/GenericArrayTypeImpl.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.reflection; 2 | 3 | import java.lang.reflect.GenericArrayType; 4 | import java.lang.reflect.Type; 5 | 6 | /** 7 | * @author Kevin Buntrock 8 | */ 9 | public class GenericArrayTypeImpl implements GenericArrayType { 10 | 11 | private final Type genericComponentType; 12 | 13 | public GenericArrayTypeImpl(final Type genericComponentType) { 14 | this.genericComponentType = genericComponentType; 15 | } 16 | 17 | @Override 18 | public Type getGenericComponentType() { 19 | return genericComponentType; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | import java.io.File; 4 | import java.nio.file.FileSystems; 5 | 6 | /** 7 | * File utils 8 | * 9 | * @author Kevin Buntrock 10 | */ 11 | public final class FileUtils { 12 | 13 | /** 14 | * Private Constructor 15 | */ 16 | private FileUtils() { 17 | } 18 | 19 | /** 20 | * Concat a base path and a relative path 21 | * 22 | * @param basePath 23 | * @param relativePath 24 | * @return 25 | */ 26 | public static File toFile(final String basePath, final String relativePath) { 27 | StringBuilder sb = new StringBuilder(basePath); 28 | if(!basePath.isEmpty() && !relativePath.isEmpty() 29 | && (!basePath.endsWith("/") || !basePath.endsWith("\\")) 30 | && (!relativePath.startsWith("/") || !relativePath.startsWith("\\"))) { 31 | sb.append("/"); 32 | } 33 | sb.append(relativePath); 34 | return new File(FileSystems.getDefault().getPath(sb.toString()).normalize().toAbsolutePath().toString()); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/JavadocUtils.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | import com.github.javaparser.javadoc.Javadoc; 4 | import com.github.javaparser.javadoc.JavadocBlockTag; 5 | 6 | /** 7 | * @author Kevin Buntrock 8 | */ 9 | public final class JavadocUtils { 10 | 11 | private JavadocUtils() { 12 | } 13 | 14 | public JavadocBlockTag getFieldJavaBlocTagForName(Javadoc javadoc, String name) { 15 | for(JavadocBlockTag javadocBlockTag : javadoc.getBlockTags()) { 16 | if(JavadocBlockTag.Type.PARAM == javadocBlockTag.getType() && name.equals(javadocBlockTag.getName())) { 17 | return javadocBlockTag; 18 | } 19 | } 20 | return null; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/Logger.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | import org.apache.maven.plugin.logging.Log; 4 | 5 | public enum Logger { 6 | INSTANCE; 7 | 8 | private Log logger; 9 | 10 | public Log getLogger() { 11 | return logger; 12 | } 13 | 14 | public void setLogger(Log logger) { 15 | this.logger = logger; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/ObjectsUtils.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | /** 4 | * 5 | */ 6 | public class ObjectsUtils { 7 | 8 | /** 9 | * Returns the first argument if it is non-{@code null} and 10 | * otherwise returns the second argument. 11 | * 12 | * Derived from the Objects.requireNonNullElse defined only from jdk9 version 13 | */ 14 | public static T nonNullElse(T obj, T defaultObj) { 15 | return (obj != null) ? obj : defaultObj; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/OpenApiConstants.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | public class OpenApiConstants { 4 | 5 | public static final String OBJECT_REFERENCE_PREFIX = "#/components/schemas/"; 6 | public static final String OBJECT_REFERENCE_DECLARATION = "$ref"; 7 | public static final String TYPE = "type"; 8 | 9 | /** 10 | * Elements in the "components" section, except the "schemas" (ordered by the specification : https://swagger.io/docs/specification/components/) 11 | */ 12 | public static final String[] COMPONENTS_STRUCTURE = {"parameters", "securitySchemes", "requestBodies", "responses", "headers", 13 | "examples", "links", "callbacks"}; 14 | 15 | /** 16 | * Schemas sub-section in "components" section 17 | */ 18 | public static final String SCHEMAS = "schemas"; 19 | } 20 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/OpenApiDataFormat.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | public enum OpenApiDataFormat { 4 | NONE(null), 5 | FLOAT("float"), 6 | DOUBLE("double"), 7 | INT32("int32"), 8 | INT64("int64"), 9 | DATE("date"), 10 | DATE_TIME("date-time"), 11 | TIME("time"), 12 | BYTE("byte"), 13 | BINARY("binary"), 14 | EMAIL("email"), 15 | UUID("uuid"), 16 | UNKNOWN("unknow_format"); 17 | 18 | private final String value; 19 | 20 | OpenApiDataFormat(final String value) { 21 | this.value = value; 22 | } 23 | 24 | public String getValue() { 25 | return value; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/OpenApiDataType.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import java.util.HashMap; 5 | import java.util.Locale; 6 | import java.util.Map; 7 | 8 | public enum OpenApiDataType { 9 | 10 | STRING, 11 | BOOLEAN, 12 | INTEGER, 13 | NUMBER, 14 | ARRAY, 15 | OBJECT, 16 | ANY; 17 | 18 | private static final Map map = new HashMap<>(); 19 | 20 | static { 21 | for(final OpenApiDataType type : OpenApiDataType.values()) { 22 | map.put(type.toString().toLowerCase(Locale.ENGLISH), type); 23 | } 24 | } 25 | 26 | public static OpenApiDataType fromJsonNode(final JsonNode jsonNode) { 27 | final JsonNode typeNode = jsonNode.get("type"); 28 | return map.getOrDefault(typeNode.asText(), OBJECT); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/ParameterLocation.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | public enum ParameterLocation { 4 | PATH, 5 | QUERY, 6 | BODY, 7 | HEADER, 8 | BODY_PART 9 | } 10 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/ProduceConsumeUtils.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | import io.github.kbuntrock.model.DataObject; 4 | import org.springframework.http.MediaType; 5 | 6 | public class ProduceConsumeUtils { 7 | 8 | private ProduceConsumeUtils() { 9 | } 10 | 11 | public static String getDefaultValue(final DataObject dataObject) { 12 | if(dataObject.getJavaClass().isEnum()) { 13 | // java enums are considered as a string in openapi type 14 | return MediaType.APPLICATION_JSON_VALUE; 15 | } else if(OpenApiDataType.STRING == dataObject.getOpenApiResolvedType().getType()) { 16 | return MediaType.TEXT_PLAIN_VALUE; 17 | } else { 18 | return MediaType.APPLICATION_JSON_VALUE; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/UnwrappingEntry.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | /** 4 | * Represent an "unwrapping" entry (ex: java.util.Optional is unwrapped to its property "T value") 5 | * 6 | * @author Kévin Buntrock 7 | */ 8 | public class UnwrappingEntry { 9 | 10 | /** 11 | * Class to unwrap 12 | */ 13 | private final Class clazz; 14 | 15 | /** 16 | * Name of the generic type to unwrap (ex: T in java.util.Optional) 17 | */ 18 | private String typeName; 19 | 20 | /** 21 | * Can be null if not relevant for the entry 22 | */ 23 | private Boolean required; 24 | 25 | public UnwrappingEntry(final Class clazz) { 26 | this.clazz = clazz; 27 | } 28 | 29 | public String getTypeName() { 30 | return typeName; 31 | } 32 | 33 | public void setTypeName(final String typeName) { 34 | this.typeName = typeName; 35 | } 36 | 37 | public Boolean getRequired() { 38 | return required; 39 | } 40 | 41 | public void setRequired(final Boolean required) { 42 | this.required = required; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/utils/UnwrappingType.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public enum UnwrappingType { 7 | RESPONSE, 8 | PARAMETER, 9 | SCHEMA 10 | } 11 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/yaml/model/ContentType.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.yaml.model; 2 | 3 | /** 4 | * 5 | */ 6 | public class ContentType { 7 | 8 | private String contentType; 9 | 10 | public ContentType() { 11 | 12 | } 13 | 14 | public ContentType(String contentType) { 15 | this.contentType = contentType; 16 | } 17 | 18 | public String getContentType() { 19 | return contentType; 20 | } 21 | 22 | public void setContentType(String contentType) { 23 | this.contentType = contentType; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/yaml/model/Items.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.yaml.model; 2 | 3 | import io.github.kbuntrock.utils.OpenApiConstants; 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | 7 | public class Items { 8 | 9 | private Map items = new LinkedHashMap<>(); 10 | 11 | public Items(String type) { 12 | this.items.put(OpenApiConstants.TYPE, type); 13 | } 14 | 15 | public Map getItems() { 16 | return items; 17 | } 18 | 19 | public void setItems(Map items) { 20 | this.items = items; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/yaml/model/RequestBody.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.yaml.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | 7 | public class RequestBody { 8 | 9 | @JsonInclude(JsonInclude.Include.NON_EMPTY) 10 | private final Map content = new LinkedHashMap<>(); 11 | 12 | @JsonInclude(JsonInclude.Include.NON_NULL) 13 | private String description; 14 | 15 | public Map getContent() { 16 | return content; 17 | } 18 | 19 | public String getDescription() { 20 | return description; 21 | } 22 | 23 | public void setDescription(String description) { 24 | this.description = description; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/yaml/model/Server.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.yaml.model; 2 | 3 | public class Server { 4 | 5 | private String url; 6 | 7 | public String getUrl() { 8 | return url; 9 | } 10 | 11 | public void setUrl(String url) { 12 | this.url = url; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/java/io/github/kbuntrock/yaml/model/TagElement.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.yaml.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | 5 | public class TagElement { 6 | 7 | private String name; 8 | 9 | @JsonInclude(JsonInclude.Include.NON_NULL) 10 | private String description; 11 | 12 | public TagElement() { 13 | 14 | } 15 | 16 | public TagElement(String name, String description) { 17 | this.name = name; 18 | this.description = description; 19 | } 20 | 21 | public String getName() { 22 | return name; 23 | } 24 | 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | 29 | public String getDescription() { 30 | return description; 31 | } 32 | 33 | public void setDescription(String description) { 34 | this.description = description; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/resources/java-class-assignability.yml: -------------------------------------------------------------------------------- 1 | --- 2 | equality: 3 | java.lang.Boolean: boolean 4 | java.lang.Integer: integer-32 5 | java.lang.Short: integer-32 6 | java.lang.Long: integer-64 7 | java.math.BigInteger: integer-64 8 | java.lang.Float: number-float 9 | java.lang.Double: number-double 10 | java.math.BigDecimal: number-double 11 | java.lang.String: string 12 | java.lang.Character: string 13 | java.time.LocalDateTime: string-date-time 14 | java.time.ZonedDateTime: string-date-time 15 | java.time.Instant: string-date-time 16 | java.time.LocalDate: string-date 17 | java.time.LocalTime: string-time 18 | java.util.UUID: string-uuid 19 | "byte[]": string-binary 20 | java.lang.Object: any 21 | assignability: 22 | java.io.InputStream: string-binary 23 | org.springframework.core.io.InputStreamSource: string-binary 24 | java.util.Date: string-date-time 25 | java.util.Collection: array 26 | 27 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/resources/non-documentable-parameters.yml: -------------------------------------------------------------------------------- 1 | common: 2 | - javax.servlet.ServletRequest 3 | - jakarta.servlet.ServletRequest 4 | - javax.servlet.ServletResponse 5 | - jakarta.servlet.ServletResponse 6 | - javax.servlet.http.HttpSession 7 | - jakarta.servlet.http.HttpSession 8 | - javax.servlet.http.PushBuilder 9 | - jakarta.servlet.http.PushBuilder 10 | spring: 11 | - org.springframework.http.HttpMethod 12 | - org.springframework.ui.Model 13 | - org.springframework.ui.ModelMap 14 | - org.springframework.http.HttpHeaders 15 | - java.util.Locale 16 | - java.util.TimeZone 17 | - java.time.ZoneId 18 | - java.security.Principal 19 | - org.springframework.validation.Errors 20 | - org.springframework.validation.BindingResult 21 | - org.springframework.web.bind.support.SessionStatus 22 | - org.springframework.web.util.UriComponentsBuilder 23 | spring-annotations: 24 | - org.springframework.web.bind.annotation.RequestAttribute 25 | - org.springframework.web.bind.annotation.SessionAttribute 26 | - org.springframework.web.bind.annotation.ModelAttribute -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/resources/openapi-model-associations.yml: -------------------------------------------------------------------------------- 1 | --- 2 | boolean: 3 | default-encoding: text/plain 4 | integer-32: 5 | default-encoding: text/plain 6 | integer-64: 7 | default-encoding: text/plain 8 | number-float: 9 | default-encoding: text/plain 10 | number-double: 11 | default-encoding: text/plain 12 | string: 13 | default-encoding: text/plain 14 | string-date: 15 | default-encoding: text/plain 16 | string-date-time: 17 | default-encoding: text/plain 18 | string-time: 19 | default-encoding: text/plain 20 | string-binary: 21 | default-encoding: application/octet-stream 22 | string-uuid: 23 | default-encoding: text/plain 24 | enum: 25 | default-encoding: text/plain 26 | array: 27 | default-encoding: application/json 28 | object: 29 | default-encoding: application/json 30 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/resources/openapi-model.yml: -------------------------------------------------------------------------------- 1 | --- 2 | boolean: 3 | type: boolean 4 | integer-32: 5 | type: integer 6 | format: int32 7 | integer-64: 8 | type: integer 9 | format: int64 10 | number-float: 11 | type: number 12 | format: float 13 | number-double: 14 | type: number 15 | format: double 16 | string: 17 | type: string 18 | string-date: 19 | type: string 20 | format: date 21 | string-date-time: 22 | type: string 23 | format: date-time 24 | string-time: 25 | type: string 26 | format: time 27 | string-binary: 28 | type: string 29 | format: binary 30 | string-uuid: 31 | type: string 32 | format: uuid 33 | enum: 34 | type: string 35 | array: 36 | type: array 37 | object: 38 | type: object 39 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/main/resources/unwrapping-configuration.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # The configuration is divided in 3 sections to allow better performances 3 | # Describe unwrapping in api responses 4 | response: 5 | java.util.Optional: 6 | typeName: T 7 | required: false 8 | org.springframework.http.HttpEntity: 9 | typeName: T 10 | # Describe unwrapping in api parameters 11 | parameter: 12 | java.util.Optional: 13 | typeName: T 14 | required: false 15 | # Describe unwrapping in components schema section 16 | schema: 17 | java.util.Optional: 18 | typeName: T 19 | required: false -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/PackageSettings.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock; 2 | 3 | import org.approvaltests.core.ApprovalFailureReporter; 4 | import org.approvaltests.reporters.AutoApproveWhenEmptyReporter; 5 | import org.approvaltests.reporters.DiffReporter; 6 | import org.approvaltests.reporters.FirstWorkingReporter; 7 | 8 | /** 9 | * ApprovalTests.Java configuration. 10 | * */ 11 | public class PackageSettings { 12 | 13 | private static final String ApprovalBaseDirectory = "../resources"; 14 | private static final ApprovalFailureReporter UseReporter = new FirstWorkingReporter( 15 | new AutoApproveWhenEmptyReporter(), 16 | new DiffReporter() 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/Constants.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources; 2 | 3 | public final class Constants { 4 | 5 | public static final String BASE_API = "/api"; 6 | 7 | // Regex for acceptable logins 8 | public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$"; 9 | 10 | public static final int PASSWORD_MIN_LENGTH = 4; 11 | 12 | public static final int PASSWORD_MAX_LENGTH = 100; 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/annotation/MyRestController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | /** 10 | * @author Kévin Buntrock 11 | */ 12 | @Target({ElementType.TYPE}) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @RestController 15 | public @interface MyRestController { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/ArrayDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | public class ArrayDto { 4 | 5 | private T[] content; 6 | 7 | private boolean hasNext; 8 | 9 | public T[] getContent() { 10 | return content; 11 | } 12 | 13 | public void setContent(final T[] content) { 14 | this.content = content; 15 | } 16 | 17 | public boolean getHasNext() { 18 | return hasNext; 19 | } 20 | 21 | public void setHasNext(final boolean hasNext) { 22 | this.hasNext = hasNext; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/Authority.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | /** 4 | * Permissions for a user 5 | */ 6 | public enum Authority { 7 | /** 8 | * Reading 9 | */ 10 | READ_USER, 11 | /** 12 | * Writing 13 | */ 14 | WRITE_USER, 15 | /** 16 | * Access to the application (the most basic permission) 17 | */ 18 | ACCES_APP; 19 | 20 | @Override 21 | public String toString() { 22 | return "Permission : " + name(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/ChildAccountDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | public class ChildAccountDto extends AccountDto { 4 | 5 | private Long childId; 6 | 7 | public Long getChildId() { 8 | return childId; 9 | } 10 | 11 | public void setChildId(Long childId) { 12 | this.childId = childId; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/EnumTest1Dto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | import java.util.List; 4 | 5 | public class EnumTest1Dto { 6 | 7 | private List authorityList; 8 | 9 | public List getAuthorityList() { 10 | return authorityList; 11 | } 12 | 13 | public void setAuthorityList(List authorityList) { 14 | this.authorityList = authorityList; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/GenericAggregationDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | /** 4 | * @author Kevin Buntrock 5 | */ 6 | public class GenericAggregationDto { 7 | 8 | private PageDto page; 9 | private SliceDto slice; 10 | private ArrayDto array; 11 | 12 | public PageDto getPage() { 13 | return page; 14 | } 15 | 16 | public void setPage(PageDto page) { 17 | this.page = page; 18 | } 19 | 20 | public SliceDto getSlice() { 21 | return slice; 22 | } 23 | 24 | public void setSlice(SliceDto slice) { 25 | this.slice = slice; 26 | } 27 | 28 | public ArrayDto getArray() { 29 | return array; 30 | } 31 | 32 | public void setArray(ArrayDto array) { 33 | this.array = array; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/KeyAndPasswordDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | /** 4 | * View Model object for storing the user's key and password. 5 | */ 6 | public class KeyAndPasswordDto { 7 | 8 | private String key; 9 | 10 | private String newPassword; 11 | 12 | public String getKey() { 13 | return key; 14 | } 15 | 16 | public void setKey(String key) { 17 | this.key = key; 18 | } 19 | 20 | public String getNewPassword() { 21 | return newPassword; 22 | } 23 | 24 | public void setNewPassword(String newPassword) { 25 | this.newPassword = newPassword; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/ManagedUserDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import javax.validation.constraints.Size; 5 | 6 | /** 7 | * View Model extending the AdminUserDTO, which is meant to be used in the user management UI. 8 | */ 9 | public class ManagedUserDto extends AdminUserDto { 10 | 11 | @Size(min = Constants.PASSWORD_MIN_LENGTH, max = Constants.PASSWORD_MAX_LENGTH) 12 | private String password; 13 | 14 | public ManagedUserDto() { 15 | // Empty constructor needed for Jackson. 16 | } 17 | 18 | public String getPassword() { 19 | return password; 20 | } 21 | 22 | public void setPassword(String password) { 23 | this.password = password; 24 | } 25 | 26 | // prettier-ignore 27 | @Override 28 | public String toString() { 29 | return "ManagedUserVM{" + super.toString() + "} "; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/PageArrayDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | public class PageArrayDto extends ArrayDto { 4 | 5 | private int totalPages; 6 | 7 | private long totalElements; 8 | 9 | public int getTotalPages() { 10 | return totalPages; 11 | } 12 | 13 | public void setTotalPages(final int totalPages) { 14 | this.totalPages = totalPages; 15 | } 16 | 17 | public long getTotalElements() { 18 | return totalElements; 19 | } 20 | 21 | public void setTotalElements(final long totalElements) { 22 | this.totalElements = totalElements; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/PageDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class PageDto extends SliceDto { 6 | 7 | /** 8 | * Total of available pages 9 | */ 10 | private int totalPages; 11 | 12 | /** 13 | * Total elements (addition of all the pages) 14 | */ 15 | private long totalElements; 16 | 17 | public static PageDto emptyPage() { 18 | final PageDto page = new PageDto<>(); 19 | page.setContent(new ArrayList<>()); 20 | page.setTotalPages(0); 21 | page.setTotalElements(0); 22 | page.setHasNext(false); 23 | return page; 24 | } 25 | 26 | public int getTotalPages() { 27 | return totalPages; 28 | } 29 | 30 | public void setTotalPages(final int totalPages) { 31 | this.totalPages = totalPages; 32 | } 33 | 34 | public long getTotalElements() { 35 | return totalElements; 36 | } 37 | 38 | public void setTotalElements(final long totalElements) { 39 | this.totalElements = totalElements; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/ParentInterfaceDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | /** 4 | * This is a parent interface 5 | * 6 | * @author Kevin Buntrock 7 | */ 8 | public interface ParentInterfaceDto { 9 | 10 | /** 11 | * Get the parent id 12 | * 13 | * @return the parent id 14 | */ 15 | int getParentId(); 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/PasswordChangeDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | /** 4 | * A DTO representing a password change required data - current and new password. 5 | */ 6 | public class PasswordChangeDto { 7 | 8 | private String currentPassword; 9 | 10 | private String newPassword; 11 | 12 | public PasswordChangeDto() { 13 | // Empty constructor needed for Jackson. 14 | } 15 | 16 | public PasswordChangeDto(String currentPassword, String newPassword) { 17 | this.currentPassword = currentPassword; 18 | this.newPassword = newPassword; 19 | } 20 | 21 | public String getCurrentPassword() { 22 | return currentPassword; 23 | } 24 | 25 | public void setCurrentPassword(String currentPassword) { 26 | this.currentPassword = currentPassword; 27 | } 28 | 29 | public String getNewPassword() { 30 | return newPassword; 31 | } 32 | 33 | public void setNewPassword(String newPassword) { 34 | this.newPassword = newPassword; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/PersistentTokenDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | import java.time.LocalDate; 4 | import javax.validation.constraints.NotNull; 5 | 6 | /** 7 | * A remember-me token, always attached to the requesting user 8 | */ 9 | public class PersistentTokenDto { 10 | 11 | @NotNull 12 | private String series; 13 | 14 | @NotNull 15 | private LocalDate tokenDate; 16 | 17 | private String ipAddress; 18 | 19 | private String userAgent; 20 | 21 | public String getSeries() { 22 | return series; 23 | } 24 | 25 | public void setSeries(String series) { 26 | this.series = series; 27 | } 28 | 29 | public LocalDate getTokenDate() { 30 | return tokenDate; 31 | } 32 | 33 | public void setTokenDate(LocalDate tokenDate) { 34 | this.tokenDate = tokenDate; 35 | } 36 | 37 | public String getIpAddress() { 38 | return ipAddress; 39 | } 40 | 41 | public void setIpAddress(String ipAddress) { 42 | this.ipAddress = ipAddress; 43 | } 44 | 45 | public String getUserAgent() { 46 | return userAgent; 47 | } 48 | 49 | public void setUserAgent(String userAgent) { 50 | this.userAgent = userAgent; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/SliceDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class SliceDto { 7 | 8 | /** 9 | * The content of this slice 10 | */ 11 | private List content; 12 | 13 | /** 14 | * True if a next slice exist 15 | */ 16 | private boolean hasNext; 17 | 18 | public static SliceDto emptySlice() { 19 | final SliceDto slice = new SliceDto<>(); 20 | slice.setContent(new ArrayList<>()); 21 | slice.setHasNext(false); 22 | return slice; 23 | } 24 | 25 | public List getContent() { 26 | return content; 27 | } 28 | 29 | public void setContent(final List content) { 30 | this.content = content; 31 | } 32 | 33 | public boolean getHasNext() { 34 | return hasNext; 35 | } 36 | 37 | public void setHasNext(final boolean hasNext) { 38 | this.hasNext = hasNext; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/SpeAccountDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Kevin Buntrock 7 | */ 8 | public class SpeAccountDto extends AccountDto { 9 | 10 | private PageDto>[] page; 11 | 12 | public PageDto>[] getPage() { 13 | return page; 14 | } 15 | 16 | public void setPage(PageDto>[] page) { 17 | this.page = page; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/TerritoryEnum.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | public enum TerritoryEnum { 4 | FRANCE(1), 5 | GERMANY(2); 6 | 7 | private final int code; 8 | 9 | TerritoryEnum(final int code) { 10 | this.code = code; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/TimeDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | import java.time.Instant; 4 | import java.time.LocalDate; 5 | import java.time.LocalDateTime; 6 | 7 | /** 8 | * An wrapping object for time values 9 | */ 10 | public class TimeDto { 11 | 12 | /** 13 | * The instant field 14 | */ 15 | Instant instant; 16 | /** 17 | * The date field 18 | */ 19 | LocalDate date; 20 | /** 21 | * The date time field 22 | */ 23 | LocalDateTime dateTime; 24 | 25 | public Instant getInstant() { 26 | return instant; 27 | } 28 | 29 | public void setInstant(final Instant instant) { 30 | this.instant = instant; 31 | } 32 | 33 | public LocalDate getDate() { 34 | return date; 35 | } 36 | 37 | public void setDate(final LocalDate date) { 38 | this.date = date; 39 | } 40 | 41 | public LocalDateTime getDateTime() { 42 | return dateTime; 43 | } 44 | 45 | public void setDateTime(final LocalDateTime dateTime) { 46 | this.dateTime = dateTime; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/TimeDtoV2.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | import java.time.Instant; 4 | import java.time.LocalDate; 5 | import java.time.LocalDateTime; 6 | import java.time.LocalTime; 7 | 8 | public class TimeDtoV2 { 9 | 10 | Instant instant; 11 | LocalDate date; 12 | LocalDateTime dateTime; 13 | LocalTime time; 14 | 15 | public Instant getInstant() { 16 | return instant; 17 | } 18 | 19 | public void setInstant(final Instant instant) { 20 | this.instant = instant; 21 | } 22 | 23 | public LocalDate getDate() { 24 | return date; 25 | } 26 | 27 | public void setDate(final LocalDate date) { 28 | this.date = date; 29 | } 30 | 31 | public LocalDateTime getDateTime() { 32 | return dateTime; 33 | } 34 | 35 | public void setDateTime(final LocalDateTime dateTime) { 36 | this.dateTime = dateTime; 37 | } 38 | 39 | public LocalTime getTime() { 40 | return time; 41 | } 42 | 43 | public void setTime(final LocalTime time) { 44 | this.time = time; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/TypedDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | /** 4 | * @author Kevin Buntrock 5 | */ 6 | public class TypedDto { 7 | 8 | private WrapperDto wrapped; 9 | private AccountDto account; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/WrapperDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto; 2 | 3 | /** 4 | * @author Kevin Buntrock 5 | */ 6 | public class WrapperDto { 7 | 8 | private T wrapped; 9 | 10 | public T getWrapped() { 11 | return wrapped; 12 | } 13 | 14 | public void setWrapped(T wrapped) { 15 | this.wrapped = wrapped; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/collision/AccountDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.collision; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * A very concise account representation 7 | * 8 | * @author Kévin Buntrock 9 | */ 10 | public class AccountDto { 11 | 12 | /** 13 | * Nickname the user wants to be called by 14 | */ 15 | private String pseudo; 16 | 17 | /** 18 | * List of authorities 19 | */ 20 | private List authorityList; 21 | 22 | public enum Authority { 23 | ACCES_APP 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/BaseSearchCriteria.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class BaseSearchCriteria> extends SearchCriteria { 7 | 8 | protected final SELF self; 9 | 10 | protected BaseSearchCriteria(final Class selfClass) { 11 | self = selfClass.cast(this); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/CriteriaDateType.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public interface CriteriaDateType { 7 | 8 | int getTimestamp(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/CriteriaWithDateType.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class CriteriaWithDateType { 7 | 8 | private final Class dateCriteria; 9 | 10 | public CriteriaWithDateType(final Class dateTypeClass) { 11 | this.dateCriteria = dateTypeClass; 12 | } 13 | 14 | public Class getDateCriteria() { 15 | return dateCriteria; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/MyDateType.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class MyDateType implements CriteriaDateType { 7 | 8 | @Override 9 | public int getTimestamp() { 10 | return 0; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/SearchCriteria.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class SearchCriteria extends CriteriaWithDateType { 7 | 8 | private String myString; 9 | 10 | public SearchCriteria() { 11 | super(MyDateType.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/SearchCriteriaChildV6.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class SearchCriteriaChildV6 extends SearchCriteriaV6 { 7 | 8 | private boolean anotherThing; 9 | } 10 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/SearchCriteriaV2.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class SearchCriteriaV2 extends CriteriaWithDateType { 7 | 8 | private String myString; 9 | 10 | 11 | public SearchCriteriaV2(final Class dateTypeClass) { 12 | super(dateTypeClass); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/SearchCriteriaV3.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class SearchCriteriaV3 extends BaseSearchCriteria { 7 | 8 | private boolean someBoolean; 9 | 10 | protected SearchCriteriaV3(final Class searchCriteriaV3Class) { 11 | super(searchCriteriaV3Class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/SearchCriteriaV4.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class SearchCriteriaV4 extends BaseSearchCriteria { 7 | 8 | private String toto; 9 | 10 | protected SearchCriteriaV4(final Class searchCriteriaV5Class) { 11 | super(searchCriteriaV5Class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/SearchCriteriaV42.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class SearchCriteriaV42 extends BaseSearchCriteria { 7 | 8 | private String toto; 9 | 10 | protected SearchCriteriaV42() { 11 | super(SearchCriteriaV52.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/SearchCriteriaV5.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class SearchCriteriaV5 extends BaseSearchCriteria { 7 | 8 | private boolean tata; 9 | 10 | protected SearchCriteriaV5(final Class searchCriteriaV4Class) { 11 | super(searchCriteriaV4Class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/SearchCriteriaV52.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class SearchCriteriaV52 extends BaseSearchCriteria { 7 | 8 | private boolean tata; 9 | 10 | protected SearchCriteriaV52() { 11 | super(SearchCriteriaV42.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/criteria/SearchCriteriaV6.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.criteria; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class SearchCriteriaV6 extends BaseSearchCriteria { 7 | 8 | private boolean someBoolean; 9 | 10 | protected SearchCriteriaV6() { 11 | super(SearchCriteriaV6.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/ActionDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity; 2 | 3 | import javax.validation.constraints.Size; 4 | 5 | /** 6 | * @author Kévin Buntrock 7 | */ 8 | public class ActionDto extends EntityDto { 9 | 10 | @Size(max = 15, message = "text too long") 11 | private String title; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/EntityDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import java.io.Serializable; 5 | import java.util.Date; 6 | import javax.validation.constraints.Pattern; 7 | import javax.validation.constraints.Size; 8 | 9 | /** 10 | * @author Kévin Buntrock 11 | */ 12 | @JsonInclude(JsonInclude.Include.NON_NULL) 13 | public abstract class EntityDto implements Serializable, Cloneable { 14 | 15 | private static final long serialVersionUID = -1L; 16 | 17 | public static final String CREATION_DATE = "creationDate"; 18 | 19 | private Date creationDate; 20 | private Date changeDate; 21 | @Pattern(regexp = "toto-regex", message = "not matching toto regex") 22 | @Size(min = 14, max = 15) 23 | private String uuid; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/StatusImplDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity; 2 | 3 | /** 4 | * @author Kévin Buntrock 5 | */ 6 | public class StatusImplDto { 7 | 8 | private String statusText; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/extendsList/ExtendsListUUID.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.extendsList; 2 | 3 | import java.util.ArrayList; 4 | import java.util.UUID; 5 | 6 | /** 7 | * A list of uuids 8 | */ 9 | public class ExtendsListUUID extends ArrayList { 10 | 11 | /** 12 | * Since this class is a list, this attribute is ignored 13 | */ 14 | private String someUnusedString; 15 | 16 | public String getSomeUnusedString() { 17 | return someUnusedString; 18 | } 19 | 20 | public void setSomeUnusedString(String someUnusedString) { 21 | this.someUnusedString = someUnusedString; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/extendsMap/ChildExtendMapUUID.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.extendsMap; 2 | 3 | /** 4 | * Child map between an integer and an UUID 5 | */ 6 | public class ChildExtendMapUUID extends ExtendsMapUUID { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/extendsMap/ExtendsMapLong.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.extendsMap; 2 | 3 | import java.util.HashMap; 4 | import java.util.UUID; 5 | 6 | /** 7 | * A map between String and Long 8 | */ 9 | public class ExtendsMapLong extends HashMap { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/extendsMap/ExtendsMapUUID.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.extendsMap; 2 | 3 | import java.util.HashMap; 4 | import java.util.UUID; 5 | 6 | /** 7 | * A map between Integer and UUID 8 | */ 9 | public class ExtendsMapUUID extends HashMap { 10 | 11 | /** 12 | * Since this class is a list, this attribute is ignored 13 | */ 14 | private String someUnusedString; 15 | 16 | public String getSomeUnusedString() { 17 | return someUnusedString; 18 | } 19 | 20 | public void setSomeUnusedString(String someUnusedString) { 21 | this.someUnusedString = someUnusedString; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/extendsMap/GenericExtendsList.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.extendsMap; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.UUID; 7 | 8 | /** 9 | * 10 | */ 11 | public class GenericExtendsList extends ArrayList { 12 | 13 | public GenericExtendsList doSomething(List rows) { 14 | return this; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/extendsMap/GenericExtendsObjectMap.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.extendsMap; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | 6 | 7 | public class GenericExtendsObjectMap extends HashMap { 8 | 9 | public GenericExtendsObjectMap rows(List rows) { 10 | this.put("rows", rows); 11 | return this; 12 | } 13 | 14 | public GenericExtendsObjectMap lines(List lines) { 15 | this.put("lines", lines); 16 | return this; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue144/BaseRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue144; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * The base request dto 8 | * @param T must extends BaseRequestItem 9 | */ 10 | public class BaseRequestDto< T extends BaseRequestItem> { 11 | 12 | /** 13 | * The price request items 14 | */ 15 | private List priceRequestItems = new ArrayList<>(); 16 | 17 | public List getPriceRequestItems() { 18 | return priceRequestItems; 19 | } 20 | 21 | public void setPriceRequestItems(List priceRequestItems) { 22 | this.priceRequestItems = priceRequestItems; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue144/BaseRequestDtoInterface.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue144; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * The base request dto interface 7 | * @param T must extends BaseRequestItemInterface 8 | */ 9 | public interface BaseRequestDtoInterface { 10 | 11 | /** 12 | * The price request items 13 | */ 14 | List getPriceRequestItems(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue144/BaseRequestItem.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue144; 2 | 3 | /** 4 | * The base request item 5 | */ 6 | public class BaseRequestItem { 7 | 8 | /** 9 | * The base field 10 | */ 11 | private String baseField; 12 | 13 | public String getBaseField() { 14 | return baseField; 15 | } 16 | 17 | public void setBaseField(String baseField) { 18 | this.baseField = baseField; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue144/BaseRequestItemInterface.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue144; 2 | 3 | /** 4 | * The base request item interface 5 | */ 6 | public interface BaseRequestItemInterface { 7 | 8 | /** 9 | * The base field 10 | */ 11 | String getBaseField(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue144/ChildRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue144; 2 | 3 | /** 4 | * The child request dto 5 | */ 6 | public class ChildRequestDto extends BaseRequestDto { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue144/ChildRequestDtoInterface.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue144; 2 | 3 | /** 4 | * The child request dto by interface 5 | */ 6 | public interface ChildRequestDtoInterface extends BaseRequestDtoInterface { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue144/ChildRequestItem.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue144; 2 | 3 | /** 4 | * The child request item 5 | */ 6 | public class ChildRequestItem extends BaseRequestItem { 7 | 8 | /** 9 | * The child field 10 | */ 11 | private String childField; 12 | 13 | public String getChildField() { 14 | return childField; 15 | } 16 | 17 | public void setChildField(String childField) { 18 | this.childField = childField; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue144/ChildRequestItemInterface.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue144; 2 | 3 | /** 4 | * The child request item interface 5 | */ 6 | public interface ChildRequestItemInterface extends BaseRequestItemInterface { 7 | 8 | /** 9 | * The child field 10 | */ 11 | String getChildField(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/Bar.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * This is the Bar object 5 | */ 6 | public class Bar extends Boo { 7 | 8 | /** 9 | * the bar string 10 | */ 11 | private String bar; 12 | } 13 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/Boo.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * This is the Boo object 5 | */ 6 | public class Boo extends Foo { 7 | 8 | /** 9 | * the boo boolean 10 | */ 11 | private boolean boo; 12 | } 13 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/Foo.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * This is the Foo object 5 | */ 6 | public class Foo extends Pair { 7 | 8 | /** 9 | * the foo integer 10 | */ 11 | private Integer foo; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/IBar.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * This is the IBar object 5 | */ 6 | public interface IBar extends IBoo, IX { 7 | 8 | /** 9 | * The bar string 10 | * 11 | * @return the bar string 12 | */ 13 | String getBar(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/IBoo.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * This is the IBoo object 5 | */ 6 | public interface IBoo extends IFoo { 7 | 8 | /** 9 | * The boo boolean 10 | * 11 | * @return the boo boolean 12 | */ 13 | boolean getBoo(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/IFoo.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * The IFoo object 5 | */ 6 | public interface IFoo { 7 | 8 | /** 9 | * The foo integer 10 | * 11 | * @return the foo integer 12 | */ 13 | Integer getFoo(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/IPair.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * The IPair object 5 | */ 6 | public interface IPair extends ISingle { 7 | 8 | /** 9 | * Get the B attribute 10 | * 11 | * @return the B attribute 12 | */ 13 | B getB(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/ISingle.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * The ISingle object 5 | */ 6 | public interface ISingle { 7 | 8 | /** 9 | * get the A attribute 10 | * 11 | * @return the A attribute 12 | */ 13 | A getA(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/IX.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * The IX object 5 | */ 6 | public interface IX extends IPair { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/Pair.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * This is the Pair object 5 | */ 6 | public class Pair extends Single { 7 | 8 | /** 9 | * the b attribute 10 | */ 11 | private B b; 12 | } 13 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue89/Single.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue89; 2 | 3 | /** 4 | * This is the Single object 5 | */ 6 | public class Single { 7 | 8 | /** 9 | * the a attribute 10 | */ 11 | private A a; 12 | } 13 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue95/BaseValue.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue95; 2 | 3 | import java.util.Optional; 4 | 5 | /** 6 | * This is the BaseValue declaration 7 | * 8 | * @param a first generic type 9 | * @param another generic type 10 | */ 11 | public interface BaseValue { 12 | 13 | /** 14 | * Get the value! 15 | * 16 | * @return the returned value 17 | */ 18 | VAL getValue(); 19 | 20 | /** 21 | * Get the unit! 22 | * 23 | * @return the optional returned unit 24 | */ 25 | Optional getUnit(); 26 | } 27 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue95/ErrorDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue95; 2 | 3 | /** 4 | * This is the ErrorDto declaration 5 | */ 6 | public interface ErrorDto { 7 | 8 | /** 9 | * Get the foo 10 | * 11 | * @return a string type ErrorFoo 12 | */ 13 | ErrorFoo getFoo(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/issue95/ErrorFoo.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.issue95; 2 | 3 | import java.math.BigDecimal; 4 | 5 | /** 6 | * This is the ErrorFoo declaration 7 | * 8 | * @param a generic type 9 | */ 10 | public interface ErrorFoo extends BaseValue { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/genericity/mappingObject/MapWithObject.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.genericity.mappingObject; 2 | 3 | import java.util.HashMap; 4 | 5 | /** 6 | * A map between string and objects 7 | */ 8 | public class MapWithObject extends HashMap { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/ignore/JsonIgnoreDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.ignore; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import io.github.kbuntrock.resources.dto.KeyAndPasswordDto; 5 | import io.github.kbuntrock.resources.dto.TerritoryEnum; 6 | 7 | public class JsonIgnoreDto { 8 | 9 | @JsonIgnore 10 | private TerritoryEnum territory; 11 | 12 | private KeyAndPasswordDto keyAndPassword; 13 | 14 | private SecondJsonIgnoreDto secondJsonIgnore; 15 | 16 | public TerritoryEnum getTerritory() { 17 | return territory; 18 | } 19 | 20 | public void setTerritory(final TerritoryEnum territory) { 21 | this.territory = territory; 22 | } 23 | 24 | public KeyAndPasswordDto getKeyAndPassword() { 25 | return keyAndPassword; 26 | } 27 | 28 | public void setKeyAndPassword(final KeyAndPasswordDto keyAndPassword) { 29 | this.keyAndPassword = keyAndPassword; 30 | } 31 | 32 | public SecondJsonIgnoreDto getSecondJsonIgnore() { 33 | return secondJsonIgnore; 34 | } 35 | 36 | public void setSecondJsonIgnore(final SecondJsonIgnoreDto secondJsonIgnore) { 37 | this.secondJsonIgnore = secondJsonIgnore; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/ignore/SecondJsonIgnoreDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.ignore; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import io.github.kbuntrock.resources.dto.Authority; 5 | import io.github.kbuntrock.resources.dto.NumberDto; 6 | import io.github.kbuntrock.resources.dto.PageDto; 7 | import io.github.kbuntrock.resources.dto.TimeDto; 8 | 9 | public class SecondJsonIgnoreDto { 10 | 11 | TimeDto timeDto; 12 | 13 | PageDto page; 14 | 15 | @JsonIgnore 16 | NumberDto number; 17 | 18 | public TimeDto getTimeDto() { 19 | return timeDto; 20 | } 21 | 22 | public void setTimeDto(final TimeDto timeDto) { 23 | this.timeDto = timeDto; 24 | } 25 | 26 | public PageDto getPage() { 27 | return page; 28 | } 29 | 30 | public void setPage(final PageDto page) { 31 | this.page = page; 32 | } 33 | 34 | public NumberDto getNumber() { 35 | return number; 36 | } 37 | 38 | public void setNumber(final NumberDto number) { 39 | this.number = number; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/jackson/SimpleUserDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.jackson; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * A simple user 7 | */ 8 | public class SimpleUserDto { 9 | 10 | /** 11 | * User firstname 12 | */ 13 | private String username; 14 | 15 | /** 16 | * Whether the user is active or not 17 | */ 18 | @JsonProperty("isActive") 19 | private boolean active; 20 | 21 | /** 22 | * Whether the user is an admin or not 23 | */ 24 | @JsonProperty 25 | private boolean admin; 26 | } 27 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/multipartformdata/MetadataDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.multipartformdata; 2 | 3 | /** 4 | * 5 | */ 6 | public class MetadataDto { 7 | 8 | private String owner; 9 | private String description; 10 | 11 | public String getOwner() { 12 | return owner; 13 | } 14 | 15 | public void setOwner(String owner) { 16 | this.owner = owner; 17 | } 18 | 19 | public String getDescription() { 20 | return description; 21 | } 22 | 23 | public void setDescription(String description) { 24 | this.description = description; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/nullable/MyNotNull.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.nullable; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Target(ElementType.FIELD) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Documented 12 | public @interface MyNotNull { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/nullable/MyNullable.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.nullable; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | 10 | @Target(ElementType.FIELD) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Documented 13 | public @interface MyNullable { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/nullable/NullableDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.nullable; 2 | 3 | import javax.annotation.Nullable; 4 | import javax.validation.constraints.NotNull; 5 | 6 | public class NullableDto { 7 | 8 | private String defaultValue; 9 | 10 | @NotNull 11 | private String notNullableValue; 12 | 13 | @Nullable 14 | private String nullableValue; 15 | 16 | @MyNotNull 17 | private String myNotNull; 18 | 19 | @MyNullable 20 | private String myNullable; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/optional/object/OptionalClassDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.optional.object; 2 | 3 | import java.util.Optional; 4 | 5 | /** 6 | * @author Kévin Buntrock 7 | */ 8 | public class OptionalClassDto { 9 | 10 | private Optional myValue; 11 | } 12 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/optional/object/OptionalInterfaceDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.optional.object; 2 | 3 | import java.util.Optional; 4 | 5 | /** 6 | * @author Kévin Buntrock 7 | */ 8 | public interface OptionalInterfaceDto { 9 | 10 | Optional> getMyValue(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/recursive/GenericInterfaceRecursiveListDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.recursive; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Kevin Buntrock 7 | */ 8 | public interface GenericInterfaceRecursiveListDto { 9 | 10 | String getName(); 11 | 12 | E getWrapped(); 13 | 14 | List> getChildList(); 15 | } 16 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/recursive/GenericRecursiveDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.recursive; 2 | 3 | /** 4 | * A recursive and generic object 5 | * 6 | * @author Kevin Buntrock 7 | */ 8 | public class GenericRecursiveDto { 9 | 10 | /** 11 | * A non recursive property 12 | */ 13 | private String name; 14 | 15 | /** 16 | * The generic wrapped object 17 | */ 18 | private G wrapped; 19 | 20 | /** 21 | * The recursive property 22 | */ 23 | private GenericRecursiveDto child; 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/recursive/GenericRecursiveInterfaceDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.recursive; 2 | 3 | /** 4 | * @author Kevin Buntrock 5 | */ 6 | public interface GenericRecursiveInterfaceDto { 7 | 8 | String getName(); 9 | 10 | GenericRecursiveInterfaceDto getChild(); 11 | } 12 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/recursive/GenericRecursiveListDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.recursive; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Kevin Buntrock 7 | */ 8 | public class GenericRecursiveListDto { 9 | 10 | private String name; 11 | private G wrapped; 12 | private List> childList; 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/dto/recursive/RecursiveDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.dto.recursive; 2 | 3 | /** 4 | * @author Kevin Buntrock 5 | */ 6 | public class RecursiveDto { 7 | 8 | private String name; 9 | private RecursiveDto child; 10 | } 11 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/account/AccountJaxrsController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.account; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import java.util.List; 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.validation.constraints.NotNull; 8 | import javax.ws.rs.DELETE; 9 | import javax.ws.rs.GET; 10 | import javax.ws.rs.POST; 11 | import javax.ws.rs.PUT; 12 | import javax.ws.rs.Path; 13 | import javax.ws.rs.PathParam; 14 | import javax.ws.rs.QueryParam; 15 | 16 | /** 17 | * User account management 18 | */ 19 | @Path(Constants.BASE_API + "/account") 20 | public interface AccountJaxrsController { 21 | 22 | @PUT 23 | @Path("/update") 24 | AccountDto updateAccount(AccountDto userDto); 25 | 26 | @GET 27 | @Path("/user-dtos/{id}") 28 | List getAccountDtos(@PathParam("id") long id); 29 | 30 | @POST 31 | @Path("/user-dtos") 32 | List getAccountDtosByQueryParam(@NotNull @QueryParam("name") String name, HttpServletRequest request); 33 | 34 | @DELETE 35 | @Path("/delete/{id}") 36 | void deleteAccount(@PathParam("id") long id); 37 | } 38 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/annotation/AnnotatedController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.annotation; 2 | 3 | import io.github.kbuntrock.resources.annotation.MyRestController; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | /** 7 | * @author Kevin Buntrock 8 | */ 9 | @MyRestController 10 | public interface AnnotatedController { 11 | 12 | @GetMapping("counter") 13 | int getCounter(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/collection/CollectionController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.collection; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import java.util.Collection; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kévin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/collection") 13 | public interface CollectionController { 14 | 15 | @GetMapping() 16 | Collection getStringCollection(@RequestBody Collection someIds); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/collision/FirstEndpoint.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.collision; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import java.util.Collection; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | /** 12 | * @author Kévin Buntrock 13 | */ 14 | @RequestMapping(Constants.BASE_API + "/first-ws") 15 | public interface FirstEndpoint { 16 | 17 | @GetMapping() 18 | Collection getCompleteAccounts(); 19 | 20 | @PostMapping("/authority") 21 | Collection findByAuthority(@RequestBody Authority authority); 22 | 23 | public class Authority { 24 | 25 | private String name; 26 | 27 | private int level; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/collision/SecondEndpoint.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.collision; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.collision.AccountDto; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * @author Kévin Buntrock 10 | */ 11 | @RequestMapping(Constants.BASE_API + "/second-ws") 12 | public interface SecondEndpoint { 13 | 14 | @GetMapping("/light") 15 | AccountDto[] getPartialAccounts(); 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/enumeration/TestEnumeration1Controller.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.enumeration; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.EnumTest1Dto; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | @RequestMapping(Constants.BASE_API + "/test-enum-1") 9 | public interface TestEnumeration1Controller { 10 | 11 | @GetMapping() 12 | @Deprecated 13 | EnumTest1Dto getAuthorities(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/enumeration/TestEnumeration2Controller.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.enumeration; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.Authority; 5 | import java.util.List; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | @RequestMapping(Constants.BASE_API + "/test-enum-2") 10 | public interface TestEnumeration2Controller { 11 | 12 | @GetMapping() 13 | List getAuthorities(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/enumeration/TestEnumeration3Controller.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.enumeration; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.Authority; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | @RequestMapping(Constants.BASE_API + "/test-enum-3") 9 | public interface TestEnumeration3Controller { 10 | 11 | @GetMapping() 12 | Authority getAuthority(); 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/enumeration/TestEnumeration4Controller.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.enumeration; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.EnumTest1Dto; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | @RequestMapping(Constants.BASE_API + "/test-enum-1") 10 | public interface TestEnumeration4Controller { 11 | 12 | @PostMapping() 13 | String getAuthorities(@RequestBody EnumTest1Dto enumTest1Dto); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/enumeration/TestEnumeration5Controller.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.enumeration; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.Authority; 5 | import java.util.List; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | @RequestMapping(Constants.BASE_API + "/test-enum-2") 11 | public interface TestEnumeration5Controller { 12 | 13 | @PostMapping() 14 | String getAuthorities(@RequestBody List authorityList); 15 | } 16 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/enumeration/TestEnumeration6Controller.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.enumeration; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.Authority; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | @RequestMapping(Constants.BASE_API + "/test-enum-2") 10 | public interface TestEnumeration6Controller { 11 | 12 | @GetMapping("/{authority}") 13 | String getAuthorities(@PathVariable Authority authority); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/enumeration/TestEnumeration7Controller.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.enumeration; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.TerritoryEnum; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | @RequestMapping(Constants.BASE_API + "/test-enum-7") 9 | public interface TestEnumeration7Controller { 10 | 11 | @GetMapping("/territories") 12 | TerritoryEnum getTerritories(); 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/error/SameOperationController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.error; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.Authority; 5 | import io.github.kbuntrock.resources.dto.TimeDto; 6 | import java.util.List; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | @RequestMapping(Constants.BASE_API + "/same-operation") 11 | public interface SameOperationController { 12 | 13 | @GetMapping() 14 | List getAuthorities(); 15 | 16 | @GetMapping() 17 | TimeDto getTime(); 18 | 19 | @GetMapping("/v2") 20 | List getAuthorityList(); 21 | 22 | @GetMapping("/v2") 23 | List getTimes(); 24 | 25 | @GetMapping("/v2") 26 | String getString(); 27 | } 28 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/file/StreamResponseController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.file; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import org.springframework.core.io.Resource; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/stream") 13 | public interface StreamResponseController { 14 | 15 | @GetMapping(value = "/stream", produces = "application/octet-stream") 16 | ResponseEntity getStream(); 17 | 18 | @GetMapping(value = "/byte-array", produces = "application/octet-stream") 19 | ResponseEntity getByteArray(); 20 | } 21 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/AbstractGenericData.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import java.util.List; 4 | 5 | public abstract class AbstractGenericData { 6 | 7 | public abstract List getDataList(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/ActionResource.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | 4 | import io.github.kbuntrock.resources.dto.genericity.ActionDto; 5 | import io.github.kbuntrock.resources.dto.genericity.StatusImplDto; 6 | import java.util.List; 7 | import javax.ws.rs.GET; 8 | import javax.ws.rs.Path; 9 | import javax.ws.rs.PathParam; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | /** 15 | * @author Kévin Buntrock 16 | */ 17 | @Path("/actions") 18 | @jakarta.ws.rs.Path("/actions") 19 | @RequestMapping("/actions") 20 | public class ActionResource extends EntityDtoResource { 21 | 22 | private static final String GET_ALL_PATH = "/all/{since}"; 23 | 24 | @GET 25 | @Path(GET_ALL_PATH) 26 | @jakarta.ws.rs.GET 27 | @jakarta.ws.rs.Path(GET_ALL_PATH) 28 | @GetMapping(GET_ALL_PATH) 29 | public List getAll(@PathParam("since") @jakarta.ws.rs.PathParam("since") @PathVariable("since") final long since) { 30 | return null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/ExtendsGenericObjectMap.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.dto.genericity.extendsMap.GenericExtendsObjectMap; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.UUID; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | 11 | @RequestMapping("/extends-generic-object-map") 12 | public class ExtendsGenericObjectMap { 13 | 14 | @GetMapping(path = "/map") 15 | public GenericExtendsObjectMap getMap() { 16 | GenericExtendsObjectMap map = new GenericExtendsObjectMap(); 17 | List uuidList = new ArrayList<>(); 18 | map.rows(uuidList); 19 | List longList = new ArrayList<>(); 20 | map.lines(longList); 21 | return map; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/ExtendsList.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.dto.genericity.extendsList.ExtendsListUUID; 4 | import io.github.kbuntrock.resources.dto.genericity.extendsMap.ChildExtendMapUUID; 5 | import io.github.kbuntrock.resources.dto.genericity.extendsMap.ExtendsMapLong; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | /** 12 | * Some list endpoint 13 | */ 14 | @RequestMapping("/list-extends") 15 | public interface ExtendsList { 16 | 17 | /** 18 | * Get a list of uuids 19 | * @return uuid list 20 | */ 21 | @GetMapping(path = "/list") 22 | ExtendsListUUID getListUUID(); 23 | } 24 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/ExtendsListV2.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.dto.genericity.extendsMap.GenericExtendsList; 4 | import io.github.kbuntrock.resources.dto.genericity.extendsMap.GenericExtendsObjectMap; 5 | import java.util.UUID; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | @RequestMapping("/extends-list-v2") 10 | public interface ExtendsListV2 { 11 | 12 | 13 | @GetMapping(path = "/") 14 | GenericExtendsList getList(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/ExtendsMap.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.dto.genericity.extendsMap.ChildExtendMapUUID; 4 | import io.github.kbuntrock.resources.dto.genericity.extendsMap.ExtendsMapLong; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | /** 11 | * Some map endpoint 12 | */ 13 | @RequestMapping("/map-extends") 14 | public interface ExtendsMap { 15 | 16 | /** 17 | * Get a child map 18 | * @return a child map 19 | */ 20 | @GetMapping(path = "/child-map") 21 | ChildExtendMapUUID getChildMap(); 22 | 23 | /** 24 | * Post a "extend map" 25 | * @param myMap some map 26 | */ 27 | @PostMapping(path = "/extend-map") 28 | void postExtendMap(@RequestBody ExtendsMapLong myMap); 29 | } 30 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericDataController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | @RestController 12 | @RequestMapping(Constants.BASE_API + "/generic-test") 13 | public class GenericDataController extends AbstractGenericData { 14 | 15 | @GetMapping("/datalist") 16 | @Override 17 | public List getDataList() { 18 | 19 | final AccountDto user1 = new AccountDto(); 20 | user1.setFirstName("JohnL"); 21 | final AccountDto user2 = new AccountDto(); 22 | user2.setFirstName("First name number two"); 23 | return Arrays.asList(user1, user2); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericMapInBody.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | 4 | import java.util.Map; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * Generic map in body 11 | * @param a generic type 12 | */ 13 | public interface GenericMapInBody { 14 | 15 | /** 16 | * Post map in body 17 | * @param myMap my map 18 | */ 19 | @PostMapping(path = "/object-map") 20 | void postObject(@RequestBody Map myMap); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericMappingObject.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | 5 | /** 6 | * Generic map of objects in body 7 | */ 8 | @RequestMapping("/generic-mapping") 9 | public interface GenericMappingObject extends GenericMapInBody { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestEight.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.criteria.SearchCriteriaV2; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/genericity-test-seven") 13 | public interface GenericityTestEight { 14 | 15 | 16 | @PostMapping(path = "search") 17 | String findTerritoireGeographiqueByCriteria(@RequestBody SearchCriteriaV2 searchCriteria); 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestEleven.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.criteria.SearchCriteriaChildV6; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/genericity-test-eleven") 13 | public interface GenericityTestEleven { 14 | 15 | @PostMapping(path = "/search") 16 | public String search(@RequestBody SearchCriteriaChildV6 searchCriteria); 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestFive.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import java.util.List; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/genericity-test-five") 13 | public interface GenericityTestFive { 14 | 15 | 16 | @PostMapping(path = "update-something") 17 | void update(@RequestParam(value = "smthId", required = true) Long smthId, 18 | @RequestParam(value = "otherIds", required = false) List otherIds); 19 | } 20 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestFour.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.TimeDto; 5 | import io.github.kbuntrock.resources.dto.TypedDto; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | /** 11 | * @author Kevin Buntrock 12 | */ 13 | @RequestMapping(Constants.BASE_API + "/genericity-test-four") 14 | public interface GenericityTestFour { 15 | 16 | @GetMapping("/get-typed-dto/{id}") 17 | TypedDto getTypedDto(@PathVariable int id); 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestNine.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.criteria.SearchCriteriaV3; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/genericity-test-nine") 13 | public interface GenericityTestNine { 14 | 15 | 16 | @PostMapping(path = "search") 17 | String findTerritoireGeographiqueByCriteria(@RequestBody SearchCriteriaV3 searchCriteria); 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestSeven.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.criteria.SearchCriteria; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/genericity-test-seven") 13 | public interface GenericityTestSeven { 14 | 15 | 16 | @PostMapping(path = "search") 17 | String findTerritoireGeographiqueByCriteria(@RequestBody SearchCriteria searchCriteria); 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestSix.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import io.github.kbuntrock.resources.dto.TerritoryEnum; 6 | import java.util.List; 7 | import java.util.Map; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | 12 | /** 13 | * @author Kevin Buntrock 14 | */ 15 | @RequestMapping(Constants.BASE_API + "/genericity-test-six") 16 | public interface GenericityTestSix { 17 | 18 | 19 | @PostMapping(path = "authority-map") 20 | Map> findTerritoireGeographiqueByCriteria(@RequestParam Long sectionId); 21 | } 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestTen.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.criteria.SearchCriteriaV4; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/genericity-test-ten") 13 | public interface GenericityTestTen { 14 | 15 | 16 | @PostMapping(path = "search") 17 | String findTerritoireGeographiqueByCriteria(@RequestBody SearchCriteriaV4 searchCriteria); 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestThree.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import io.github.kbuntrock.resources.dto.WrapperDto; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | /** 11 | * @author Kevin Buntrock 12 | */ 13 | @RequestMapping(Constants.BASE_API + "/genericity-test-three") 14 | public interface GenericityTestThree { 15 | 16 | @GetMapping("/get-account/{id}") 17 | WrapperDto getPageAccount(@PathVariable int id); 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/GenericityTestTwelve.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.criteria.SearchCriteriaV42; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/genericity-test-twelve") 13 | public interface GenericityTestTwelve { 14 | 15 | 16 | @PostMapping(path = "search") 17 | String findTerritoireGeographiqueByCriteria(@RequestBody SearchCriteriaV42 searchCriteria); 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/Issue144.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.dto.genericity.issue144.ChildRequestDto; 4 | import org.springframework.web.bind.annotation.PutMapping; 5 | import org.springframework.web.bind.annotation.RequestBody; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import javax.validation.Valid; 9 | 10 | /** 11 | * Issue 144 webservice 12 | */ 13 | @RequestMapping("/issue144") 14 | public interface Issue144 { 15 | 16 | /** 17 | * Get the requested items 18 | * @param priceRequest some price request 19 | * @return the requested item 20 | */ 21 | @PutMapping(path = "/foo") 22 | String getRequestItems(@RequestBody final ChildRequestDto priceRequest); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/Issue144ByInterface.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.dto.genericity.issue144.ChildRequestDtoInterface; 4 | import org.springframework.web.bind.annotation.PutMapping; 5 | import org.springframework.web.bind.annotation.RequestBody; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * Issue 144 webservice (by interface) 10 | */ 11 | @RequestMapping("/issue144") 12 | public interface Issue144ByInterface { 13 | 14 | /** 15 | * Get the requested items 16 | * @param priceRequest some price request 17 | * @return the requested item 18 | */ 19 | @PutMapping(path = "/foo") 20 | String getRequestItems(@RequestBody final ChildRequestDtoInterface priceRequest); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/Issue89.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.dto.genericity.issue89.Bar; 4 | import io.github.kbuntrock.resources.dto.genericity.issue89.IBar; 5 | import java.util.Collection; 6 | import org.springframework.http.ResponseEntity; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | /** 12 | * Webservices about the issue number 89 13 | * 14 | * @author Kevin Buntrock 15 | */ 16 | @RequestMapping(Issue89.API_PREFIX) 17 | public interface Issue89 { 18 | 19 | String API_PREFIX = "/issue89"; 20 | 21 | /** 22 | * This api test the issue n°89 23 | * 24 | * @param myParam my awesome parameter 25 | * @return my also awesome response 26 | */ 27 | @PostMapping(path = "/youAreAwesome-applications") 28 | ResponseEntity> youAreAwesome(@RequestBody Bar myParam); 29 | } 30 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/Issue95.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import io.github.kbuntrock.resources.dto.genericity.issue95.ErrorDto; 4 | import org.springframework.web.bind.annotation.PutMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | /** 8 | * @author Kévin Buntrock 9 | */ 10 | @RequestMapping("/issue95") 11 | public interface Issue95 { 12 | 13 | @PutMapping(path = "/error") 14 | ErrorDto error(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/MappingObject.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | 4 | import io.github.kbuntrock.resources.dto.genericity.mappingObject.MapWithObject; 5 | import java.util.Map; 6 | import org.springframework.http.MediaType; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | 12 | @RequestMapping("/mapping-object") 13 | public interface MappingObject { 14 | 15 | @GetMapping(path = "/object") 16 | Object getObject(); 17 | 18 | @PostMapping(path = "/object") 19 | void postObject(@RequestBody Object anything); 20 | 21 | @GetMapping(path = "/object-map") 22 | MapWithObject getObjectMap(); 23 | 24 | @GetMapping(path = "/non-wrapped-object-map", produces = MediaType.APPLICATION_JSON_VALUE) 25 | Map getNonWrappedObjectMap(); 26 | } 27 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/generic/StatusResources.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import javax.ws.rs.GET; 4 | import javax.ws.rs.Path; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | 7 | /** 8 | * @author Kévin Buntrock 9 | */ 10 | public abstract class StatusResources { 11 | 12 | @GET 13 | @Path("/status") 14 | @jakarta.ws.rs.GET 15 | @jakarta.ws.rs.Path("/status") 16 | @GetMapping("/status") 17 | public StatusDto getStatus() { 18 | return null; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/ignore/JsonIgnoreController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.ignore; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.ignore.JsonIgnoreDto; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | @RequestMapping(Constants.BASE_API + "/json-ignore") 9 | public interface JsonIgnoreController { 10 | 11 | @GetMapping("/get") 12 | JsonIgnoreDto get(); 13 | } 14 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/interfacedto/InterfaceController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.interfacedto; 2 | 3 | import io.github.kbuntrock.resources.dto.Authority; 4 | import io.github.kbuntrock.resources.dto.InterfaceDto; 5 | import io.github.kbuntrock.resources.dto.TimeDto; 6 | import java.util.List; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | /** 11 | * Test a controller returning an interface 12 | * 13 | * @author Kevin Buntrock 14 | */ 15 | @RequestMapping("api") 16 | public interface InterfaceController { 17 | 18 | /** 19 | * This endpoint returns an interface 20 | * 21 | * @return the returned interface 22 | */ 23 | @GetMapping("interface") 24 | InterfaceDto> getInterfaceDto(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/issues/Issue138.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.generic; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | import java.util.HashMap; 7 | 8 | @RequestMapping("/issue138") 9 | public class Issue138 { 10 | 11 | @GetMapping 12 | public Response issue138() { 13 | return Response.ok("Type K"); 14 | } 15 | 16 | public static class Response extends HashMap { 17 | 18 | public static Response ok(Object data) { 19 | Response response = new Response(); 20 | response.put("code", 20000); 21 | response.put("data", data); 22 | return response; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/jackson/JacksonJsonPropertyController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.jackson; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.jackson.SimpleUserDto; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Jackson Json property controller 13 | */ 14 | @RequestMapping(Constants.BASE_API + "/users") 15 | @RestController 16 | public interface JacksonJsonPropertyController { 17 | 18 | /** 19 | * {@code GET /users} : get the list of users 20 | * 21 | * @return the list of users. 22 | */ 23 | @RequestMapping(method = RequestMethod.GET) 24 | List findAll(); 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javadoc/inheritance/GrandParentAbstract.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javadoc.inheritance; 2 | 3 | /** 4 | * This is the Grand parent abstract class 5 | * 6 | * @author Kevin Buntrock 7 | */ 8 | public abstract class GrandParentAbstract { 9 | 10 | /** 11 | * Pretty print a number 12 | * 13 | * @param number 14 | * @return a pretty printed string 15 | */ 16 | public abstract String prettyPrint(long number); 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javadoc/inheritance/GrandParentInterface.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javadoc.inheritance; 2 | 3 | /** 4 | * This is the grand parent interface 5 | * 6 | * @author Kevin Buntrock 7 | */ 8 | public interface GrandParentInterface { 9 | 10 | /** 11 | * Indicate if this class has the ability to pretty print 12 | * 13 | * @return true if it can pretty print 14 | */ 15 | boolean canPrettyPrint(); 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javadoc/inheritance/ParentAbstract.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javadoc.inheritance; 2 | 3 | /** 4 | * @author Kevin Buntrock 5 | */ 6 | public abstract class ParentAbstract extends GrandParentAbstract implements GrandParentInterface { 7 | 8 | /** 9 | * Encapsulate a number in a beautiful string representation 10 | * 11 | * @param number 12 | * @return encapsulate a number in a beautiful string representation 13 | */ 14 | public String encapsulate(final long number) { 15 | return "__*" + number + "*__"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javadoc/inheritance/ParentInterface.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javadoc.inheritance; 2 | 3 | /** 4 | * This is the parent interface 5 | * 6 | * @author Kevin Buntrock 7 | */ 8 | public interface ParentInterface { 9 | 10 | /** 11 | * Indicate if this class has the ability to encapsulate 12 | * 13 | * @return true if it can encapsulate 14 | */ 15 | boolean canEncapsulate(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javadoc/inheritance/three/ChildClassThree.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javadoc.inheritance.three; 2 | 3 | import io.github.kbuntrock.resources.dto.PageDto; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | /** 8 | * A beautiful description of ChildClassTwo 9 | * 10 | * @author Kevin Buntrock 11 | */ 12 | @RestController 13 | public class ChildClassThree implements IChildClassThree { 14 | 15 | 16 | /** 17 | * Supported functionalities, as a page 18 | * 19 | * @return the supported functionalities 20 | */ 21 | @GetMapping("/functionalities") 22 | public PageDto getPageFunctionalities() { 23 | return null; 24 | } 25 | 26 | 27 | @Override 28 | public boolean canPrettyPrint() { 29 | return false; 30 | } 31 | 32 | @Override 33 | public String giveMeMyAgePlusOne(final int age) { 34 | return null; 35 | } 36 | 37 | @Override 38 | public boolean canEncapsulate() { 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javadoc/inheritance/three/IChildClassThree.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javadoc.inheritance.three; 2 | 3 | import io.github.kbuntrock.resources.endpoint.javadoc.inheritance.GrandParentInterface; 4 | import io.github.kbuntrock.resources.endpoint.javadoc.inheritance.ParentInterface; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | 7 | /** 8 | * @author Kevin Buntrock 9 | */ 10 | public interface IChildClassThree extends ParentInterface, GrandParentInterface { 11 | 12 | @GetMapping("/age-plus-one") 13 | String giveMeMyAgePlusOne(int age); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javadoc/inheritance/two/ChildClassTwo.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javadoc.inheritance.two; 2 | 3 | import io.github.kbuntrock.resources.dto.PageDto; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | /** 8 | * A beautiful description of ChildClassTwo 9 | * 10 | * @author Kevin Buntrock 11 | */ 12 | @RestController 13 | public class ChildClassTwo implements IChildClassTwo { 14 | 15 | 16 | /** 17 | * Supported functionalities, as a page 18 | * 19 | * @return the supported functionalities 20 | */ 21 | @GetMapping("/functionalities") 22 | public PageDto getPageFunctionalities() { 23 | return null; 24 | } 25 | 26 | 27 | @Override 28 | public boolean canPrettyPrint() { 29 | return false; 30 | } 31 | 32 | @Override 33 | public String giveMeMyAgePlusOne(final int age) { 34 | return null; 35 | } 36 | 37 | @Override 38 | public boolean canEncapsulate() { 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javadoc/inheritance/two/IChildClassTwo.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javadoc.inheritance.two; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.endpoint.javadoc.inheritance.GrandParentInterface; 5 | import io.github.kbuntrock.resources.endpoint.javadoc.inheritance.ParentInterface; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/child-class-two") 13 | public interface IChildClassTwo extends ParentInterface, GrandParentInterface { 14 | 15 | @GetMapping("/age-plus-one") 16 | String giveMeMyAgePlusOne(int age); 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javasource/ControllerOne.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javasource; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.SpeAccountDto; 5 | import java.util.List; 6 | import java.util.Map; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | @RequestMapping(Constants.BASE_API + "/test-one") 12 | public interface ControllerOne { 13 | 14 | @GetMapping("/account-page") 15 | boolean getAccountsPage(@RequestBody List[]>[]> test); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javasource/ControllerThree.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javasource; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import io.github.kbuntrock.resources.dto.SpeAccountDto; 6 | import java.util.List; 7 | import java.util.Map; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | 13 | @RequestMapping(Constants.BASE_API + "/test-three") 14 | public interface ControllerThree { 15 | 16 | @GetMapping("/account-page-one") 17 | boolean getAccountsPage(@RequestBody List[]>[]> test); 18 | 19 | @GetMapping("/account-page-two/{id}") 20 | List[]>[]> getAccountsPage(@PathVariable long id); 21 | 22 | @GetMapping("/account-page-three") 23 | List[]>[]> getAccountsPage(@RequestBody Map[]>[] body); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/javasource/ControllerTwo.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.javasource; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.SpeAccountDto; 5 | import java.util.List; 6 | import java.util.Map; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | @RequestMapping(Constants.BASE_API + "/test-two") 12 | public interface ControllerTwo { 13 | 14 | @GetMapping("/account-page/{id}") 15 | List[]>[]> getAccountsPage(@PathVariable long id); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/jaxrs/AbstractJaxrsController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.jaxrs; 2 | 3 | import io.github.kbuntrock.resources.dto.AccountDto; 4 | import javax.ws.rs.core.Response; 5 | 6 | /** 7 | * @author Kévin Buntrock 8 | */ 9 | public abstract class AbstractJaxrsController { 10 | 11 | 12 | @ResponseType(AccountDto.class) 13 | public abstract Response indirectlyPresent(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/jaxrs/ResponseJaxrsController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.jaxrs; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import javax.ws.rs.GET; 6 | import javax.ws.rs.Path; 7 | import javax.ws.rs.core.Response; 8 | 9 | /** 10 | * User account management 11 | */ 12 | @Path(Constants.BASE_API + "/response") 13 | @jakarta.ws.rs.Path(Constants.BASE_API + "/response") 14 | public class ResponseJaxrsController extends AbstractJaxrsController { 15 | 16 | @Override 17 | @GET 18 | @Path("/update-indirectly") 19 | @jakarta.ws.rs.GET 20 | @jakarta.ws.rs.Path("/update-indirectly") 21 | public Response indirectlyPresent() { 22 | return null; 23 | } 24 | 25 | @GET 26 | @Path("/update-directly") 27 | @jakarta.ws.rs.GET 28 | @jakarta.ws.rs.Path("/update-directly") 29 | @ResponseType(AccountDto.class) 30 | public Response directlyPresent() { 31 | return null; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/jaxrs/ResponseType.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.jaxrs; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * @author Kévin Buntrock 10 | */ 11 | // TODO : test retention class (or even source) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target(ElementType.METHOD) 14 | public @interface ResponseType { 15 | 16 | Class value(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/map/MapController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.map; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import java.util.Map; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | @RequestMapping(Constants.BASE_API + "/map") 12 | public interface MapController { 13 | 14 | @GetMapping("/get-map-users") 15 | Map getMapUsers(); 16 | 17 | @GetMapping("/get-map-string") 18 | Map getMapString(); 19 | 20 | @PostMapping("/post-map-int") 21 | String postMapInt(@RequestBody Map map); 22 | 23 | @PostMapping("/post-map-account") 24 | String postMapAccount(@RequestBody Map map); 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/namecollision/one/MyController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.namecollision.one; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import org.springframework.web.bind.annotation.DeleteMapping; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PatchMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.PutMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | /** 12 | * @author Kévin Buntrock 13 | */ 14 | @RequestMapping(Constants.BASE_API + "/controller-1") 15 | public interface MyController { 16 | 17 | @PostMapping("info") 18 | String setInfo(); 19 | 20 | @DeleteMapping("info") 21 | String deleteInfo(); 22 | 23 | @GetMapping("info") 24 | String getInfo(); 25 | 26 | @PutMapping("info") 27 | String putInfo(); 28 | 29 | @PatchMapping("info") 30 | String patchInfo(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/namecollision/three/MyController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.namecollision.three; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import javax.ws.rs.QueryParam; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * @author Kévin Buntrock 10 | */ 11 | @RequestMapping(Constants.BASE_API + "/controller-3") 12 | public interface MyController { 13 | 14 | 15 | @GetMapping("info") 16 | String getInfo(); 17 | 18 | @GetMapping("info") 19 | String getInfo(@QueryParam("toto") String toto); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/namecollision/two/MyController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.namecollision.two; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import org.springframework.web.bind.annotation.DeleteMapping; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PatchMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.PutMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | /** 12 | * @author Kévin Buntrock 13 | */ 14 | @RequestMapping(Constants.BASE_API + "/controller-2") 15 | public interface MyController { 16 | 17 | @PostMapping("info") 18 | String setInfo(); 19 | 20 | @DeleteMapping("info") 21 | String deleteInfo(); 22 | 23 | @GetMapping("info") 24 | String getInfo(); 25 | 26 | @PutMapping("info") 27 | String putInfo(); 28 | 29 | @PatchMapping("info") 30 | String patchInfo(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/nesting/NestedDtosController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.nesting; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import io.github.kbuntrock.resources.dto.UserGroupDto; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | 12 | @RequestMapping(Constants.BASE_API + "/nesting") 13 | public interface NestedDtosController { 14 | 15 | @GetMapping("/{id}") 16 | AccountDto getById(@PathVariable(value = "id") Long id); 17 | 18 | @GetMapping("/usergroup/{id}") 19 | UserGroupDto getUsergroupById(@PathVariable(value = "id") Long id); 20 | 21 | @PostMapping("/usergroup") 22 | String setUsergroup(@RequestBody UserGroupDto usergroup); 23 | } 24 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/nullable/NullableController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.nullable; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.AccountDto; 5 | import io.github.kbuntrock.resources.dto.UserGroupDto; 6 | import io.github.kbuntrock.resources.dto.nullable.NullableDto; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | @RequestMapping("/nullable") 10 | public interface NullableController { 11 | 12 | @GetMapping("/{id}") 13 | NullableDto getById(@PathVariable(value = "id") Long id); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/nullable/NullableGettersSettersController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.nullable; 2 | 3 | import io.github.kbuntrock.resources.dto.nullable.NullableDto; 4 | import io.github.kbuntrock.resources.dto.nullable.NullableGettersSettersDto; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | @RequestMapping("/nullableGettersSetters") 10 | public interface NullableGettersSettersController { 11 | 12 | @GetMapping("/{id}") 13 | NullableGettersSettersDto getById(@PathVariable(value = "id") Long id); 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/number/NumberController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.number; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.NumberDto; 5 | import java.math.BigDecimal; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | 10 | /** 11 | * @author Kevin Buntrock 12 | */ 13 | @RequestMapping(Constants.BASE_API + "/file-upload") 14 | public interface NumberController { 15 | 16 | @GetMapping("the-number") 17 | NumberDto getTheNumberDto(@RequestParam BigDecimal bigDecimal); 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/operation/MultipleProducedContentTypes.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.operation; 2 | 3 | import io.github.kbuntrock.resources.dto.AccountDto; 4 | import org.springframework.http.MediaType; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | 9 | /** 10 | * A controller producing multiple content types 11 | */ 12 | @RequestMapping("/multiple-produced-content-types") 13 | public interface MultipleProducedContentTypes { 14 | 15 | /** 16 | * produce some json 17 | * @param firstname a given firstname 18 | * @return 19 | */ 20 | @GetMapping(path = "/", produces = MediaType.APPLICATION_JSON_VALUE) 21 | AccountDto json(@RequestParam(required = false) String firstname); 22 | 23 | /** 24 | * Produce some xml 25 | * @param surname a given surname 26 | * @return 27 | */ 28 | @GetMapping(path = "/", produces = MediaType.APPLICATION_XML_VALUE) 29 | AccountDto xml(@RequestParam(required = false) String surname); 30 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/path/SpringPathEnhancementOneController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.path; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | /** 7 | * @author Kevin Buntrock 8 | */ 9 | @RequestMapping("api") 10 | public interface SpringPathEnhancementOneController { 11 | 12 | @GetMapping("one") 13 | String getOne(); 14 | 15 | @GetMapping 16 | String getTwo(); 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/path/SpringPathEnhancementTwoController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.path; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | 5 | /** 6 | * @author Kevin Buntrock 7 | */ 8 | public interface SpringPathEnhancementTwoController { 9 | 10 | @GetMapping("one") 11 | String getOne(); 12 | 13 | @GetMapping 14 | String getTwo(); 15 | } 16 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/queryparam/EmptyValueParameterController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.queryparam; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | /** 7 | * 8 | */ 9 | @RequestMapping("api") 10 | public interface EmptyValueParameterController { 11 | 12 | @GetMapping(value = "get-info", params = "contact") 13 | String getInfoAboutContact(); 14 | 15 | @GetMapping(value = "get-info", params = {"auto", "moto", "plane"}) 16 | String getInfoAboutVehicle(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/queryparam/QueryParamDtoBindingController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.queryparam; 2 | 3 | import io.github.kbuntrock.resources.dto.TimeDto; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | /** 8 | * @author Kévin Buntrock 9 | */ 10 | @RequestMapping("api") 11 | public interface QueryParamDtoBindingController { 12 | 13 | @GetMapping("is-time-valid") 14 | boolean isTimeValid(TimeDto time); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/queryparam/QueryParamFlatMixNestedDtoBindingController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.queryparam; 2 | 3 | import io.github.kbuntrock.resources.dto.TimeDto; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | 8 | /** 9 | * @author Kévin Buntrock 10 | */ 11 | @RequestMapping("api") 12 | public interface QueryParamFlatMixNestedDtoBindingController { 13 | 14 | @GetMapping("is-time-valid") 15 | boolean isTimeValid( 16 | @RequestParam(value = "queryString", required = false) String queryString, 17 | TimeDto time, 18 | @RequestParam(value = "page", required = false, defaultValue = "0") final int page); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/queryparam/QueryParamInMappingController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.queryparam; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | /** 7 | * 8 | */ 9 | @RequestMapping("api") 10 | public interface QueryParamInMappingController { 11 | 12 | @GetMapping(value = "get-info-contact", params = {"param1=value1", "param2=value2", "param3!=value3"}) 13 | String getInfoAboutContact(); 14 | 15 | @GetMapping(value = "get-info-vehicule", params = {"!param1", "param2"}) 16 | String getInfoAboutVehicle(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/recursive/GenericRecursiveDtoController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.recursive; 2 | 3 | import io.github.kbuntrock.resources.dto.AccountDto; 4 | import io.github.kbuntrock.resources.dto.recursive.GenericRecursiveDto; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * A controller to test recursive generic return objects 10 | * 11 | * @author Kevin Buntrock 12 | */ 13 | @RequestMapping("api") 14 | public interface GenericRecursiveDtoController { 15 | 16 | /** 17 | * Return the recursive generic object 18 | * 19 | * @return something 20 | */ 21 | @GetMapping("recursive") 22 | GenericRecursiveDto getRecursive(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/recursive/GenericRecursiveInterfaceDtoController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.recursive; 2 | 3 | import io.github.kbuntrock.resources.dto.AccountDto; 4 | import io.github.kbuntrock.resources.dto.recursive.GenericRecursiveInterfaceDto; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * @author Kevin Buntrock 10 | */ 11 | @RequestMapping("api") 12 | public interface GenericRecursiveInterfaceDtoController { 13 | 14 | @GetMapping("recursive") 15 | GenericRecursiveInterfaceDto getRecursive(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/recursive/GenericRecursiveInterfaceListDtoInParameterController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.recursive; 2 | 3 | import io.github.kbuntrock.resources.dto.AccountDto; 4 | import io.github.kbuntrock.resources.dto.recursive.GenericInterfaceRecursiveListDto; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping("api") 13 | public interface GenericRecursiveInterfaceListDtoInParameterController { 14 | 15 | @PostMapping("recursive") 16 | void postRecursive(@RequestBody GenericInterfaceRecursiveListDto body); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/recursive/GenericRecursiveListDtoController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.recursive; 2 | 3 | import io.github.kbuntrock.resources.dto.AccountDto; 4 | import io.github.kbuntrock.resources.dto.recursive.GenericRecursiveListDto; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * @author Kevin Buntrock 10 | */ 11 | @RequestMapping("api") 12 | public interface GenericRecursiveListDtoController { 13 | 14 | @GetMapping("recursive") 15 | GenericRecursiveListDto getRecursive(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/recursive/RecursiveDtoController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.recursive; 2 | 3 | import io.github.kbuntrock.resources.dto.recursive.RecursiveDto; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | /** 8 | * @author Kevin Buntrock 9 | */ 10 | @RequestMapping("api") 11 | public interface RecursiveDtoController { 12 | 13 | @GetMapping("recursive") 14 | RecursiveDto getRecursive(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/recursive/RecursiveDtoInParameterController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.recursive; 2 | 3 | import io.github.kbuntrock.resources.dto.recursive.RecursiveDto; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RequestBody; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * @author Kevin Buntrock 10 | */ 11 | @RequestMapping("api") 12 | public interface RecursiveDtoInParameterController { 13 | 14 | @PostMapping("recursive") 15 | void postRecursive(@RequestBody RecursiveDto recursiveDto); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/spring/OptionalController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.spring; 2 | 3 | import io.github.kbuntrock.resources.dto.AccountDto; 4 | import io.github.kbuntrock.resources.dto.WrapperDto; 5 | import java.util.Optional; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * @author Kevin Buntrock 11 | */ 12 | @RequestMapping("api") 13 | public interface OptionalController { 14 | 15 | @GetMapping("account") 16 | Optional getAccount(); 17 | 18 | @GetMapping("wrapped-account") 19 | Optional> getWrappedAccount(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/spring/PackagePrivateResource.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.spring; 2 | 3 | 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Package private resource, with private and package private endpoint methods 11 | */ 12 | @RequestMapping("/package-private") 13 | class PackagePrivateResource { 14 | 15 | @GetMapping("/all-package-private-endpoint") 16 | List getAllPackagePrivate() { 17 | return null; 18 | } 19 | 20 | @GetMapping("/all-protected-endpoint") 21 | protected List getAllProtected() { 22 | return null; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/spring/ResponseEntityController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.spring; 2 | 3 | import io.github.kbuntrock.resources.dto.AccountDto; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * A controller designed to test response entities 10 | * 11 | * @author Kevin Buntrock 12 | */ 13 | @RequestMapping("api") 14 | public interface ResponseEntityController { 15 | 16 | /** 17 | * Get an account object 18 | * 19 | * @return the return account 20 | */ 21 | @GetMapping("account") 22 | ResponseEntity getAccount(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/time/TimeController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.time; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import io.github.kbuntrock.resources.dto.TimeDtoV2; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | @RequestMapping(Constants.BASE_API + "/time") 9 | public interface TimeController { 10 | 11 | @GetMapping("/get-timedto") 12 | TimeDtoV2 getTimeDto(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/resources/endpoint/uuid/UuidController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.resources.endpoint.uuid; 2 | 3 | import io.github.kbuntrock.resources.Constants; 4 | import java.util.List; 5 | import java.util.UUID; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * UUID based controller 11 | */ 12 | @RequestMapping(Constants.BASE_API + "/uuid") 13 | public interface UuidController { 14 | 15 | /** 16 | * A beautiful service 17 | * 18 | * @param myUUID initial id 19 | * @return a list of ids 20 | */ 21 | @GetMapping("/get-uuid-list") 22 | List getUuidList(UUID myUUID); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/java/io/github/kbuntrock/utils/FileUtilsTest.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.utils; 2 | 3 | import java.io.File; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | 7 | /** 8 | * @author Kevin Buntrock 9 | */ 10 | public class FileUtilsTest { 11 | 12 | @Test 13 | public void path_resolver() { 14 | 15 | String projectDirectory = new File("").getAbsolutePath(); 16 | String subPath = "src/test/java/io/github/kbuntrock/utils"; 17 | File resolvedFile = FileUtils.toFile(projectDirectory, subPath); 18 | Assertions.assertTrue(resolvedFile.exists()); 19 | Assertions.assertTrue(resolvedFile.isDirectory()); 20 | 21 | projectDirectory = new File("src/test/java/io/github/kbuntrock/utils").getAbsolutePath(); 22 | subPath = "../resources/endpoint/../dto"; 23 | resolvedFile = FileUtils.toFile(projectDirectory, subPath); 24 | Assertions.assertTrue(resolvedFile.exists()); 25 | Assertions.assertTrue(resolvedFile.isDirectory()); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case/openapi/default_errors.json: -------------------------------------------------------------------------------- 1 | { 2 | "401": { 3 | "$ref": "#/components/responses/Unauthorized" 4 | }, 5 | "404": { 6 | "$ref": "#/components/responses/NotFound" 7 | } 8 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case/openapi/merged_free_fields.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "title": "Modified title", 4 | "version": "v0.3-M5" 5 | }, 6 | "servers": [ 7 | { 8 | "url": "https://modified-server.com" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case/src/main/java/io/github/kbuntrock/sample/Constants.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample; 2 | 3 | public class Constants { 4 | 5 | public static final String BASE_PATH = "/api"; 6 | 7 | // Regex for acceptable logins 8 | public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$"; 9 | 10 | public static final int PASSWORD_MIN_LENGTH = 4; 11 | 12 | public static final int PASSWORD_MAX_LENGTH = 100; 13 | 14 | private Constants() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case/src/main/java/io/github/kbuntrock/sample/annotation/MyNotNull.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Target(ElementType.FIELD) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Documented 12 | public @interface MyNotNull { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case/src/main/java/io/github/kbuntrock/sample/dto/Authority.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.dto; 2 | 3 | /** 4 | * Permissions of a user 5 | */ 6 | public enum Authority { 7 | /** 8 | * Has the right to access the application 9 | */ 10 | ACCESS_APP(1000), 11 | /** 12 | * Can read user informations 13 | */ 14 | READ_USER(2000), 15 | /** 16 | * Can update user informations 17 | */ 18 | UPDATE_USER(3000); 19 | 20 | private final int code; 21 | 22 | Authority(final int code) { 23 | this.code = code; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case/src/main/java/io/github/kbuntrock/sample/enpoint/UserController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.enpoint; 2 | 3 | import io.github.kbuntrock.sample.Constants; 4 | import io.github.kbuntrock.sample.dto.UserDto; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * User controller interface 11 | */ 12 | @RequestMapping(path = Constants.BASE_PATH + "/user") 13 | public interface UserController { 14 | 15 | String TEXT_BLOCK = """ 16 | Example text 17 | with 18 | multiple 19 | lines"""; 20 | 21 | /** 22 | * Update a user 23 | * 24 | * @param userDto the user and his updated data 25 | * @return the updated user 26 | */ 27 | @PutMapping("/update") 28 | UserDto updateUser(@RequestBody UserDto userDto); 29 | 30 | /** 31 | * Get a list of all the users of the application 32 | * 33 | * @return a list of all the users of the application 34 | */ 35 | @GetMapping("/user-dtos") 36 | List getUserDtos(); 37 | } 38 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case/src/main/java/io/github/kbuntrock/sample/implementation/UserControllerImpl.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.implementation; 2 | 3 | import io.github.kbuntrock.sample.dto.UserDto; 4 | import io.github.kbuntrock.sample.enpoint.UserController; 5 | import org.springframework.web.bind.annotation.*; 6 | import org.springframework.web.servlet.mvc.AbstractController; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import org.springframework.web.servlet.ModelAndView; 10 | 11 | import java.util.List; 12 | 13 | @RestController 14 | public class UserControllerImpl extends AbstractController implements UserController { 15 | 16 | @Override 17 | public UserDto updateUser(final UserDto userDto) { 18 | return null; 19 | } 20 | 21 | @Override 22 | public List getUserDtos() { 23 | return null; 24 | } 25 | 26 | @Override 27 | protected ModelAndView handleRequestInternal(final HttpServletRequest arg0, final HttpServletResponse arg1) throws Exception { 28 | return null; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jaxrs/src/main/java/io/github/kbuntrock/sample/Constants.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample; 2 | 3 | public class Constants { 4 | 5 | public static final String BASE_PATH = "/api"; 6 | 7 | // Regex for acceptable logins 8 | public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$"; 9 | 10 | public static final int PASSWORD_MIN_LENGTH = 4; 11 | 12 | public static final int PASSWORD_MAX_LENGTH = 100; 13 | 14 | private Constants() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/nominal_test_case_jaxrs/src/main/java/io/github/kbuntrock/sample/dto/Authority.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.dto; 2 | 3 | /** 4 | * Permissions of a user 5 | */ 6 | public enum Authority { 7 | /** 8 | * Has the right to access the application 9 | */ 10 | ACCESS_APP, 11 | /** 12 | * Can read user informations 13 | */ 14 | READ_USER, 15 | /** 16 | * Can update user informations 17 | */ 18 | UPDATE_USER 19 | } 20 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/sealed_class/src/main/java/io/github/kbuntrock/sample/dto/CircleDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.dto; 2 | 3 | /** 4 | * Circle shape object as a datatransfer object 5 | * 6 | * @author Kévin Buntrock 7 | */ 8 | public final class CircleDto extends ShapeDto { 9 | 10 | /** 11 | * Radius of the circle in mm 12 | */ 13 | private double radius; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/sealed_class/src/main/java/io/github/kbuntrock/sample/dto/RecordStatusDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.dto; 2 | 3 | /** 4 | * Represent a service status 5 | * 6 | * @param up Indicate if the service is ok (= true) or not ok (= false) 7 | * @author Kévin Buntrock 8 | */ 9 | public record RecordStatusDto(boolean up) { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/sealed_class/src/main/java/io/github/kbuntrock/sample/dto/ShapeDto.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.dto; 2 | 3 | /** 4 | * An abstract shape dto 5 | * 6 | * @author Kévin Buntrock 7 | */ 8 | public sealed class ShapeDto permits CircleDto { 9 | 10 | /** 11 | * Center of the shape on the X axis 12 | */ 13 | private int centerX; 14 | 15 | /** 16 | * Center of the shape on the Y axis 17 | */ 18 | private int centerY; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/BasicIT/sealed_class/src/main/java/io/github/kbuntrock/sample/enpoint/ShapeController.java: -------------------------------------------------------------------------------- 1 | package io.github.kbuntrock.sample.enpoint; 2 | 3 | import io.github.kbuntrock.sample.dto.CircleDto; 4 | import io.github.kbuntrock.sample.dto.RecordStatusDto; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Shape rest controller 11 | */ 12 | @RequestMapping(path = "/api/shape") 13 | public interface ShapeController { 14 | 15 | 16 | /** 17 | * Get a circle 18 | * 19 | * @return the circle object 20 | */ 21 | @GetMapping("/circle") 22 | CircleDto getCircle(); 23 | 24 | /** 25 | * Get the api status 26 | * 27 | * @return the status of the shape api 28 | */ 29 | @GetMapping("/status") 30 | RecordStatusDto getStatus(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources-its/io/github/kbuntrock/it/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | parent-it-module 7 | 8 | io.github.kbuntrock.openapi.it 9 | 4.0.0 10 | 11 | BasicIT/nominal_test_case 12 | BasicIT/nominal_test_case_jaxrs 13 | BasicIT/sealed_class 14 | 15 | pom 16 | 17 | 0.0 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/ModelSubstitutionTest.object_substitution.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: ResponseEntityController 10 | paths: 11 | /api/account: 12 | get: 13 | tags: 14 | - ResponseEntityController 15 | operationId: ResponseEntityController.getAccount 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | application/json: 21 | schema: 22 | $ref: '#/components/schemas/CustomAccountDto' 23 | x-operation-name: getAccount 24 | components: 25 | schemas: 26 | CustomAccountDto: 27 | description: Custom version of the accountDto 28 | required: 29 | - email 30 | - token 31 | type: object 32 | properties: 33 | email: 34 | type: string 35 | format: email 36 | minLength: 5 37 | maxLength: 254 38 | token: 39 | type: number 40 | format: double 41 | activated: 42 | type: boolean 43 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/ModelSubstitutionTest.object_substitution_json_content.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: ResponseEntityController 10 | paths: 11 | /api/account: 12 | get: 13 | tags: 14 | - ResponseEntityController 15 | operationId: ResponseEntityController.getAccount 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | application/json: 21 | schema: 22 | $ref: '#/components/schemas/CustomAccountDto' 23 | x-operation-name: getAccount 24 | components: 25 | schemas: 26 | CustomAccountDto: 27 | description: Custom version of the accountDto 28 | required: 29 | - email 30 | - token 31 | type: object 32 | properties: 33 | email: 34 | type: string 35 | format: email 36 | minLength: 5 37 | maxLength: 254 38 | token: 39 | type: number 40 | format: double 41 | activated: 42 | type: boolean 43 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.annotated_controller.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: AnnotatedController 10 | paths: 11 | /counter: 12 | get: 13 | tags: 14 | - AnnotatedController 15 | operationId: getCounter 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | type: integer 23 | format: int32 24 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.collection.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: CollectionController 10 | paths: 11 | /api/collection: 12 | get: 13 | tags: 14 | - CollectionController 15 | operationId: getStringCollection 16 | requestBody: 17 | content: 18 | '*/*': 19 | schema: 20 | type: array 21 | items: 22 | type: integer 23 | format: int64 24 | responses: 25 | 200: 26 | description: successful operation 27 | content: 28 | '*/*': 29 | schema: 30 | type: array 31 | items: 32 | type: string 33 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.empty_value_query_parameter.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: EmptyValueParameterController 10 | paths: 11 | /api/get-info: 12 | get: 13 | tags: 14 | - EmptyValueParameterController 15 | operationId: getInfoAboutContact 16 | parameters: 17 | - name: contact 18 | in: query 19 | required: false 20 | allowEmptyValue: true 21 | - name: auto 22 | in: query 23 | required: false 24 | allowEmptyValue: true 25 | - name: moto 26 | in: query 27 | required: false 28 | allowEmptyValue: true 29 | - name: plane 30 | in: query 31 | required: false 32 | allowEmptyValue: true 33 | responses: 34 | 200: 35 | description: successful operation 36 | content: 37 | '*/*': 38 | schema: 39 | type: string 40 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.enpoint_path_collision.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: MyController 10 | paths: 11 | /api/controller-3/info: 12 | get: 13 | tags: 14 | - MyController 15 | operationId: getInfo 16 | parameters: 17 | - name: toto 18 | in: query 19 | required: true 20 | schema: 21 | type: string 22 | responses: 23 | 200: 24 | description: successful operation 25 | content: 26 | '*/*': 27 | schema: 28 | type: string 29 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.enumeration_test_1.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: TestEnumeration1Controller 10 | paths: 11 | /api/test-enum-1: 12 | get: 13 | tags: 14 | - TestEnumeration1Controller 15 | operationId: getAuthorities 16 | deprecated: true 17 | responses: 18 | 200: 19 | description: successful operation 20 | content: 21 | '*/*': 22 | schema: 23 | $ref: '#/components/schemas/EnumTest1Dto' 24 | components: 25 | schemas: 26 | Authority: 27 | type: string 28 | enum: 29 | - READ_USER 30 | - WRITE_USER 31 | - ACCES_APP 32 | EnumTest1Dto: 33 | type: object 34 | properties: 35 | authorityList: 36 | type: array 37 | items: 38 | $ref: '#/components/schemas/Authority' 39 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.enumeration_test_2.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: TestEnumeration2Controller 10 | paths: 11 | /api/test-enum-2: 12 | get: 13 | tags: 14 | - TestEnumeration2Controller 15 | operationId: getAuthorities 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | type: array 23 | items: 24 | $ref: '#/components/schemas/Authority' 25 | components: 26 | schemas: 27 | Authority: 28 | type: string 29 | enum: 30 | - READ_USER 31 | - WRITE_USER 32 | - ACCES_APP 33 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.enumeration_test_3.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: TestEnumeration3Controller 10 | paths: 11 | /api/test-enum-3: 12 | get: 13 | tags: 14 | - TestEnumeration3Controller 15 | operationId: getAuthority 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | $ref: '#/components/schemas/Authority' 23 | components: 24 | schemas: 25 | Authority: 26 | type: string 27 | enum: 28 | - READ_USER 29 | - WRITE_USER 30 | - ACCES_APP 31 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.enumeration_test_4.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: TestEnumeration4Controller 10 | paths: 11 | /api/test-enum-1: 12 | post: 13 | tags: 14 | - TestEnumeration4Controller 15 | operationId: getAuthorities 16 | requestBody: 17 | content: 18 | '*/*': 19 | schema: 20 | $ref: '#/components/schemas/EnumTest1Dto' 21 | responses: 22 | 200: 23 | description: successful operation 24 | content: 25 | '*/*': 26 | schema: 27 | type: string 28 | components: 29 | schemas: 30 | Authority: 31 | type: string 32 | enum: 33 | - READ_USER 34 | - WRITE_USER 35 | - ACCES_APP 36 | EnumTest1Dto: 37 | type: object 38 | properties: 39 | authorityList: 40 | type: array 41 | items: 42 | $ref: '#/components/schemas/Authority' 43 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.enumeration_test_5.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: TestEnumeration5Controller 10 | paths: 11 | /api/test-enum-2: 12 | post: 13 | tags: 14 | - TestEnumeration5Controller 15 | operationId: getAuthorities 16 | requestBody: 17 | content: 18 | '*/*': 19 | schema: 20 | type: array 21 | items: 22 | $ref: '#/components/schemas/Authority' 23 | responses: 24 | 200: 25 | description: successful operation 26 | content: 27 | '*/*': 28 | schema: 29 | type: string 30 | components: 31 | schemas: 32 | Authority: 33 | type: string 34 | enum: 35 | - READ_USER 36 | - WRITE_USER 37 | - ACCES_APP 38 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.enumeration_test_6.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: TestEnumeration6Controller 10 | paths: 11 | /api/test-enum-2/{authority}: 12 | get: 13 | tags: 14 | - TestEnumeration6Controller 15 | operationId: getAuthorities 16 | parameters: 17 | - name: authority 18 | in: path 19 | required: true 20 | schema: 21 | $ref: '#/components/schemas/Authority' 22 | responses: 23 | 200: 24 | description: successful operation 25 | content: 26 | '*/*': 27 | schema: 28 | type: string 29 | components: 30 | schemas: 31 | Authority: 32 | type: string 33 | enum: 34 | - READ_USER 35 | - WRITE_USER 36 | - ACCES_APP 37 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.enumeration_test_7.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: TestEnumeration7Controller 10 | paths: 11 | /api/test-enum-7/territories: 12 | get: 13 | tags: 14 | - TestEnumeration7Controller 15 | operationId: getTerritories 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | $ref: '#/components/schemas/TerritoryEnum' 23 | components: 24 | schemas: 25 | TerritoryEnum: 26 | type: integer 27 | format: int32 28 | enum: 29 | - 1 30 | - 2 31 | x-enumNames: 32 | - FRANCE 33 | - GERMANY 34 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.extends_list.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: ExtendsList 10 | description: Some list endpoint 11 | paths: 12 | /list-extends/list: 13 | get: 14 | tags: 15 | - ExtendsList 16 | operationId: getListUUID 17 | description: Get a list of uuids 18 | responses: 19 | 200: 20 | description: uuid list 21 | content: 22 | '*/*': 23 | schema: 24 | type: array 25 | items: 26 | type: string 27 | format: uuid 28 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.extends_list2.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: ExtendsListV2 10 | paths: 11 | /extends-list-v2/: 12 | get: 13 | tags: 14 | - ExtendsListV2 15 | operationId: getList 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | type: array 23 | items: 24 | type: string 25 | format: uuid 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.generic_object_mapping.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: GenericMappingObject 10 | description: Generic map of objects in body 11 | paths: 12 | /generic-mapping/object-map: 13 | post: 14 | tags: 15 | - GenericMappingObject 16 | operationId: postObject 17 | requestBody: 18 | content: 19 | '*/*': 20 | schema: 21 | type: object 22 | additionalProperties: {} 23 | responses: 24 | 200: 25 | description: successful operation 26 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.generic_object_mapping2.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: ExtendsGenericObjectMap 10 | paths: 11 | /extends-generic-object-map/map: 12 | get: 13 | tags: 14 | - ExtendsGenericObjectMap 15 | operationId: getMap 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | type: object 23 | additionalProperties: {} 24 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.genericity_extends_class_in_parameter.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: GenericityTestSeven 10 | paths: 11 | /api/genericity-test-seven/search: 12 | post: 13 | tags: 14 | - GenericityTestSeven 15 | operationId: findTerritoireGeographiqueByCriteria 16 | requestBody: 17 | content: 18 | '*/*': 19 | schema: 20 | $ref: '#/components/schemas/SearchCriteria' 21 | responses: 22 | 200: 23 | description: successful operation 24 | content: 25 | '*/*': 26 | schema: 27 | type: string 28 | components: 29 | schemas: 30 | CriteriaDateType: 31 | type: object 32 | properties: 33 | timestamp: 34 | type: integer 35 | format: int32 36 | SearchCriteria: 37 | type: object 38 | properties: 39 | dateCriteria: 40 | $ref: '#/components/schemas/CriteriaDateType' 41 | myString: 42 | type: string 43 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.genericity_extends_class_in_parameter_v2.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: GenericityTestEight 10 | paths: 11 | /api/genericity-test-seven/search: 12 | post: 13 | tags: 14 | - GenericityTestEight 15 | operationId: findTerritoireGeographiqueByCriteria 16 | requestBody: 17 | content: 18 | '*/*': 19 | schema: 20 | $ref: '#/components/schemas/SearchCriteriaV2' 21 | responses: 22 | 200: 23 | description: successful operation 24 | content: 25 | '*/*': 26 | schema: 27 | type: string 28 | components: 29 | schemas: 30 | CriteriaDateType: 31 | type: object 32 | properties: 33 | timestamp: 34 | type: integer 35 | format: int32 36 | SearchCriteriaV2: 37 | type: object 38 | properties: 39 | dateCriteria: 40 | $ref: '#/components/schemas/CriteriaDateType' 41 | myString: 42 | type: string 43 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.genericity_list_long.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: GenericityTestFive 10 | paths: 11 | /api/genericity-test-five/update-something: 12 | post: 13 | tags: 14 | - GenericityTestFive 15 | operationId: update 16 | parameters: 17 | - name: smthId 18 | in: query 19 | required: true 20 | schema: 21 | type: integer 22 | format: int64 23 | - name: otherIds 24 | in: query 25 | required: false 26 | schema: 27 | type: array 28 | items: 29 | type: integer 30 | format: int64 31 | responses: 32 | 200: 33 | description: successful operation 34 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.issue_138.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: Issue138 10 | paths: 11 | /issue138: 12 | get: 13 | tags: 14 | - Issue138 15 | operationId: issue138 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | type: object 23 | additionalProperties: {} 24 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.issue_95.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: Issue95 10 | paths: 11 | /issue95/error: 12 | put: 13 | tags: 14 | - Issue95 15 | operationId: error 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | $ref: '#/components/schemas/ErrorDto' 23 | components: 24 | schemas: 25 | ErrorDto: 26 | description: This is the ErrorDto declaration 27 | type: object 28 | properties: 29 | foo: 30 | description: Get the foo 31 | type: object 32 | properties: 33 | unit: 34 | description: Get the unit! 35 | type: string 36 | value: 37 | description: Get the value! 38 | type: number 39 | format: double 40 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.multiple_headers_on_same_operation.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: MultipleHeadersOnSameOperation 10 | paths: 11 | /roles-controller/roles: 12 | get: 13 | tags: 14 | - MultipleHeadersOnSameOperation 15 | operationId: roles-operation-id 16 | description: This is the description. 17 | summary: This is the summary. 18 | parameters: 19 | - name: pageable 20 | in: query 21 | required: true 22 | schema: 23 | type: string 24 | - name: full 25 | in: header 26 | required: false 27 | schema: {} 28 | responses: 29 | 200: 30 | description: successful operation 31 | content: 32 | '*/*': 33 | schema: 34 | type: string 35 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.nullable_default.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: NullableController 10 | paths: 11 | /nullable/{id}: 12 | get: 13 | tags: 14 | - NullableController 15 | operationId: getById 16 | parameters: 17 | - name: id 18 | in: path 19 | required: true 20 | schema: 21 | type: integer 22 | format: int64 23 | responses: 24 | 200: 25 | description: successful operation 26 | content: 27 | '*/*': 28 | schema: 29 | $ref: '#/components/schemas/NullableDto' 30 | components: 31 | schemas: 32 | NullableDto: 33 | required: 34 | - notNullableValue 35 | type: object 36 | properties: 37 | defaultValue: 38 | type: string 39 | notNullableValue: 40 | type: string 41 | nullableValue: 42 | type: string 43 | myNotNull: 44 | type: string 45 | myNullable: 46 | type: string 47 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.package_private.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: PackagePrivateResource 10 | paths: 11 | /package-private/all-package-private-endpoint: 12 | get: 13 | tags: 14 | - PackagePrivateResource 15 | operationId: getAllPackagePrivate 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | type: array 23 | items: 24 | type: string 25 | /package-private/all-protected-endpoint: 26 | get: 27 | tags: 28 | - PackagePrivateResource 29 | operationId: getAllProtected 30 | responses: 31 | 200: 32 | description: successful operation 33 | content: 34 | '*/*': 35 | schema: 36 | type: array 37 | items: 38 | type: string 39 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.pathEnhancement.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: SpringPathEnhancementOneController 10 | paths: 11 | /api: 12 | get: 13 | tags: 14 | - SpringPathEnhancementOneController 15 | operationId: getTwo 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | type: string 23 | /api/one: 24 | get: 25 | tags: 26 | - SpringPathEnhancementOneController 27 | operationId: getOne 28 | responses: 29 | 200: 30 | description: successful operation 31 | content: 32 | '*/*': 33 | schema: 34 | type: string 35 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.recursive_dto.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: RecursiveDtoController 10 | paths: 11 | /api/recursive: 12 | get: 13 | tags: 14 | - RecursiveDtoController 15 | operationId: getRecursive 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | $ref: '#/components/schemas/RecursiveDto' 23 | components: 24 | schemas: 25 | RecursiveDto: 26 | type: object 27 | properties: 28 | name: 29 | type: string 30 | child: 31 | $ref: '#/components/schemas/RecursiveDto' 32 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.recursive_dto_in_parameter.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: RecursiveDtoInParameterController 10 | paths: 11 | /api/recursive: 12 | post: 13 | tags: 14 | - RecursiveDtoInParameterController 15 | operationId: postRecursive 16 | requestBody: 17 | content: 18 | '*/*': 19 | schema: 20 | $ref: '#/components/schemas/RecursiveDto' 21 | responses: 22 | 200: 23 | description: successful operation 24 | components: 25 | schemas: 26 | RecursiveDto: 27 | type: object 28 | properties: 29 | name: 30 | type: string 31 | child: 32 | $ref: '#/components/schemas/RecursiveDto' 33 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.stream_download.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: StreamResponseController 10 | paths: 11 | /api/stream/byte-array: 12 | get: 13 | tags: 14 | - StreamResponseController 15 | operationId: getByteArray 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | application/octet-stream: 21 | schema: 22 | type: string 23 | format: binary 24 | /api/stream/stream: 25 | get: 26 | tags: 27 | - StreamResponseController 28 | operationId: getStream 29 | responses: 30 | 200: 31 | description: successful operation 32 | content: 33 | application/octet-stream: 34 | schema: 35 | type: string 36 | format: binary 37 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.time_objects.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: TimeController 10 | paths: 11 | /api/time/get-timedto: 12 | get: 13 | tags: 14 | - TimeController 15 | operationId: getTimeDto 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | $ref: '#/components/schemas/TimeDtoV2' 23 | components: 24 | schemas: 25 | TimeDtoV2: 26 | type: object 27 | properties: 28 | instant: 29 | type: string 30 | format: date-time 31 | date: 32 | type: string 33 | format: date 34 | dateTime: 35 | type: string 36 | format: date-time 37 | time: 38 | type: string 39 | format: time 40 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.uuid.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: UuidController 10 | description: UUID based controller 11 | paths: 12 | /api/uuid/get-uuid-list: 13 | get: 14 | tags: 15 | - UuidController 16 | operationId: getUuidList 17 | description: A beautiful service 18 | parameters: 19 | - name: myUUID 20 | description: initial id 21 | in: query 22 | required: true 23 | schema: 24 | type: string 25 | format: uuid 26 | responses: 27 | 200: 28 | description: a list of ids 29 | content: 30 | '*/*': 31 | schema: 32 | type: array 33 | items: 34 | type: string 35 | format: uuid 36 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/io/github/kbuntrock/SpringClassAnalyserTest.white_list_class_method.approved.txt: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: AccountController 10 | paths: 11 | /api/account/sessions/{series}: 12 | delete: 13 | tags: 14 | - AccountController 15 | operationId: invalidateSession 16 | parameters: 17 | - name: series 18 | in: path 19 | required: true 20 | schema: 21 | type: string 22 | responses: 23 | 200: 24 | description: successful operation 25 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/JavadocParserTest/freeFields/default_error_responses.txt: -------------------------------------------------------------------------------- 1 | { 2 | "401": { 3 | "$ref": "#/components/responses/Unauthorized" 4 | }, 5 | "404": { 6 | "$ref": "#/components/responses/NotFound" 7 | } 8 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/ModelSubstitutionTest/enum_substitution/custom-model-association.yml: -------------------------------------------------------------------------------- 1 | --- 2 | equality: 3 | io.github.kbuntrock.resources.dto.Authority: CustomAuthority 4 | 5 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/ModelSubstitutionTest/enum_substitution/custom-openapi-model.yml: -------------------------------------------------------------------------------- 1 | --- 2 | CustomAuthority: 3 | description: Permissions enumeration 4 | type: string 5 | enum: 6 | - READ_CUSTOM 7 | - WRITE_CUSTOM 8 | 9 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/ModelSubstitutionTest/object_substitution/custom-model-association.yml: -------------------------------------------------------------------------------- 1 | --- 2 | equality: 3 | io.github.kbuntrock.resources.dto.AccountDto: CustomAccountDto 4 | 5 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/ModelSubstitutionTest/object_substitution/custom-openapi-model.yml: -------------------------------------------------------------------------------- 1 | --- 2 | CustomAccountDto: 3 | description: Custom version of the accountDto 4 | required: 5 | - email 6 | - token 7 | type: object 8 | properties: 9 | email: 10 | type: string 11 | format: email 12 | minLength: 5 13 | maxLength: 254 14 | token: 15 | type: number 16 | format: double 17 | activated: 18 | type: boolean 19 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/SpringClassAnalyserTest/springPathEnhancementTwo.yml: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: My Project 5 | version: 10.5.36 6 | servers: 7 | - url: "" 8 | tags: 9 | - name: SpringPathEnhancementTwoController 10 | paths: 11 | /: 12 | get: 13 | tags: 14 | - SpringPathEnhancementTwoController 15 | operationId: getTwo 16 | responses: 17 | 200: 18 | description: successful operation 19 | content: 20 | '*/*': 21 | schema: 22 | type: string 23 | /one: 24 | get: 25 | tags: 26 | - SpringPathEnhancementTwoController 27 | operationId: getOne 28 | responses: 29 | 200: 30 | description: successful operation 31 | content: 32 | '*/*': 33 | schema: 34 | type: string 35 | -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/base_file.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "title" : "This is a title", 4 | "description" : "This is a sample server.", 5 | "termsOfService" : "http://example.com/terms/", 6 | "license" : { 7 | "name" : "Apache 2.0", 8 | "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" 9 | } 10 | }, 11 | "servers" : [ { 12 | "url" : "https://development.test.com/v1", 13 | "description" : "Development server" 14 | } ], 15 | "security" : [ { 16 | "jwt" : [ ] 17 | } ], 18 | "externalDocs" : { 19 | "description" : "Find more info here", 20 | "url" : "https://example.com" 21 | }, 22 | "components" : { 23 | "securitySchemes" : { 24 | "jwt" : { 25 | "type" : "http", 26 | "scheme" : "bearer", 27 | "bearerFormat" : "JWT" 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/non_existing_contact/merged.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "title" : "This is a title", 4 | "description" : "This is a sample server.", 5 | "termsOfService" : "http://example.com/terms/", 6 | "license" : { 7 | "name" : "Apache 2.0", 8 | "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" 9 | }, 10 | "contact" : { 11 | "name" : "API Support", 12 | "url" : "http://www.example.com/support", 13 | "email" : "support@example.com" 14 | } 15 | }, 16 | "servers" : [ { 17 | "url" : "https://development.test.com/v1", 18 | "description" : "Development server" 19 | } ], 20 | "security" : [ { 21 | "jwt" : [ ] 22 | } ], 23 | "externalDocs" : { 24 | "description" : "Find more info here", 25 | "url" : "https://example.com" 26 | }, 27 | "components" : { 28 | "securitySchemes" : { 29 | "jwt" : { 30 | "type" : "http", 31 | "scheme" : "bearer", 32 | "bearerFormat" : "JWT" 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/non_existing_contact/to_merge.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "contact" : { 4 | "name" : "API Support", 5 | "url" : "http://www.example.com/support", 6 | "email" : "support@example.com" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/semi_existing_contact/base_file.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "title" : "This is a title", 4 | "description" : "This is a sample server.", 5 | "termsOfService" : "http://example.com/terms/", 6 | "contact" : { }, 7 | "license" : { 8 | "name" : "Apache 2.0", 9 | "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" 10 | } 11 | }, 12 | "servers" : [ { 13 | "url" : "https://development.test.com/v1", 14 | "description" : "Development server" 15 | } ], 16 | "security" : [ { 17 | "jwt" : [ ] 18 | } ], 19 | "externalDocs" : { 20 | "description" : "Find more info here", 21 | "url" : "https://example.com" 22 | }, 23 | "components" : { 24 | "securitySchemes" : { 25 | "jwt" : { 26 | "type" : "http", 27 | "scheme" : "bearer", 28 | "bearerFormat" : "JWT" 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/semi_existing_contact/merged.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "title" : "This is a title", 4 | "description" : "This is a sample server.", 5 | "termsOfService" : "http://example.com/terms/", 6 | "contact" : { 7 | "name" : "API Support", 8 | "url" : "http://www.example.com/support", 9 | "email" : "support@example.com" 10 | }, 11 | "license" : { 12 | "name" : "Apache 2.0", 13 | "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" 14 | } 15 | }, 16 | "servers" : [ { 17 | "url" : "https://development.test.com/v1", 18 | "description" : "Development server" 19 | } ], 20 | "security" : [ { 21 | "jwt" : [ ] 22 | } ], 23 | "externalDocs" : { 24 | "description" : "Find more info here", 25 | "url" : "https://example.com" 26 | }, 27 | "components" : { 28 | "securitySchemes" : { 29 | "jwt" : { 30 | "type" : "http", 31 | "scheme" : "bearer", 32 | "bearerFormat" : "JWT" 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/semi_existing_contact/to_merge.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "contact" : { 4 | "name" : "API Support", 5 | "url" : "http://www.example.com/support", 6 | "email" : "support@example.com" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/server_full/merged.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "title" : "This is a title", 4 | "description" : "This is a sample server.", 5 | "termsOfService" : "http://example.com/terms/", 6 | "license" : { 7 | "name" : "Apache 2.0", 8 | "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" 9 | } 10 | }, 11 | "servers" : [ { 12 | "url" : "https://other-url.test" 13 | } ], 14 | "security" : [ { 15 | "jwt" : [ ] 16 | } ], 17 | "externalDocs" : { 18 | "description" : "Find more info here", 19 | "url" : "https://example.com" 20 | }, 21 | "components" : { 22 | "securitySchemes" : { 23 | "jwt" : { 24 | "type" : "http", 25 | "scheme" : "bearer", 26 | "bearerFormat" : "JWT" 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/server_full/to_merge.json: -------------------------------------------------------------------------------- 1 | { 2 | "servers" : [ { 3 | "url" : "https://other-url.test" 4 | } ] 5 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/title/merged.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "title" : "The overriden title", 4 | "description" : "This is a sample server.", 5 | "termsOfService" : "http://example.com/terms/", 6 | "license" : { 7 | "name" : "Apache 2.0", 8 | "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" 9 | } 10 | }, 11 | "servers" : [ { 12 | "url" : "https://development.test.com/v1", 13 | "description" : "Development server" 14 | } ], 15 | "security" : [ { 16 | "jwt" : [ ] 17 | } ], 18 | "externalDocs" : { 19 | "description" : "Find more info here", 20 | "url" : "https://example.com" 21 | }, 22 | "components" : { 23 | "securitySchemes" : { 24 | "jwt" : { 25 | "type" : "http", 26 | "scheme" : "bearer", 27 | "bearerFormat" : "JWT" 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /openapi-maven-plugin/src/test/resources/ut/json/merging/title/to_merge.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "title" : "The overriden title" 4 | } 5 | } -------------------------------------------------------------------------------- /update-version-manually.sh: -------------------------------------------------------------------------------- 1 | read -p "Enter the new version number: " version 2 | exec "./update-version.sh" $version 3 | read -p "All good, press enter to close the window"; --------------------------------------------------------------------------------