From 7cb43890ed9fef66bde0e3cd0eab834286889750 Mon Sep 17 00:00:00 2001 From: Djordy Koert Date: Sat, 2 Mar 2024 17:43:52 +0100 Subject: [PATCH] Update bundle directory structure (#2228) * move autoload to 'src/' * move php source code to '/src' * move dirs from '/resources' to root * move & rename views to '/templates' * rename '/Tests' to '/tests' * update internal calls to Resources dir * style fix * fix doctrine/annotations in require * fix twig namespace not found * remove whitespaces * add 4.22.0 changelog * expand 4.21.0 changelog --- CHANGELOG.md | 19 +- composer.json | 9 +- {Resources/config => config}/api_platform.xml | 0 {Resources/config => config}/fos_rest.xml | 0 {Resources/config => config}/php_doc.xml | 0 .../config => config}/routing/swaggerui.xml | 0 {Resources/config => config}/services.xml | 0 {Resources/doc => docs}/alternative_names.rst | 0 {Resources/doc => docs}/areas.rst | 196 +-- {Resources/doc => docs}/commands.rst | 0 {Resources/doc => docs}/customization.rst | 0 {Resources/doc => docs}/faq.rst | 0 {Resources/doc => docs}/index.rst | 1202 ++++++++--------- {Resources/doc => docs}/security.rst | 0 .../doc => docs}/symfony_attributes.rst | 0 phpunit.xml.dist | 2 +- .../public => public}/init-redocly-ui.js | 0 .../public => public}/init-swagger-ui.js | 0 {Resources/public => public}/logo.png | Bin .../redocly/redoc.standalone.js | 0 {Resources/public => public}/style.css | 0 .../swagger-ui/swagger-ui-bundle.js | 0 .../swagger-ui/swagger-ui-bundle.js.map | 0 .../swagger-ui-standalone-preset.js | 0 .../swagger-ui-standalone-preset.js.map | 0 .../swagger-ui/swagger-ui.css | 0 .../swagger-ui/swagger-ui.css.map | 0 {Annotation => src/Annotation}/Areas.php | 0 {Annotation => src/Annotation}/Model.php | 0 {Annotation => src/Annotation}/Operation.php | 0 {Annotation => src/Annotation}/Security.php | 0 .../ApiDocGenerator.php | 0 {Command => src/Command}/DumpCommand.php | 0 .../Controller}/DocumentationController.php | 0 .../Controller}/SwaggerUiController.php | 0 .../YamlDocumentationController.php | 0 .../Compiler/ConfigurationPass.php | 0 .../Compiler/CustomProcessorPass.php | 0 .../Compiler/PhpDocExtractorPass.php | 0 .../Compiler/TagDescribersPass.php | 0 .../DependencyInjection}/Configuration.php | 0 .../NelmioApiDocExtension.php | 2 +- .../Describer}/ApiPlatformDescriber.php | 0 .../Describer}/DefaultDescriber.php | 0 .../Describer}/DescriberInterface.php | 0 .../Describer}/ExternalDocDescriber.php | 0 .../ModelRegistryAwareInterface.php | 0 .../Describer}/ModelRegistryAwareTrait.php | 0 .../Describer}/OpenApiPhpDescriber.php | 0 .../Describer}/RouteDescriber.php | 0 .../RenderInvalidArgumentException.php | 0 .../UndocumentedArrayItemsException.php | 0 .../Extension/DocumentationExtension.php | 0 {Model => src/Model}/Model.php | 0 {Model => src/Model}/ModelRegistry.php | 0 .../Annotations/AnnotationsReader.php | 0 .../Annotations/OpenApiAnnotationsReader.php | 0 .../Annotations/PropertyPhpDocReader.php | 0 .../SymfonyConstraintAnnotationReader.php | 0 .../UpdateClassDefinitionResult.php | 0 .../ApplyOpenApiDiscriminatorTrait.php | 0 .../BazingaHateoasModelDescriber.php | 0 .../ModelDescriber}/EnumModelDescriber.php | 0 .../FallbackObjectModelDescriber.php | 0 .../ModelDescriber}/FormModelDescriber.php | 0 .../ModelDescriber}/JMSModelDescriber.php | 0 .../ModelDescriberInterface.php | 0 .../ModelDescriber}/ObjectModelDescriber.php | 0 .../SelfDescribingModelDescriber.php | 0 .../SelfDescribingModelInterface.php | 0 .../NelmioApiDocBundle.php | 17 + .../OpenApiPhp}/ModelRegister.php | 0 {OpenApiPhp => src/OpenApiPhp}/Util.php | 0 .../Processor}/MapQueryStringProcessor.php | 0 .../Processor}/MapRequestPayloadProcessor.php | 0 .../Processor}/NullablePropertyProcessor.php | 0 .../ArrayPropertyDescriber.php | 0 .../BooleanPropertyDescriber.php | 0 .../CompoundPropertyDescriber.php | 0 .../DateTimePropertyDescriber.php | 0 .../DictionaryPropertyDescriber.php | 0 .../FloatPropertyDescriber.php | 0 .../IntegerPropertyDescriber.php | 0 .../NullablePropertyDescriber.php | 0 .../NullablePropertyTrait.php | 0 .../ObjectPropertyDescriber.php | 0 .../PropertyDescriber}/PropertyDescriber.php | 0 .../PropertyDescriberAwareInterface.php | 0 .../PropertyDescriberAwareTrait.php | 0 .../PropertyDescriberInterface.php | 0 .../RequiredPropertyDescriber.php | 0 .../StringPropertyDescriber.php | 0 {Render => src/Render}/Html/AssetsMode.php | 0 .../Render}/Html/GetNelmioAsset.php | 4 +- .../Render}/Html/HtmlOpenApiRenderer.php | 0 {Render => src/Render}/Html/Renderer.php | 0 .../Render}/Json/JsonOpenApiRenderer.php | 0 {Render => src/Render}/OpenApiRenderer.php | 0 {Render => src/Render}/RenderOpenApi.php | 0 .../Render}/Yaml/YamlOpenApiRenderer.php | 0 .../RouteDescriber}/FosRestDescriber.php | 0 .../RouteDescriber}/PhpDocDescriber.php | 0 .../RouteArgumentDescriber.php | 0 .../RouteArgumentDescriberInterface.php | 0 .../SymfonyMapQueryParameterDescriber.php | 0 .../SymfonyMapQueryStringDescriber.php | 0 .../SymfonyMapRequestPayloadDescriber.php | 0 .../RouteDescriberInterface.php | 0 .../RouteDescriber}/RouteDescriberTrait.php | 0 .../RouteMetadataDescriber.php | 0 .../FilteredRouteCollectionBuilder.php | 0 {Util => src/Util}/ControllerReflector.php | 0 {Util => src/Util}/SetsContextTrait.php | 0 .../Redocly/index.html.twig | 0 .../SwaggerUi/index.html.twig | 0 {Tests => tests}/ApiDocGeneratorTest.php | 0 {Tests => tests}/Command/DumpCommandTest.php | 0 .../DependencyInjection/ConfigurationTest.php | 0 .../NelmioApiDocExtensionTest.php | 0 .../Describer/AbstractDescriberTest.php | 0 .../Describer/ApiPlatformDescriberTest.php | 0 .../Describer/RouteDescriberTest.php | 0 .../Functional/BazingaFunctionalTest.php | 0 .../CleanUnusedComponentsProcessor.yaml | 0 .../ConfigurableContainerFactory.php | 0 .../Functional/Controller/ApiController.php | 0 .../Functional/Controller/ApiController80.php | 0 .../Functional/Controller/ApiController81.php | 0 .../Controller/BazingaController.php | 0 .../Controller/BazingaTypedController.php | 0 .../Controller/ClassApiController80.php | 0 .../Controller/ClassApiController81.php | 0 .../Functional/Controller/Controller2209.php | 0 .../Controller/FOSRestController.php | 0 .../Controller/FOSRestController80.php | 0 .../Controller/FOSRestController81.php | 0 .../Controller/InvokableController80.php | 0 .../Controller/InvokableController81.php | 0 .../Functional/Controller/JMSController.php | 0 .../Functional/Controller/JMSController80.php | 0 .../Functional/Controller/JMSController81.php | 0 .../Controller/MapQueryStringController.php | 0 .../Functional/Controller/TestController.php | 0 .../Controller/UndocumentedController.php | 0 .../Functional/ControllerTest.php | 0 .../CsrfProtectionFunctionalTest.php | 0 .../Functional/Entity/ArrayItems/Bar.php | 0 .../Entity/ArrayItems/Dictionary.php | 0 .../Functional/Entity/ArrayItems/Foo.php | 0 .../Functional/Entity/Article.php | 0 .../Functional/Entity/Article81.php | 0 .../Functional/Entity/ArticleInterface.php | 0 .../Functional/Entity/ArticleType81.php | 0 .../Entity/ArticleType81IntBacked.php | 0 .../Entity/ArticleType81NotBacked.php | 0 .../Functional/Entity/BazingaUser.php | 0 .../Functional/Entity/CompoundEntity.php | 0 .../Entity/CompoundEntityNested.php | 0 .../Functional/Entity/CustomDateTime.php | 0 {Tests => tests}/Functional/Entity/Dummy.php | 0 .../Entity/EntityThroughNameConverter.php | 0 .../EntityThroughNameConverterNested.php | 0 .../Entity/EntityWithAlternateType80.php | 0 .../Entity/EntityWithAlternateType81.php | 0 .../Entity/EntityWithFalsyDefaults.php | 0 .../Entity/EntityWithNullableSchemaSet.php | 0 .../Entity/EntityWithObjectType.php | 0 .../Functional/Entity/EntityWithRef.php | 0 .../Functional/Entity/JMSComplex80.php | 0 .../Functional/Entity/JMSComplex81.php | 0 .../Functional/Entity/JMSDualComplex.php | 0 .../Functional/Entity/JMSDualComplex80.php | 0 .../Functional/Entity/JMSDualComplex81.php | 0 .../Entity/JMSNamingStrategyConstraints.php | 0 .../Entity/JMSNamingStrategyConstraints80.php | 0 .../Entity/JMSNamingStrategyConstraints81.php | 0 .../Functional/Entity/JMSNote.php | 0 .../Functional/Entity/JMSNote80.php | 0 .../Functional/Entity/JMSNote81.php | 0 .../Functional/Entity/JMSUser.php | 0 .../Functional/Entity/JMSUser80.php | 0 .../Functional/Entity/JMSUser81.php | 0 .../Functional/Entity/NestedGroup/JMSChat.php | 0 .../Entity/NestedGroup/JMSChat80.php | 0 .../Entity/NestedGroup/JMSChat81.php | 0 .../Entity/NestedGroup/JMSChatFriend.php | 0 .../Entity/NestedGroup/JMSChatFriend80.php | 0 .../Entity/NestedGroup/JMSChatFriend81.php | 0 .../Entity/NestedGroup/JMSChatLivingRoom.php | 0 .../Entity/NestedGroup/JMSChatRoom.php | 0 .../Entity/NestedGroup/JMSChatRoom80.php | 0 .../Entity/NestedGroup/JMSChatRoom81.php | 0 .../Entity/NestedGroup/JMSChatRoomUser.php | 0 .../Entity/NestedGroup/JMSChatRoomUser80.php | 0 .../Entity/NestedGroup/JMSChatRoomUser81.php | 0 .../Entity/NestedGroup/JMSChatUser.php | 0 .../Entity/NestedGroup/JMSChatUser80.php | 0 .../Entity/NestedGroup/JMSChatUser81.php | 0 .../Entity/NestedGroup/JMSPicture.php | 0 .../Entity/NestedGroup/JMSPicture80.php | 0 .../Entity/NestedGroup/JMSPicture81.php | 0 .../Entity/PrivateProtectedExposure.php | 0 .../Entity/QueryModel/ArrayQueryModel.php | 0 .../Entity/QueryModel/FilterQueryModel.php | 0 .../QueryModel/PaginationQueryModel.php | 0 .../Functional/Entity/QueryModel/SortEnum.php | 0 .../Entity/QueryModel/SortQueryModel.php | 0 .../Entity/SymfonyConstraints80.php | 0 .../Entity/SymfonyConstraints81.php | 0 ...SymfonyConstraintsWithValidationGroups.php | 0 ...mfonyConstraintsWithValidationGroups80.php | 0 ...mfonyConstraintsWithValidationGroups81.php | 0 .../Entity/SymfonyDiscriminator80.php | 0 .../Entity/SymfonyDiscriminator81.php | 0 .../SymfonyDiscriminatorFileMapping.php | 0 .../Entity/SymfonyDiscriminatorOne.php | 0 .../Entity/SymfonyDiscriminatorTwo.php | 0 .../Entity/SymfonyMapQueryString.php | 0 {Tests => tests}/Functional/Entity/User.php | 0 .../Functional/Entity/VirtualProperty.php | 0 .../Functional/Entity/VirtualProperty80.php | 0 .../Functional/Entity/VirtualProperty81.php | 0 .../EntityExcluded/ApiPlatform2/Dummy.php | 0 .../EntityExcluded/ApiPlatform3/Dummy.php | 0 .../EntityExcluded/BazingaUserTyped.php | 0 .../EntityExcluded/SerializedNameEnt.php | 0 .../Symfony7/SerializedNameEntity.php | 0 {Tests => tests}/Functional/FOSRestTest.php | 0 .../Functional/Fixtures/Controller2209.json | 0 .../MapQueryStringCleanupComponents.json | 0 .../Fixtures/MapQueryStringController.json | 0 .../Functional/Form/DocumentType.php | 0 .../Functional/Form/DummyEmptyType.php | 0 .../Functional/Form/DummyType.php | 0 .../Functional/Form/EntityType.php | 0 .../Functional/Form/ExtendedBuiltinType.php | 0 .../Form/FormWithAlternateSchemaType.php | 0 .../FormWithCsrfProtectionDisabledType.php | 0 .../FormWithCsrfProtectionEnabledType.php | 0 .../Functional/Form/FormWithModel.php | 0 .../Functional/Form/FormWithRefType.php | 0 {Tests => tests}/Functional/Form/UserType.php | 0 .../Functional/FunctionalTest.php | 0 .../Functional/JMSFunctionalTest.php | 0 .../ModelDescriber/NameConverter.php | 0 ...ssDoesNotExistsHandlerDefinedDescriber.php | 0 {Tests => tests}/Functional/NelmioKernel.php | 0 .../Resources/routes-attributes.yaml | 0 .../Functional/Resources/routes.yaml | 0 .../Resources/serializer/discriminator.yaml | 0 .../SwaggerPHPApiComplianceTest.php | 0 {Tests => tests}/Functional/SwaggerUiTest.php | 0 .../Functional/SymfonyFunctionalTest.php | 0 {Tests => tests}/Functional/TestBundle.php | 0 {Tests => tests}/Functional/TestKernel.php | 4 +- .../ValidationGroupsFunctionalTest.php | 0 {Tests => tests}/Functional/WebTestCase.php | 0 {Tests => tests}/Helper.php | 0 {Tests => tests}/Model/ModelRegistryTest.php | 0 .../Annotations/AnnotationReaderTest.php | 0 .../Annotations/Fixture/CompoundStub.php | 0 .../Fixture/CompoundValidationRule.php | 0 .../SymfonyConstraintAnnotationReaderTest.php | 0 .../ApplyOpenApiDiscriminatorTraitTest.php | 0 .../Fixtures/SelfDescribingModel.php | 0 .../ModelDescriber/FormModelDescriberTest.php | 0 .../SelfDescribingModelDescriberTest.php | 0 .../Render/Html/GetNelmioAssetTest.php | 4 +- {Tests => tests}/Render/RenderOpenApiTest.php | 0 .../RouteDescriber/FosRestDescriberTest.php | 0 .../RouteMetadataDescriberTest.php | 0 .../FilteredRouteCollectionBuilderTest.php | 0 {Tests => tests}/SwaggerPhp/UtilTest.php | 0 .../Util/ControllerReflectorTest.php | 0 274 files changed, 744 insertions(+), 715 deletions(-) rename {Resources/config => config}/api_platform.xml (100%) rename {Resources/config => config}/fos_rest.xml (100%) rename {Resources/config => config}/php_doc.xml (100%) rename {Resources/config => config}/routing/swaggerui.xml (100%) rename {Resources/config => config}/services.xml (100%) rename {Resources/doc => docs}/alternative_names.rst (100%) rename {Resources/doc => docs}/areas.rst (94%) rename {Resources/doc => docs}/commands.rst (100%) rename {Resources/doc => docs}/customization.rst (100%) rename {Resources/doc => docs}/faq.rst (100%) rename {Resources/doc => docs}/index.rst (96%) rename {Resources/doc => docs}/security.rst (100%) rename {Resources/doc => docs}/symfony_attributes.rst (100%) rename {Resources/public => public}/init-redocly-ui.js (100%) rename {Resources/public => public}/init-swagger-ui.js (100%) rename {Resources/public => public}/logo.png (100%) rename {Resources/public => public}/redocly/redoc.standalone.js (100%) rename {Resources/public => public}/style.css (100%) rename {Resources/public => public}/swagger-ui/swagger-ui-bundle.js (100%) rename {Resources/public => public}/swagger-ui/swagger-ui-bundle.js.map (100%) rename {Resources/public => public}/swagger-ui/swagger-ui-standalone-preset.js (100%) rename {Resources/public => public}/swagger-ui/swagger-ui-standalone-preset.js.map (100%) rename {Resources/public => public}/swagger-ui/swagger-ui.css (100%) rename {Resources/public => public}/swagger-ui/swagger-ui.css.map (100%) rename {Annotation => src/Annotation}/Areas.php (100%) rename {Annotation => src/Annotation}/Model.php (100%) rename {Annotation => src/Annotation}/Operation.php (100%) rename {Annotation => src/Annotation}/Security.php (100%) rename ApiDocGenerator.php => src/ApiDocGenerator.php (100%) rename {Command => src/Command}/DumpCommand.php (100%) rename {Controller => src/Controller}/DocumentationController.php (100%) rename {Controller => src/Controller}/SwaggerUiController.php (100%) rename {Controller => src/Controller}/YamlDocumentationController.php (100%) rename {DependencyInjection => src/DependencyInjection}/Compiler/ConfigurationPass.php (100%) rename {DependencyInjection => src/DependencyInjection}/Compiler/CustomProcessorPass.php (100%) rename {DependencyInjection => src/DependencyInjection}/Compiler/PhpDocExtractorPass.php (100%) rename {DependencyInjection => src/DependencyInjection}/Compiler/TagDescribersPass.php (100%) rename {DependencyInjection => src/DependencyInjection}/Configuration.php (100%) rename {DependencyInjection => src/DependencyInjection}/NelmioApiDocExtension.php (99%) rename {Describer => src/Describer}/ApiPlatformDescriber.php (100%) rename {Describer => src/Describer}/DefaultDescriber.php (100%) rename {Describer => src/Describer}/DescriberInterface.php (100%) rename {Describer => src/Describer}/ExternalDocDescriber.php (100%) rename {Describer => src/Describer}/ModelRegistryAwareInterface.php (100%) rename {Describer => src/Describer}/ModelRegistryAwareTrait.php (100%) rename {Describer => src/Describer}/OpenApiPhpDescriber.php (100%) rename {Describer => src/Describer}/RouteDescriber.php (100%) rename {Exception => src/Exception}/RenderInvalidArgumentException.php (100%) rename {Exception => src/Exception}/UndocumentedArrayItemsException.php (100%) rename {Form => src/Form}/Extension/DocumentationExtension.php (100%) rename {Model => src/Model}/Model.php (100%) rename {Model => src/Model}/ModelRegistry.php (100%) rename {ModelDescriber => src/ModelDescriber}/Annotations/AnnotationsReader.php (100%) rename {ModelDescriber => src/ModelDescriber}/Annotations/OpenApiAnnotationsReader.php (100%) rename {ModelDescriber => src/ModelDescriber}/Annotations/PropertyPhpDocReader.php (100%) rename {ModelDescriber => src/ModelDescriber}/Annotations/SymfonyConstraintAnnotationReader.php (100%) rename {ModelDescriber => src/ModelDescriber}/Annotations/UpdateClassDefinitionResult.php (100%) rename {ModelDescriber => src/ModelDescriber}/ApplyOpenApiDiscriminatorTrait.php (100%) rename {ModelDescriber => src/ModelDescriber}/BazingaHateoasModelDescriber.php (100%) rename {ModelDescriber => src/ModelDescriber}/EnumModelDescriber.php (100%) rename {ModelDescriber => src/ModelDescriber}/FallbackObjectModelDescriber.php (100%) rename {ModelDescriber => src/ModelDescriber}/FormModelDescriber.php (100%) rename {ModelDescriber => src/ModelDescriber}/JMSModelDescriber.php (100%) rename {ModelDescriber => src/ModelDescriber}/ModelDescriberInterface.php (100%) rename {ModelDescriber => src/ModelDescriber}/ObjectModelDescriber.php (100%) rename {ModelDescriber => src/ModelDescriber}/SelfDescribingModelDescriber.php (100%) rename {ModelDescriber => src/ModelDescriber}/SelfDescribingModelInterface.php (100%) rename NelmioApiDocBundle.php => src/NelmioApiDocBundle.php (66%) rename {OpenApiPhp => src/OpenApiPhp}/ModelRegister.php (100%) rename {OpenApiPhp => src/OpenApiPhp}/Util.php (100%) rename {Processor => src/Processor}/MapQueryStringProcessor.php (100%) rename {Processor => src/Processor}/MapRequestPayloadProcessor.php (100%) rename {Processor => src/Processor}/NullablePropertyProcessor.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/ArrayPropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/BooleanPropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/CompoundPropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/DateTimePropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/DictionaryPropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/FloatPropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/IntegerPropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/NullablePropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/NullablePropertyTrait.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/ObjectPropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/PropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/PropertyDescriberAwareInterface.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/PropertyDescriberAwareTrait.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/PropertyDescriberInterface.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/RequiredPropertyDescriber.php (100%) rename {PropertyDescriber => src/PropertyDescriber}/StringPropertyDescriber.php (100%) rename {Render => src/Render}/Html/AssetsMode.php (100%) rename {Render => src/Render}/Html/GetNelmioAsset.php (96%) rename {Render => src/Render}/Html/HtmlOpenApiRenderer.php (100%) rename {Render => src/Render}/Html/Renderer.php (100%) rename {Render => src/Render}/Json/JsonOpenApiRenderer.php (100%) rename {Render => src/Render}/OpenApiRenderer.php (100%) rename {Render => src/Render}/RenderOpenApi.php (100%) rename {Render => src/Render}/Yaml/YamlOpenApiRenderer.php (100%) rename {RouteDescriber => src/RouteDescriber}/FosRestDescriber.php (100%) rename {RouteDescriber => src/RouteDescriber}/PhpDocDescriber.php (100%) rename {RouteDescriber => src/RouteDescriber}/RouteArgumentDescriber.php (100%) rename {RouteDescriber => src/RouteDescriber}/RouteArgumentDescriber/RouteArgumentDescriberInterface.php (100%) rename {RouteDescriber => src/RouteDescriber}/RouteArgumentDescriber/SymfonyMapQueryParameterDescriber.php (100%) rename {RouteDescriber => src/RouteDescriber}/RouteArgumentDescriber/SymfonyMapQueryStringDescriber.php (100%) rename {RouteDescriber => src/RouteDescriber}/RouteArgumentDescriber/SymfonyMapRequestPayloadDescriber.php (100%) rename {RouteDescriber => src/RouteDescriber}/RouteDescriberInterface.php (100%) rename {RouteDescriber => src/RouteDescriber}/RouteDescriberTrait.php (100%) rename {RouteDescriber => src/RouteDescriber}/RouteMetadataDescriber.php (100%) rename {Routing => src/Routing}/FilteredRouteCollectionBuilder.php (100%) rename {Util => src/Util}/ControllerReflector.php (100%) rename {Util => src/Util}/SetsContextTrait.php (100%) rename {Resources/views => templates}/Redocly/index.html.twig (100%) rename {Resources/views => templates}/SwaggerUi/index.html.twig (100%) rename {Tests => tests}/ApiDocGeneratorTest.php (100%) rename {Tests => tests}/Command/DumpCommandTest.php (100%) rename {Tests => tests}/DependencyInjection/ConfigurationTest.php (100%) rename {Tests => tests}/DependencyInjection/NelmioApiDocExtensionTest.php (100%) rename {Tests => tests}/Describer/AbstractDescriberTest.php (100%) rename {Tests => tests}/Describer/ApiPlatformDescriberTest.php (100%) rename {Tests => tests}/Describer/RouteDescriberTest.php (100%) rename {Tests => tests}/Functional/BazingaFunctionalTest.php (100%) rename {Tests => tests}/Functional/Configs/CleanUnusedComponentsProcessor.yaml (100%) rename {Tests => tests}/Functional/ConfigurableContainerFactory.php (100%) rename {Tests => tests}/Functional/Controller/ApiController.php (100%) rename {Tests => tests}/Functional/Controller/ApiController80.php (100%) rename {Tests => tests}/Functional/Controller/ApiController81.php (100%) rename {Tests => tests}/Functional/Controller/BazingaController.php (100%) rename {Tests => tests}/Functional/Controller/BazingaTypedController.php (100%) rename {Tests => tests}/Functional/Controller/ClassApiController80.php (100%) rename {Tests => tests}/Functional/Controller/ClassApiController81.php (100%) rename {Tests => tests}/Functional/Controller/Controller2209.php (100%) rename {Tests => tests}/Functional/Controller/FOSRestController.php (100%) rename {Tests => tests}/Functional/Controller/FOSRestController80.php (100%) rename {Tests => tests}/Functional/Controller/FOSRestController81.php (100%) rename {Tests => tests}/Functional/Controller/InvokableController80.php (100%) rename {Tests => tests}/Functional/Controller/InvokableController81.php (100%) rename {Tests => tests}/Functional/Controller/JMSController.php (100%) rename {Tests => tests}/Functional/Controller/JMSController80.php (100%) rename {Tests => tests}/Functional/Controller/JMSController81.php (100%) rename {Tests => tests}/Functional/Controller/MapQueryStringController.php (100%) rename {Tests => tests}/Functional/Controller/TestController.php (100%) rename {Tests => tests}/Functional/Controller/UndocumentedController.php (100%) rename {Tests => tests}/Functional/ControllerTest.php (100%) rename {Tests => tests}/Functional/CsrfProtectionFunctionalTest.php (100%) rename {Tests => tests}/Functional/Entity/ArrayItems/Bar.php (100%) rename {Tests => tests}/Functional/Entity/ArrayItems/Dictionary.php (100%) rename {Tests => tests}/Functional/Entity/ArrayItems/Foo.php (100%) rename {Tests => tests}/Functional/Entity/Article.php (100%) rename {Tests => tests}/Functional/Entity/Article81.php (100%) rename {Tests => tests}/Functional/Entity/ArticleInterface.php (100%) rename {Tests => tests}/Functional/Entity/ArticleType81.php (100%) rename {Tests => tests}/Functional/Entity/ArticleType81IntBacked.php (100%) rename {Tests => tests}/Functional/Entity/ArticleType81NotBacked.php (100%) rename {Tests => tests}/Functional/Entity/BazingaUser.php (100%) rename {Tests => tests}/Functional/Entity/CompoundEntity.php (100%) rename {Tests => tests}/Functional/Entity/CompoundEntityNested.php (100%) rename {Tests => tests}/Functional/Entity/CustomDateTime.php (100%) rename {Tests => tests}/Functional/Entity/Dummy.php (100%) rename {Tests => tests}/Functional/Entity/EntityThroughNameConverter.php (100%) rename {Tests => tests}/Functional/Entity/EntityThroughNameConverterNested.php (100%) rename {Tests => tests}/Functional/Entity/EntityWithAlternateType80.php (100%) rename {Tests => tests}/Functional/Entity/EntityWithAlternateType81.php (100%) rename {Tests => tests}/Functional/Entity/EntityWithFalsyDefaults.php (100%) rename {Tests => tests}/Functional/Entity/EntityWithNullableSchemaSet.php (100%) rename {Tests => tests}/Functional/Entity/EntityWithObjectType.php (100%) rename {Tests => tests}/Functional/Entity/EntityWithRef.php (100%) rename {Tests => tests}/Functional/Entity/JMSComplex80.php (100%) rename {Tests => tests}/Functional/Entity/JMSComplex81.php (100%) rename {Tests => tests}/Functional/Entity/JMSDualComplex.php (100%) rename {Tests => tests}/Functional/Entity/JMSDualComplex80.php (100%) rename {Tests => tests}/Functional/Entity/JMSDualComplex81.php (100%) rename {Tests => tests}/Functional/Entity/JMSNamingStrategyConstraints.php (100%) rename {Tests => tests}/Functional/Entity/JMSNamingStrategyConstraints80.php (100%) rename {Tests => tests}/Functional/Entity/JMSNamingStrategyConstraints81.php (100%) rename {Tests => tests}/Functional/Entity/JMSNote.php (100%) rename {Tests => tests}/Functional/Entity/JMSNote80.php (100%) rename {Tests => tests}/Functional/Entity/JMSNote81.php (100%) rename {Tests => tests}/Functional/Entity/JMSUser.php (100%) rename {Tests => tests}/Functional/Entity/JMSUser80.php (100%) rename {Tests => tests}/Functional/Entity/JMSUser81.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChat.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChat80.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChat81.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatFriend.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatFriend80.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatFriend81.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatLivingRoom.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatRoom.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatRoom80.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatRoom81.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatRoomUser.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatRoomUser80.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatRoomUser81.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatUser.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatUser80.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSChatUser81.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSPicture.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSPicture80.php (100%) rename {Tests => tests}/Functional/Entity/NestedGroup/JMSPicture81.php (100%) rename {Tests => tests}/Functional/Entity/PrivateProtectedExposure.php (100%) rename {Tests => tests}/Functional/Entity/QueryModel/ArrayQueryModel.php (100%) rename {Tests => tests}/Functional/Entity/QueryModel/FilterQueryModel.php (100%) rename {Tests => tests}/Functional/Entity/QueryModel/PaginationQueryModel.php (100%) rename {Tests => tests}/Functional/Entity/QueryModel/SortEnum.php (100%) rename {Tests => tests}/Functional/Entity/QueryModel/SortQueryModel.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyConstraints80.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyConstraints81.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyConstraintsWithValidationGroups.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyConstraintsWithValidationGroups80.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyConstraintsWithValidationGroups81.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyDiscriminator80.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyDiscriminator81.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyDiscriminatorFileMapping.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyDiscriminatorOne.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyDiscriminatorTwo.php (100%) rename {Tests => tests}/Functional/Entity/SymfonyMapQueryString.php (100%) rename {Tests => tests}/Functional/Entity/User.php (100%) rename {Tests => tests}/Functional/Entity/VirtualProperty.php (100%) rename {Tests => tests}/Functional/Entity/VirtualProperty80.php (100%) rename {Tests => tests}/Functional/Entity/VirtualProperty81.php (100%) rename {Tests => tests}/Functional/EntityExcluded/ApiPlatform2/Dummy.php (100%) rename {Tests => tests}/Functional/EntityExcluded/ApiPlatform3/Dummy.php (100%) rename {Tests => tests}/Functional/EntityExcluded/BazingaUserTyped.php (100%) rename {Tests => tests}/Functional/EntityExcluded/SerializedNameEnt.php (100%) rename {Tests => tests}/Functional/EntityExcluded/Symfony7/SerializedNameEntity.php (100%) rename {Tests => tests}/Functional/FOSRestTest.php (100%) rename {Tests => tests}/Functional/Fixtures/Controller2209.json (100%) rename {Tests => tests}/Functional/Fixtures/MapQueryStringCleanupComponents.json (100%) rename {Tests => tests}/Functional/Fixtures/MapQueryStringController.json (100%) rename {Tests => tests}/Functional/Form/DocumentType.php (100%) rename {Tests => tests}/Functional/Form/DummyEmptyType.php (100%) rename {Tests => tests}/Functional/Form/DummyType.php (100%) rename {Tests => tests}/Functional/Form/EntityType.php (100%) rename {Tests => tests}/Functional/Form/ExtendedBuiltinType.php (100%) rename {Tests => tests}/Functional/Form/FormWithAlternateSchemaType.php (100%) rename {Tests => tests}/Functional/Form/FormWithCsrfProtectionDisabledType.php (100%) rename {Tests => tests}/Functional/Form/FormWithCsrfProtectionEnabledType.php (100%) rename {Tests => tests}/Functional/Form/FormWithModel.php (100%) rename {Tests => tests}/Functional/Form/FormWithRefType.php (100%) rename {Tests => tests}/Functional/Form/UserType.php (100%) rename {Tests => tests}/Functional/FunctionalTest.php (100%) rename {Tests => tests}/Functional/JMSFunctionalTest.php (100%) rename {Tests => tests}/Functional/ModelDescriber/NameConverter.php (100%) rename {Tests => tests}/Functional/ModelDescriber/VirtualTypeClassDoesNotExistsHandlerDefinedDescriber.php (100%) rename {Tests => tests}/Functional/NelmioKernel.php (100%) rename {Tests => tests}/Functional/Resources/routes-attributes.yaml (100%) rename {Tests => tests}/Functional/Resources/routes.yaml (100%) rename {Tests => tests}/Functional/Resources/serializer/discriminator.yaml (100%) rename {Tests => tests}/Functional/SwaggerPHPApiComplianceTest.php (100%) rename {Tests => tests}/Functional/SwaggerUiTest.php (100%) rename {Tests => tests}/Functional/SymfonyFunctionalTest.php (100%) rename {Tests => tests}/Functional/TestBundle.php (100%) rename {Tests => tests}/Functional/TestKernel.php (99%) rename {Tests => tests}/Functional/ValidationGroupsFunctionalTest.php (100%) rename {Tests => tests}/Functional/WebTestCase.php (100%) rename {Tests => tests}/Helper.php (100%) rename {Tests => tests}/Model/ModelRegistryTest.php (100%) rename {Tests => tests}/ModelDescriber/Annotations/AnnotationReaderTest.php (100%) rename {Tests => tests}/ModelDescriber/Annotations/Fixture/CompoundStub.php (100%) rename {Tests => tests}/ModelDescriber/Annotations/Fixture/CompoundValidationRule.php (100%) rename {Tests => tests}/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php (100%) rename {Tests => tests}/ModelDescriber/ApplyOpenApiDiscriminatorTraitTest.php (100%) rename {Tests => tests}/ModelDescriber/Fixtures/SelfDescribingModel.php (100%) rename {Tests => tests}/ModelDescriber/FormModelDescriberTest.php (100%) rename {Tests => tests}/ModelDescriber/SelfDescribingModelDescriberTest.php (100%) rename {Tests => tests}/Render/Html/GetNelmioAssetTest.php (97%) rename {Tests => tests}/Render/RenderOpenApiTest.php (100%) rename {Tests => tests}/RouteDescriber/FosRestDescriberTest.php (100%) rename {Tests => tests}/RouteDescriber/RouteMetadataDescriberTest.php (100%) rename {Tests => tests}/Routing/FilteredRouteCollectionBuilderTest.php (100%) rename {Tests => tests}/SwaggerPhp/UtilTest.php (100%) rename {Tests => tests}/Util/ControllerReflectorTest.php (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbbc73929..3bdc49aa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,25 @@ CHANGELOG ========= -4.21.0 +4.22.0 ----- -* Added bundle configuration options `cache.pool` and `cache.item_id`. +* Updated bundle directory structure to recommended file structure as described in https://symfony.com/doc/7.0/bundles/best_practices.html. + + It might be necessary to reinstall the assets: + ```bash + bin/console assets:install + ``` +4.21.0 +----- +* Added bundle configuration options `nelmio_api_doc.cache.pool` and `nelmio_api_doc.cache.item_id`. + ```yml + nelmio_api_doc: + cache: + pool: app.cache + item_id: nelmio_api_doc.docs + ``` + 4.20.0 ----- * Added Redocly as an alternative to Swagger UI. https://github.com/Redocly/redoc. diff --git a/composer.json b/composer.json index a8082a52f..2a56288c8 100644 --- a/composer.json +++ b/composer.json @@ -73,15 +73,12 @@ }, "autoload": { "psr-4": { - "Nelmio\\ApiDocBundle\\": "" - }, - "exclude-from-classmap": [ - "Tests/" - ] + "Nelmio\\ApiDocBundle\\": "src/" + } }, "autoload-dev": { "psr-4": { - "Nelmio\\ApiDocBundle\\Tests\\": "Tests/" + "Nelmio\\ApiDocBundle\\Tests\\": "tests/" } }, "extra": { diff --git a/Resources/config/api_platform.xml b/config/api_platform.xml similarity index 100% rename from Resources/config/api_platform.xml rename to config/api_platform.xml diff --git a/Resources/config/fos_rest.xml b/config/fos_rest.xml similarity index 100% rename from Resources/config/fos_rest.xml rename to config/fos_rest.xml diff --git a/Resources/config/php_doc.xml b/config/php_doc.xml similarity index 100% rename from Resources/config/php_doc.xml rename to config/php_doc.xml diff --git a/Resources/config/routing/swaggerui.xml b/config/routing/swaggerui.xml similarity index 100% rename from Resources/config/routing/swaggerui.xml rename to config/routing/swaggerui.xml diff --git a/Resources/config/services.xml b/config/services.xml similarity index 100% rename from Resources/config/services.xml rename to config/services.xml diff --git a/Resources/doc/alternative_names.rst b/docs/alternative_names.rst similarity index 100% rename from Resources/doc/alternative_names.rst rename to docs/alternative_names.rst diff --git a/Resources/doc/areas.rst b/docs/areas.rst similarity index 94% rename from Resources/doc/areas.rst rename to docs/areas.rst index 303e4ebf6..fa2705c8f 100644 --- a/Resources/doc/areas.rst +++ b/docs/areas.rst @@ -1,98 +1,98 @@ -Areas -===== - -We've already seen that you can configure which routes are documented using ``nelmio_api_doc.areas``: - -.. code-block:: yaml - - nelmio_api_doc: - areas: - path_patterns: [ ^/api ] - host_patterns: [ ^api\. ] - name_patterns: [ ^api_v1 ] - -But in fact, this config option is way more powerful and allows you to split your documentation in several parts. - -Configuration -------------- - -You can define areas which will each generates a different documentation: - -.. code-block:: yaml - - nelmio_api_doc: - areas: - default: - path_patterns: [ ^/api ] - host_patterns: [ ^api\. ] - internal: - path_patterns: [ ^/internal ] - commercial: - path_patterns: [ ^/commercial ] - store: - # Includes routes with names containing 'store' - name_patterns: [ store ] - - -Your main documentation is under the ``default`` area. It's the one shown when accessing ``/api/doc``. - -Then update your routing to be able to access your different documentations: - -.. code-block:: yaml - - # app/config/routing.yaml - app.swagger_ui: - path: /api/doc/{area} - methods: GET - defaults: { _controller: nelmio_api_doc.controller.swagger_ui, area: default } - - # With Redocly UI - # app/config/routing.yaml - #app.redocly: - # path: /api/doc/{area} - # methods: GET - # defaults: { _controller: nelmio_api_doc.controller.redocly, area: default } - - # To expose them as JSON - #app.swagger.areas: - # path: /api/doc/{area}.json - # methods: GET - # defaults: { _controller: nelmio_api_doc.controller.swagger } - - -That's all! You can now access ``/api/doc/internal``, ``/api/doc/commercial`` and ``/api/doc/store``. - -Use annotations to filter documented routes in each area --------------------------------------------------------- - -You can use the `@Areas` annotation inside your controllers to define your routes' areas. - -First, you need to define which areas will use the`@Areas` annotations to filter -the routes that should be documented: - -.. code-block:: yaml - - nelmio_api_doc: - areas: - default: - path_patterns: [ ^/api ] - internal: - with_annotation: true - -Then add the annotation before your controller or action:: - - use Nelmio\Annotations as Nelmio; - - /** - * @Nelmio\Areas({"internal"}) => All actions in this controller are documented under the 'internal' area - */ - class MyController - { - /** - * @Nelmio\Areas({"internal"}) => This action is documented under the 'internal' area - */ - public function index() - { - ... - } - } +Areas +===== + +We've already seen that you can configure which routes are documented using ``nelmio_api_doc.areas``: + +.. code-block:: yaml + + nelmio_api_doc: + areas: + path_patterns: [ ^/api ] + host_patterns: [ ^api\. ] + name_patterns: [ ^api_v1 ] + +But in fact, this config option is way more powerful and allows you to split your documentation in several parts. + +Configuration +------------- + +You can define areas which will each generates a different documentation: + +.. code-block:: yaml + + nelmio_api_doc: + areas: + default: + path_patterns: [ ^/api ] + host_patterns: [ ^api\. ] + internal: + path_patterns: [ ^/internal ] + commercial: + path_patterns: [ ^/commercial ] + store: + # Includes routes with names containing 'store' + name_patterns: [ store ] + + +Your main documentation is under the ``default`` area. It's the one shown when accessing ``/api/doc``. + +Then update your routing to be able to access your different documentations: + +.. code-block:: yaml + + # app/config/routing.yaml + app.swagger_ui: + path: /api/doc/{area} + methods: GET + defaults: { _controller: nelmio_api_doc.controller.swagger_ui, area: default } + + # With Redocly UI + # app/config/routing.yaml + #app.redocly: + # path: /api/doc/{area} + # methods: GET + # defaults: { _controller: nelmio_api_doc.controller.redocly, area: default } + + # To expose them as JSON + #app.swagger.areas: + # path: /api/doc/{area}.json + # methods: GET + # defaults: { _controller: nelmio_api_doc.controller.swagger } + + +That's all! You can now access ``/api/doc/internal``, ``/api/doc/commercial`` and ``/api/doc/store``. + +Use annotations to filter documented routes in each area +-------------------------------------------------------- + +You can use the `@Areas` annotation inside your controllers to define your routes' areas. + +First, you need to define which areas will use the`@Areas` annotations to filter +the routes that should be documented: + +.. code-block:: yaml + + nelmio_api_doc: + areas: + default: + path_patterns: [ ^/api ] + internal: + with_annotation: true + +Then add the annotation before your controller or action:: + + use Nelmio\Annotations as Nelmio; + + /** + * @Nelmio\Areas({"internal"}) => All actions in this controller are documented under the 'internal' area + */ + class MyController + { + /** + * @Nelmio\Areas({"internal"}) => This action is documented under the 'internal' area + */ + public function index() + { + ... + } + } diff --git a/Resources/doc/commands.rst b/docs/commands.rst similarity index 100% rename from Resources/doc/commands.rst rename to docs/commands.rst diff --git a/Resources/doc/customization.rst b/docs/customization.rst similarity index 100% rename from Resources/doc/customization.rst rename to docs/customization.rst diff --git a/Resources/doc/faq.rst b/docs/faq.rst similarity index 100% rename from Resources/doc/faq.rst rename to docs/faq.rst diff --git a/Resources/doc/index.rst b/docs/index.rst similarity index 96% rename from Resources/doc/index.rst rename to docs/index.rst index 5a44cfb0f..42a1e49b0 100644 --- a/Resources/doc/index.rst +++ b/docs/index.rst @@ -1,601 +1,601 @@ -NelmioApiDocBundle -================== - -The **NelmioApiDocBundle** bundle allows you to generate documentation in the -OpenAPI (Swagger) format and provides a sandbox to interactively experiment with the API. - -What's supported? ------------------ - -This bundle supports *Symfony* route requirements, *Symfony* request mapping (:doc:`symfony_attributes`), PHP annotations, `Swagger-Php`_ annotations, -`FOSRestBundle`_ annotations and applications using `Api-Platform`_. - -.. _`Swagger-Php`: https://github.com/zircote/swagger-php -.. _`FOSRestBundle`: https://github.com/FriendsOfSymfony/FOSRestBundle -.. _`Api-Platform`: https://github.com/api-platform/api-platform - -For models, it supports the `Symfony serializer`_ , the `JMS serializer`_ and the `willdurand/Hateoas`_ library. -It does also support `Symfony form`_ types. - -Attributes are supported from version 4.7 and PHP 8.1. - -Migrate from 3.x to 4.0 ------------------------ - -`To migrate from 3.x to 4.0, follow our guide.`__ - -__ https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-4.0.md - -Installation ------------- - -Open a command console, enter your project directory and execute the following command to download the latest version of this bundle: - -.. code-block:: bash - - $ composer require nelmio/api-doc-bundle - -By default, only routes under ``/api`` are documented. Update the regexp at ``nelmio_api_doc.areas.path_patterns`` in ``config/packages/nelmio_api_doc.yaml`` to change this policy. - -.. note:: - - If you're not using Flex, then add the bundle to your kernel:: - - class AppKernel extends Kernel - { - public function registerBundles(): iterable - { - $bundles = [ - // ... - - new Nelmio\ApiDocBundle\NelmioApiDocBundle(), - ]; - - // ... - } - } - - To browse your documentation with an UI, register one of the following route: - - .. code-block:: yaml - - # config/routes.yaml - app.swagger_ui: - path: /api/doc - methods: GET - defaults: { _controller: nelmio_api_doc.controller.swagger_ui } - - .. code-block:: yaml - - # config/routes.yaml - app.redocly: - path: /api/doc - methods: GET - defaults: { _controller: nelmio_api_doc.controller.redocly } - - If you also want to expose it in JSON, register this route: - - .. code-block:: yaml - - # config/routes.yaml - app.swagger: - path: /api/doc.json - methods: GET - defaults: { _controller: nelmio_api_doc.controller.swagger } - - As you just installed the bundle, you'll likely see routes you don't want in - your documentation such as ``/_profiler/``. To fix this, you can filter the - routes that are documented by configuring the bundle: - - .. code-block:: yaml - - # config/packages/nelmio_api_doc.yaml - nelmio_api_doc: - areas: - path_patterns: # an array of regexps (document only routes under /api, except /api/doc) - - ^/api(?!/doc$) - host_patterns: # document only routes with a host of the form api.* - - ^api\. - -.. tip:: - - `Twig `_ and `Assets `_ packages are needed to use swagger ui. - -How does this bundle work? --------------------------- - -It generates an OpenAPI documentation from your Symfony app thanks to -**Describers**. One extracts data from SwaggerPHP annotations, one from your -routes, etc. - -If you configured the ``app.swagger_ui`` route above, you can browse your -documentation at `http://example.org/api/doc`. - -Using the bundle ----------------- - -You can configure global information in the bundle configuration ``documentation.info`` section (take a look at -`the OpenAPI 3.0 specification (formerly Swagger)`_ to know the available fields). - -.. code-block:: yaml - - nelmio_api_doc: - documentation: - servers: - - url: http://api.example.com/unsafe - description: API over HTTP - - url: https://api.example.com/secured - description: API over HTTPS - info: - title: My App - description: This is an awesome app! - version: 1.0.0 - components: - securitySchemes: - Bearer: - type: http - scheme: bearer - bearerFormat: JWT - security: - - Bearer: [] - -.. _`the OpenAPI 3.0 specification (formerly Swagger)`: https://swagger.io/docs/specification - -.. note:: - - If you're using Flex, this config is there by default under ``config/packages/nelmio_api_doc.yaml``. Don't forget to adapt it to your app! - -.. tip:: - - This configuration field can more generally be used to store your documentation as yaml. - You may find in the ``.yaml`` files from `SwaggerPHP examples`_. - -To document your routes, you can use the SwaggerPHP annotations and the -``Nelmio\ApiDocBundle\Annotation\Model`` annotation in your controllers:: - -.. configuration-block:: - - .. code-block:: php-annotations - - namespace AppBundle\Controller; - - use AppBundle\Entity\Reward; - use AppBundle\Entity\User; - use Nelmio\ApiDocBundle\Annotation\Model; - use Nelmio\ApiDocBundle\Annotation\Security; - use OpenApi\Annotations as OA; - use Symfony\Component\Routing\Annotation\Route; - - class UserController - { - /** - * List the rewards of the specified user. - * - * This call takes into account all confirmed awards, but not pending or refused awards. - * - * @Route("/api/{user}/rewards", methods={"GET"}) - * @OA\Response( - * response=200, - * description="Returns the rewards of an user", - * @OA\JsonContent( - * type="array", - * @OA\Items(ref=@Model(type=Reward::class, groups={"full"})) - * ) - * ) - * @OA\Parameter( - * name="order", - * in="query", - * description="The field used to order rewards", - * @OA\Schema(type="string") - * ) - * @OA\Tag(name="rewards") - * @Security(name="Bearer") - */ - public function fetchUserRewardsAction(User $user) - { - // ... - } - } - - .. code-block:: php-attributes - - namespace AppBundle\Controller; - - use AppBundle\Entity\Reward; - use AppBundle\Entity\User; - use Nelmio\ApiDocBundle\Annotation\Model; - use Nelmio\ApiDocBundle\Annotation\Security; - use OpenApi\Attributes as OA; - use Symfony\Component\Routing\Annotation\Route; - - class UserController - { - /** - * List the rewards of the specified user. - * - * This call takes into account all confirmed awards, but not pending or refused awards. - */ - #[Route('/api/{user}/rewards', methods: ['GET'])] - #[OA\Response( - response: 200, - description: 'Returns the rewards of an user', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: new Model(type: AlbumDto::class, groups: ['full'])) - ) - )] - #[OA\Parameter( - name: 'order', - in: 'query', - description: 'The field used to order rewards', - schema: new OA\Schema(type: 'string') - )] - #[OA\Tag(name: 'rewards')] - #[Security(name: 'Bearer')] - public function fetchUserRewardsAction(User $user) - { - // ... - } - } - - -The normal PHPDoc block on the controller method is used for the summary and description. - -.. tip:: - - Examples of using the annotations can be found in `SwaggerPHP examples`_. - However, unlike in those examples, when using this bundle you don't need to specify paths and you can easily document models as well as some - other properties described below as they can be automatically be documented using the Symfony integration. - -.. tip:: - - **NelmioApiDocBundle** understands **symfony's** controller attributes. - Using these attributes inside your controller allows this bundle to automatically create the necessary documentation. - More information can be found here: :doc:`symfony_attributes`. - -Use Models ----------- - -As shown in the example above, the bundle provides the ``@Model`` annotation. -Use it instead of a definition reference and the bundle will deduce your model properties. - -.. note:: - - A model can be a Symfony form type, a Doctrine ORM entity or a general PHP object. - -This annotation has two options: - -* ``type`` to specify your model's type:: - -.. configuration-block:: - - .. code-block:: php-annotations - - /** - * @OA\Response( - * response=200, - *     @Model(type=User::class) - * ) - */ - - .. code-block:: php-attributes - - #[OA\Response( - response: 200, - description: 'Successful response', - content: new Model(type: User::class) - )] - -* ``groups`` to specify the serialization groups used to (de)serialize your model:: - - -.. configuration-block:: - - .. code-block:: php-annotations - - /** - * @OA\Response( - * response=200, - *     @Model(type=User::class, groups={"non_sensitive_data"}) - * ) - */ - - .. code-block:: php-attributes - - #[OA\Response( - response: 200, - description: 'Successful response', - content: new Model(type: User::class, groups: ['non_sensitive_data']) - )] - -* ``groups`` may also be used to specify the constraint validation groups used - (de)serialize your model, but this must be enabled in configuration:: - -.. code-block:: yaml - - nelmio_api_doc: - use_validation_groups: true - # ... - -With this enabled, groups set in the model will apply to both serializer -properties and validator constraints. Take the model class below: - -.. configuration-block:: - - .. code-block:: php-annotations - - use Symfony\Component\Serializer\Annotation\Groups; - use Symfony\Component\Validator\Constraints as Assert; - - class UserDto - { - /** - * @Groups({"default", "create", "update"}) - * @Assert\NotBlank(groups={"default", "create"}) - */ - public string $username; - } - - .. code-block:: php-attributes - - use Symfony\Component\Serializer\Annotation\Groups; - use Symfony\Component\Validator\Constraints as Assert; - - class UserDto - { - #[Groups(["default", "create", "update"])] - #[Assert\NotBlank(groups: ["default", "create"])] - public string $username; - } - -The ``NotBlank`` constraint will apply only to the ``default`` and ``create`` -group, but not ``update``. In more practical terms: the `username` property -would show as ``required`` for both model create and default, but not update. -When using code generators to build API clients, this often translates into -client side validation and types. ``NotBlank`` adding ``required`` will cause -that property type to not be nullable, for example. - -.. configuration-block:: - - .. code-block:: php-annotations - - use OpenApi\Annotations as OA; - - /** - * shows `username` as `required` in the OpenAPI schema (not nullable) - * @OA\Response( - * response=200, - *     @Model(type=UserDto::class, groups={"default"}) - * ) - */ - - /** - * Similarly, this will make the username `required` in the create - * schema - * @OA\RequestBody(@Model(type=UserDto::class, groups={"create"})) - */ - - /** - * But for updates, the `username` property will not be required - * @OA\RequestBody(@Model(type=UserDto::class, groups={"update"})) - */ - - .. code-block:: php-attributes - - use OpenApi\Attributes as OA; - - // shows `username` as `required` in the OpenAPI schema (not nullable) - #[OA\Response(response: 200, content: new Model(type: UserDto::class, groups: ["default"]))] - - // Similarly, this will make the username `required` in the create schema - #[OA\RequestBody(new Model(type: UserDto::class, groups: ["create"]))] - - // But for updates, the `username` property will not be required - #[OA\RequestBody(new Model(type: UserDto::class, groups: ["update"]))] - - -.. tip:: - - When used at the root of ``@OA\Response`` and ``@OA\Parameter``, ``@Model`` is automatically nested - in a ``@OA\Schema``. - - The media type defaults to ``application/json``. - - To use ``@Model`` directly within a ``@OA\Schema``, ``@OA\Items`` or ``@OA\Property``, you have to use the ``$ref`` field:: - -.. configuration-block:: - - .. code-block:: php-annotations - - /** - * @OA\Response( - * @OA\JsonContent(ref=@Model(type=User::class)) - * ) - * - * or - * - * @OA\Response(@OA\XmlContent( - * @OA\Schema(type="object", - * @OA\Property(property="foo", ref=@Model(type=FooClass::class)) - * ) - * )) - */ - - .. code-block:: php-attributes - - #[OA\Response( - content: new OA\JsonContent(ref: new Model(type: User::class)) - )] - /** - * or - */ - #[OA\Response( - content: new OA\XmlContent(example: new OA\Schema( - type: 'object', - properties: [ - new OA\Property(property: 'foo', ref: new Model(type: FooClass::class)) - ] - )) - )] - -Symfony Form types -~~~~~~~~~~~~~~~~~~ - -You can customize the documentation of a form field using the ``documentation`` option:: - - $builder->add('username', TextType::class, [ - 'documentation' => [ - 'type' => 'string', // would have been automatically detected in this case - 'description' => 'Your username.', - ], - ]); - -See the `OpenAPI 3.0 specification`__ to see all the available fields of the ``documentation`` option (it accepts the same fields as the OpenApi ``Property`` object). - -__ https://swagger.io/specification/ - - -General PHP objects -~~~~~~~~~~~~~~~~~~~ - -.. tip:: - - **If you're not using the JMS Serializer**, the `Symfony PropertyInfo component`_ is used to describe your models. - It supports doctrine annotations, type hints, and even PHP doc blocks. - It does also support serialization groups when using the Symfony serializer. - - **If you're using the JMS Serializer**, the metadata of the JMS serializer are used by default to describe your - models. Additional information is extracted from the PHP doc block comment, - but the property types must be specified in the JMS annotations. - - NOTE: If you are using serialization contexts (e.g. Groups) each permutation will be treated as a separate Path. For example if you have the following two variations defined in different places in your code: - - .. code-block:: php - - /** - * A nested serializer property with no context group - * - * @JMS\VirtualProperty - * @JMS\Type("ArrayCollection") - * @JMS\Since("1.0") - * - * @return Collection|ItemResponse[] - */ - public function getItems(): Collection|array - { - return $this->items; - } - - - .. configuration-block:: - - .. code-block:: php-annotations - - @OA\Schema(ref=@Model(type="App\Response\ItemResponse", groups=["Default"])), - - .. code-block:: php-attributes - - #[OA\Schema(ref: new Model(type: App\Response\ItemResponse::class, groups: ['Default']))] - - It will generate two different component schemas (ItemResponse, ItemResponse2), even though Default and blank are the same. This is by design. - - In case you prefer using the `Symfony PropertyInfo component`_ (you - won't be able to use JMS serialization groups), you can disable JMS serializer - support in your config: - - .. code-block:: yaml - - nelmio_api_doc: - models: { use_jms: false } - - When using the JMS serializer combined with `willdurand/Hateoas`_ (and the `BazingaHateoasBundle`_), - HATEOAS metadata are automatically extracted - -If you want to customize the documentation of an object's property, you can use ``@OA\Property``:: - - -.. configuration-block:: - - .. code-block:: php-annotations - - use Nelmio\ApiDocBundle\Annotation\Model; - use OpenApi\Annotations as OA; - - class User - { - /** - * @var int - * @OA\Property(description="The unique identifier of the user.") - */ - public $id; - - /** - * @OA\Property(type="string", maxLength=255) - */ - public $username; - - /** - * @OA\Property(ref=@Model(type=User::class)) - */ - public $friend; - - /** - * @OA\Property(description="This is my coworker!") - */ - public setCoworker(User $coworker) { - // ... - } - } - - .. code-block:: php-attributes - - use Nelmio\ApiDocBundle\Annotation\Model; - use OpenApi\Attributes as OA; - - class User - { - /** - * @var int - */ - #[OA\Property(description: 'The unique identifier of the user.')] - public $id; - - #[OA\Property(type: 'string', maxLength: 255)] - public $username; - - #[OA\Property(ref: new Model(type: User::class))] - public $friend; - - #[OA\Property(description: 'This is my coworker!')] - public setCoworker(User $coworker) { - // ... - } - } - -See the `OpenAPI 3.0 specification`__ to see all the available fields of ``@OA\Property``. - -__ https://swagger.io/specification/ - -Learn more ----------- - -If you need more complex features, take a look at: - -.. toctree:: - :maxdepth: 1 - - areas - alternative_names - customization - commands - faq - security - symfony_attributes - -.. _`SwaggerPHP examples`: https://github.com/zircote/swagger-php/tree/master/Examples -.. _`Symfony PropertyInfo component`: https://symfony.com/doc/current/components/property_info.html -.. _`willdurand/Hateoas`: https://github.com/willdurand/Hateoas -.. _`BazingaHateoasBundle`: https://github.com/willdurand/BazingaHateoasBundle -.. _`JMS serializer`: https://jmsyst.com/libs/serializer -.. _`Symfony form`: https://symfony.com/doc/current/forms.html -.. _`Symfony serializer`: https://symfony.com/doc/current/components/serializer.html +NelmioApiDocBundle +================== + +The **NelmioApiDocBundle** bundle allows you to generate documentation in the +OpenAPI (Swagger) format and provides a sandbox to interactively experiment with the API. + +What's supported? +----------------- + +This bundle supports *Symfony* route requirements, *Symfony* request mapping (:doc:`symfony_attributes`), PHP annotations, `Swagger-Php`_ annotations, +`FOSRestBundle`_ annotations and applications using `Api-Platform`_. + +.. _`Swagger-Php`: https://github.com/zircote/swagger-php +.. _`FOSRestBundle`: https://github.com/FriendsOfSymfony/FOSRestBundle +.. _`Api-Platform`: https://github.com/api-platform/api-platform + +For models, it supports the `Symfony serializer`_ , the `JMS serializer`_ and the `willdurand/Hateoas`_ library. +It does also support `Symfony form`_ types. + +Attributes are supported from version 4.7 and PHP 8.1. + +Migrate from 3.x to 4.0 +----------------------- + +`To migrate from 3.x to 4.0, follow our guide.`__ + +__ https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-4.0.md + +Installation +------------ + +Open a command console, enter your project directory and execute the following command to download the latest version of this bundle: + +.. code-block:: bash + + $ composer require nelmio/api-doc-bundle + +By default, only routes under ``/api`` are documented. Update the regexp at ``nelmio_api_doc.areas.path_patterns`` in ``config/packages/nelmio_api_doc.yaml`` to change this policy. + +.. note:: + + If you're not using Flex, then add the bundle to your kernel:: + + class AppKernel extends Kernel + { + public function registerBundles(): iterable + { + $bundles = [ + // ... + + new Nelmio\ApiDocBundle\NelmioApiDocBundle(), + ]; + + // ... + } + } + + To browse your documentation with an UI, register one of the following route: + + .. code-block:: yaml + + # config/routes.yaml + app.swagger_ui: + path: /api/doc + methods: GET + defaults: { _controller: nelmio_api_doc.controller.swagger_ui } + + .. code-block:: yaml + + # config/routes.yaml + app.redocly: + path: /api/doc + methods: GET + defaults: { _controller: nelmio_api_doc.controller.redocly } + + If you also want to expose it in JSON, register this route: + + .. code-block:: yaml + + # config/routes.yaml + app.swagger: + path: /api/doc.json + methods: GET + defaults: { _controller: nelmio_api_doc.controller.swagger } + + As you just installed the bundle, you'll likely see routes you don't want in + your documentation such as ``/_profiler/``. To fix this, you can filter the + routes that are documented by configuring the bundle: + + .. code-block:: yaml + + # config/packages/nelmio_api_doc.yaml + nelmio_api_doc: + areas: + path_patterns: # an array of regexps (document only routes under /api, except /api/doc) + - ^/api(?!/doc$) + host_patterns: # document only routes with a host of the form api.* + - ^api\. + +.. tip:: + + `Twig `_ and `Assets `_ packages are needed to use swagger ui. + +How does this bundle work? +-------------------------- + +It generates an OpenAPI documentation from your Symfony app thanks to +**Describers**. One extracts data from SwaggerPHP annotations, one from your +routes, etc. + +If you configured the ``app.swagger_ui`` route above, you can browse your +documentation at `http://example.org/api/doc`. + +Using the bundle +---------------- + +You can configure global information in the bundle configuration ``documentation.info`` section (take a look at +`the OpenAPI 3.0 specification (formerly Swagger)`_ to know the available fields). + +.. code-block:: yaml + + nelmio_api_doc: + documentation: + servers: + - url: http://api.example.com/unsafe + description: API over HTTP + - url: https://api.example.com/secured + description: API over HTTPS + info: + title: My App + description: This is an awesome app! + version: 1.0.0 + components: + securitySchemes: + Bearer: + type: http + scheme: bearer + bearerFormat: JWT + security: + - Bearer: [] + +.. _`the OpenAPI 3.0 specification (formerly Swagger)`: https://swagger.io/docs/specification + +.. note:: + + If you're using Flex, this config is there by default under ``config/packages/nelmio_api_doc.yaml``. Don't forget to adapt it to your app! + +.. tip:: + + This configuration field can more generally be used to store your documentation as yaml. + You may find in the ``.yaml`` files from `SwaggerPHP examples`_. + +To document your routes, you can use the SwaggerPHP annotations and the +``Nelmio\ApiDocBundle\Annotation\Model`` annotation in your controllers:: + +.. configuration-block:: + + .. code-block:: php-annotations + + namespace AppBundle\Controller; + + use AppBundle\Entity\Reward; + use AppBundle\Entity\User; + use Nelmio\ApiDocBundle\Annotation\Model; + use Nelmio\ApiDocBundle\Annotation\Security; + use OpenApi\Annotations as OA; + use Symfony\Component\Routing\Annotation\Route; + + class UserController + { + /** + * List the rewards of the specified user. + * + * This call takes into account all confirmed awards, but not pending or refused awards. + * + * @Route("/api/{user}/rewards", methods={"GET"}) + * @OA\Response( + * response=200, + * description="Returns the rewards of an user", + * @OA\JsonContent( + * type="array", + * @OA\Items(ref=@Model(type=Reward::class, groups={"full"})) + * ) + * ) + * @OA\Parameter( + * name="order", + * in="query", + * description="The field used to order rewards", + * @OA\Schema(type="string") + * ) + * @OA\Tag(name="rewards") + * @Security(name="Bearer") + */ + public function fetchUserRewardsAction(User $user) + { + // ... + } + } + + .. code-block:: php-attributes + + namespace AppBundle\Controller; + + use AppBundle\Entity\Reward; + use AppBundle\Entity\User; + use Nelmio\ApiDocBundle\Annotation\Model; + use Nelmio\ApiDocBundle\Annotation\Security; + use OpenApi\Attributes as OA; + use Symfony\Component\Routing\Annotation\Route; + + class UserController + { + /** + * List the rewards of the specified user. + * + * This call takes into account all confirmed awards, but not pending or refused awards. + */ + #[Route('/api/{user}/rewards', methods: ['GET'])] + #[OA\Response( + response: 200, + description: 'Returns the rewards of an user', + content: new OA\JsonContent( + type: 'array', + items: new OA\Items(ref: new Model(type: AlbumDto::class, groups: ['full'])) + ) + )] + #[OA\Parameter( + name: 'order', + in: 'query', + description: 'The field used to order rewards', + schema: new OA\Schema(type: 'string') + )] + #[OA\Tag(name: 'rewards')] + #[Security(name: 'Bearer')] + public function fetchUserRewardsAction(User $user) + { + // ... + } + } + + +The normal PHPDoc block on the controller method is used for the summary and description. + +.. tip:: + + Examples of using the annotations can be found in `SwaggerPHP examples`_. + However, unlike in those examples, when using this bundle you don't need to specify paths and you can easily document models as well as some + other properties described below as they can be automatically be documented using the Symfony integration. + +.. tip:: + + **NelmioApiDocBundle** understands **symfony's** controller attributes. + Using these attributes inside your controller allows this bundle to automatically create the necessary documentation. + More information can be found here: :doc:`symfony_attributes`. + +Use Models +---------- + +As shown in the example above, the bundle provides the ``@Model`` annotation. +Use it instead of a definition reference and the bundle will deduce your model properties. + +.. note:: + + A model can be a Symfony form type, a Doctrine ORM entity or a general PHP object. + +This annotation has two options: + +* ``type`` to specify your model's type:: + +.. configuration-block:: + + .. code-block:: php-annotations + + /** + * @OA\Response( + * response=200, + *     @Model(type=User::class) + * ) + */ + + .. code-block:: php-attributes + + #[OA\Response( + response: 200, + description: 'Successful response', + content: new Model(type: User::class) + )] + +* ``groups`` to specify the serialization groups used to (de)serialize your model:: + + +.. configuration-block:: + + .. code-block:: php-annotations + + /** + * @OA\Response( + * response=200, + *     @Model(type=User::class, groups={"non_sensitive_data"}) + * ) + */ + + .. code-block:: php-attributes + + #[OA\Response( + response: 200, + description: 'Successful response', + content: new Model(type: User::class, groups: ['non_sensitive_data']) + )] + +* ``groups`` may also be used to specify the constraint validation groups used + (de)serialize your model, but this must be enabled in configuration:: + +.. code-block:: yaml + + nelmio_api_doc: + use_validation_groups: true + # ... + +With this enabled, groups set in the model will apply to both serializer +properties and validator constraints. Take the model class below: + +.. configuration-block:: + + .. code-block:: php-annotations + + use Symfony\Component\Serializer\Annotation\Groups; + use Symfony\Component\Validator\Constraints as Assert; + + class UserDto + { + /** + * @Groups({"default", "create", "update"}) + * @Assert\NotBlank(groups={"default", "create"}) + */ + public string $username; + } + + .. code-block:: php-attributes + + use Symfony\Component\Serializer\Annotation\Groups; + use Symfony\Component\Validator\Constraints as Assert; + + class UserDto + { + #[Groups(["default", "create", "update"])] + #[Assert\NotBlank(groups: ["default", "create"])] + public string $username; + } + +The ``NotBlank`` constraint will apply only to the ``default`` and ``create`` +group, but not ``update``. In more practical terms: the `username` property +would show as ``required`` for both model create and default, but not update. +When using code generators to build API clients, this often translates into +client side validation and types. ``NotBlank`` adding ``required`` will cause +that property type to not be nullable, for example. + +.. configuration-block:: + + .. code-block:: php-annotations + + use OpenApi\Annotations as OA; + + /** + * shows `username` as `required` in the OpenAPI schema (not nullable) + * @OA\Response( + * response=200, + *     @Model(type=UserDto::class, groups={"default"}) + * ) + */ + + /** + * Similarly, this will make the username `required` in the create + * schema + * @OA\RequestBody(@Model(type=UserDto::class, groups={"create"})) + */ + + /** + * But for updates, the `username` property will not be required + * @OA\RequestBody(@Model(type=UserDto::class, groups={"update"})) + */ + + .. code-block:: php-attributes + + use OpenApi\Attributes as OA; + + // shows `username` as `required` in the OpenAPI schema (not nullable) + #[OA\Response(response: 200, content: new Model(type: UserDto::class, groups: ["default"]))] + + // Similarly, this will make the username `required` in the create schema + #[OA\RequestBody(new Model(type: UserDto::class, groups: ["create"]))] + + // But for updates, the `username` property will not be required + #[OA\RequestBody(new Model(type: UserDto::class, groups: ["update"]))] + + +.. tip:: + + When used at the root of ``@OA\Response`` and ``@OA\Parameter``, ``@Model`` is automatically nested + in a ``@OA\Schema``. + + The media type defaults to ``application/json``. + + To use ``@Model`` directly within a ``@OA\Schema``, ``@OA\Items`` or ``@OA\Property``, you have to use the ``$ref`` field:: + +.. configuration-block:: + + .. code-block:: php-annotations + + /** + * @OA\Response( + * @OA\JsonContent(ref=@Model(type=User::class)) + * ) + * + * or + * + * @OA\Response(@OA\XmlContent( + * @OA\Schema(type="object", + * @OA\Property(property="foo", ref=@Model(type=FooClass::class)) + * ) + * )) + */ + + .. code-block:: php-attributes + + #[OA\Response( + content: new OA\JsonContent(ref: new Model(type: User::class)) + )] + /** + * or + */ + #[OA\Response( + content: new OA\XmlContent(example: new OA\Schema( + type: 'object', + properties: [ + new OA\Property(property: 'foo', ref: new Model(type: FooClass::class)) + ] + )) + )] + +Symfony Form types +~~~~~~~~~~~~~~~~~~ + +You can customize the documentation of a form field using the ``documentation`` option:: + + $builder->add('username', TextType::class, [ + 'documentation' => [ + 'type' => 'string', // would have been automatically detected in this case + 'description' => 'Your username.', + ], + ]); + +See the `OpenAPI 3.0 specification`__ to see all the available fields of the ``documentation`` option (it accepts the same fields as the OpenApi ``Property`` object). + +__ https://swagger.io/specification/ + + +General PHP objects +~~~~~~~~~~~~~~~~~~~ + +.. tip:: + + **If you're not using the JMS Serializer**, the `Symfony PropertyInfo component`_ is used to describe your models. + It supports doctrine annotations, type hints, and even PHP doc blocks. + It does also support serialization groups when using the Symfony serializer. + + **If you're using the JMS Serializer**, the metadata of the JMS serializer are used by default to describe your + models. Additional information is extracted from the PHP doc block comment, + but the property types must be specified in the JMS annotations. + + NOTE: If you are using serialization contexts (e.g. Groups) each permutation will be treated as a separate Path. For example if you have the following two variations defined in different places in your code: + + .. code-block:: php + + /** + * A nested serializer property with no context group + * + * @JMS\VirtualProperty + * @JMS\Type("ArrayCollection") + * @JMS\Since("1.0") + * + * @return Collection|ItemResponse[] + */ + public function getItems(): Collection|array + { + return $this->items; + } + + + .. configuration-block:: + + .. code-block:: php-annotations + + @OA\Schema(ref=@Model(type="App\Response\ItemResponse", groups=["Default"])), + + .. code-block:: php-attributes + + #[OA\Schema(ref: new Model(type: App\Response\ItemResponse::class, groups: ['Default']))] + + It will generate two different component schemas (ItemResponse, ItemResponse2), even though Default and blank are the same. This is by design. + + In case you prefer using the `Symfony PropertyInfo component`_ (you + won't be able to use JMS serialization groups), you can disable JMS serializer + support in your config: + + .. code-block:: yaml + + nelmio_api_doc: + models: { use_jms: false } + + When using the JMS serializer combined with `willdurand/Hateoas`_ (and the `BazingaHateoasBundle`_), + HATEOAS metadata are automatically extracted + +If you want to customize the documentation of an object's property, you can use ``@OA\Property``:: + + +.. configuration-block:: + + .. code-block:: php-annotations + + use Nelmio\ApiDocBundle\Annotation\Model; + use OpenApi\Annotations as OA; + + class User + { + /** + * @var int + * @OA\Property(description="The unique identifier of the user.") + */ + public $id; + + /** + * @OA\Property(type="string", maxLength=255) + */ + public $username; + + /** + * @OA\Property(ref=@Model(type=User::class)) + */ + public $friend; + + /** + * @OA\Property(description="This is my coworker!") + */ + public setCoworker(User $coworker) { + // ... + } + } + + .. code-block:: php-attributes + + use Nelmio\ApiDocBundle\Annotation\Model; + use OpenApi\Attributes as OA; + + class User + { + /** + * @var int + */ + #[OA\Property(description: 'The unique identifier of the user.')] + public $id; + + #[OA\Property(type: 'string', maxLength: 255)] + public $username; + + #[OA\Property(ref: new Model(type: User::class))] + public $friend; + + #[OA\Property(description: 'This is my coworker!')] + public setCoworker(User $coworker) { + // ... + } + } + +See the `OpenAPI 3.0 specification`__ to see all the available fields of ``@OA\Property``. + +__ https://swagger.io/specification/ + +Learn more +---------- + +If you need more complex features, take a look at: + +.. toctree:: + :maxdepth: 1 + + areas + alternative_names + customization + commands + faq + security + symfony_attributes + +.. _`SwaggerPHP examples`: https://github.com/zircote/swagger-php/tree/master/Examples +.. _`Symfony PropertyInfo component`: https://symfony.com/doc/current/components/property_info.html +.. _`willdurand/Hateoas`: https://github.com/willdurand/Hateoas +.. _`BazingaHateoasBundle`: https://github.com/willdurand/BazingaHateoasBundle +.. _`JMS serializer`: https://jmsyst.com/libs/serializer +.. _`Symfony form`: https://symfony.com/doc/current/forms.html +.. _`Symfony serializer`: https://symfony.com/doc/current/components/serializer.html diff --git a/Resources/doc/security.rst b/docs/security.rst similarity index 100% rename from Resources/doc/security.rst rename to docs/security.rst diff --git a/Resources/doc/symfony_attributes.rst b/docs/symfony_attributes.rst similarity index 100% rename from Resources/doc/symfony_attributes.rst rename to docs/symfony_attributes.rst diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ce7c719ae..92c783b2f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -21,7 +21,7 @@ - Tests + tests diff --git a/Resources/public/init-redocly-ui.js b/public/init-redocly-ui.js similarity index 100% rename from Resources/public/init-redocly-ui.js rename to public/init-redocly-ui.js diff --git a/Resources/public/init-swagger-ui.js b/public/init-swagger-ui.js similarity index 100% rename from Resources/public/init-swagger-ui.js rename to public/init-swagger-ui.js diff --git a/Resources/public/logo.png b/public/logo.png similarity index 100% rename from Resources/public/logo.png rename to public/logo.png diff --git a/Resources/public/redocly/redoc.standalone.js b/public/redocly/redoc.standalone.js similarity index 100% rename from Resources/public/redocly/redoc.standalone.js rename to public/redocly/redoc.standalone.js diff --git a/Resources/public/style.css b/public/style.css similarity index 100% rename from Resources/public/style.css rename to public/style.css diff --git a/Resources/public/swagger-ui/swagger-ui-bundle.js b/public/swagger-ui/swagger-ui-bundle.js similarity index 100% rename from Resources/public/swagger-ui/swagger-ui-bundle.js rename to public/swagger-ui/swagger-ui-bundle.js diff --git a/Resources/public/swagger-ui/swagger-ui-bundle.js.map b/public/swagger-ui/swagger-ui-bundle.js.map similarity index 100% rename from Resources/public/swagger-ui/swagger-ui-bundle.js.map rename to public/swagger-ui/swagger-ui-bundle.js.map diff --git a/Resources/public/swagger-ui/swagger-ui-standalone-preset.js b/public/swagger-ui/swagger-ui-standalone-preset.js similarity index 100% rename from Resources/public/swagger-ui/swagger-ui-standalone-preset.js rename to public/swagger-ui/swagger-ui-standalone-preset.js diff --git a/Resources/public/swagger-ui/swagger-ui-standalone-preset.js.map b/public/swagger-ui/swagger-ui-standalone-preset.js.map similarity index 100% rename from Resources/public/swagger-ui/swagger-ui-standalone-preset.js.map rename to public/swagger-ui/swagger-ui-standalone-preset.js.map diff --git a/Resources/public/swagger-ui/swagger-ui.css b/public/swagger-ui/swagger-ui.css similarity index 100% rename from Resources/public/swagger-ui/swagger-ui.css rename to public/swagger-ui/swagger-ui.css diff --git a/Resources/public/swagger-ui/swagger-ui.css.map b/public/swagger-ui/swagger-ui.css.map similarity index 100% rename from Resources/public/swagger-ui/swagger-ui.css.map rename to public/swagger-ui/swagger-ui.css.map diff --git a/Annotation/Areas.php b/src/Annotation/Areas.php similarity index 100% rename from Annotation/Areas.php rename to src/Annotation/Areas.php diff --git a/Annotation/Model.php b/src/Annotation/Model.php similarity index 100% rename from Annotation/Model.php rename to src/Annotation/Model.php diff --git a/Annotation/Operation.php b/src/Annotation/Operation.php similarity index 100% rename from Annotation/Operation.php rename to src/Annotation/Operation.php diff --git a/Annotation/Security.php b/src/Annotation/Security.php similarity index 100% rename from Annotation/Security.php rename to src/Annotation/Security.php diff --git a/ApiDocGenerator.php b/src/ApiDocGenerator.php similarity index 100% rename from ApiDocGenerator.php rename to src/ApiDocGenerator.php diff --git a/Command/DumpCommand.php b/src/Command/DumpCommand.php similarity index 100% rename from Command/DumpCommand.php rename to src/Command/DumpCommand.php diff --git a/Controller/DocumentationController.php b/src/Controller/DocumentationController.php similarity index 100% rename from Controller/DocumentationController.php rename to src/Controller/DocumentationController.php diff --git a/Controller/SwaggerUiController.php b/src/Controller/SwaggerUiController.php similarity index 100% rename from Controller/SwaggerUiController.php rename to src/Controller/SwaggerUiController.php diff --git a/Controller/YamlDocumentationController.php b/src/Controller/YamlDocumentationController.php similarity index 100% rename from Controller/YamlDocumentationController.php rename to src/Controller/YamlDocumentationController.php diff --git a/DependencyInjection/Compiler/ConfigurationPass.php b/src/DependencyInjection/Compiler/ConfigurationPass.php similarity index 100% rename from DependencyInjection/Compiler/ConfigurationPass.php rename to src/DependencyInjection/Compiler/ConfigurationPass.php diff --git a/DependencyInjection/Compiler/CustomProcessorPass.php b/src/DependencyInjection/Compiler/CustomProcessorPass.php similarity index 100% rename from DependencyInjection/Compiler/CustomProcessorPass.php rename to src/DependencyInjection/Compiler/CustomProcessorPass.php diff --git a/DependencyInjection/Compiler/PhpDocExtractorPass.php b/src/DependencyInjection/Compiler/PhpDocExtractorPass.php similarity index 100% rename from DependencyInjection/Compiler/PhpDocExtractorPass.php rename to src/DependencyInjection/Compiler/PhpDocExtractorPass.php diff --git a/DependencyInjection/Compiler/TagDescribersPass.php b/src/DependencyInjection/Compiler/TagDescribersPass.php similarity index 100% rename from DependencyInjection/Compiler/TagDescribersPass.php rename to src/DependencyInjection/Compiler/TagDescribersPass.php diff --git a/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php similarity index 100% rename from DependencyInjection/Configuration.php rename to src/DependencyInjection/Configuration.php diff --git a/DependencyInjection/NelmioApiDocExtension.php b/src/DependencyInjection/NelmioApiDocExtension.php similarity index 99% rename from DependencyInjection/NelmioApiDocExtension.php rename to src/DependencyInjection/NelmioApiDocExtension.php index 1afcf65c8..2cfb23f22 100644 --- a/DependencyInjection/NelmioApiDocExtension.php +++ b/src/DependencyInjection/NelmioApiDocExtension.php @@ -68,7 +68,7 @@ public function prepend(ContainerBuilder $container): void public function load(array $configs, ContainerBuilder $container): void { $config = $this->processConfiguration(new Configuration(), $configs); - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../config')); $loader->load('services.xml'); diff --git a/Describer/ApiPlatformDescriber.php b/src/Describer/ApiPlatformDescriber.php similarity index 100% rename from Describer/ApiPlatformDescriber.php rename to src/Describer/ApiPlatformDescriber.php diff --git a/Describer/DefaultDescriber.php b/src/Describer/DefaultDescriber.php similarity index 100% rename from Describer/DefaultDescriber.php rename to src/Describer/DefaultDescriber.php diff --git a/Describer/DescriberInterface.php b/src/Describer/DescriberInterface.php similarity index 100% rename from Describer/DescriberInterface.php rename to src/Describer/DescriberInterface.php diff --git a/Describer/ExternalDocDescriber.php b/src/Describer/ExternalDocDescriber.php similarity index 100% rename from Describer/ExternalDocDescriber.php rename to src/Describer/ExternalDocDescriber.php diff --git a/Describer/ModelRegistryAwareInterface.php b/src/Describer/ModelRegistryAwareInterface.php similarity index 100% rename from Describer/ModelRegistryAwareInterface.php rename to src/Describer/ModelRegistryAwareInterface.php diff --git a/Describer/ModelRegistryAwareTrait.php b/src/Describer/ModelRegistryAwareTrait.php similarity index 100% rename from Describer/ModelRegistryAwareTrait.php rename to src/Describer/ModelRegistryAwareTrait.php diff --git a/Describer/OpenApiPhpDescriber.php b/src/Describer/OpenApiPhpDescriber.php similarity index 100% rename from Describer/OpenApiPhpDescriber.php rename to src/Describer/OpenApiPhpDescriber.php diff --git a/Describer/RouteDescriber.php b/src/Describer/RouteDescriber.php similarity index 100% rename from Describer/RouteDescriber.php rename to src/Describer/RouteDescriber.php diff --git a/Exception/RenderInvalidArgumentException.php b/src/Exception/RenderInvalidArgumentException.php similarity index 100% rename from Exception/RenderInvalidArgumentException.php rename to src/Exception/RenderInvalidArgumentException.php diff --git a/Exception/UndocumentedArrayItemsException.php b/src/Exception/UndocumentedArrayItemsException.php similarity index 100% rename from Exception/UndocumentedArrayItemsException.php rename to src/Exception/UndocumentedArrayItemsException.php diff --git a/Form/Extension/DocumentationExtension.php b/src/Form/Extension/DocumentationExtension.php similarity index 100% rename from Form/Extension/DocumentationExtension.php rename to src/Form/Extension/DocumentationExtension.php diff --git a/Model/Model.php b/src/Model/Model.php similarity index 100% rename from Model/Model.php rename to src/Model/Model.php diff --git a/Model/ModelRegistry.php b/src/Model/ModelRegistry.php similarity index 100% rename from Model/ModelRegistry.php rename to src/Model/ModelRegistry.php diff --git a/ModelDescriber/Annotations/AnnotationsReader.php b/src/ModelDescriber/Annotations/AnnotationsReader.php similarity index 100% rename from ModelDescriber/Annotations/AnnotationsReader.php rename to src/ModelDescriber/Annotations/AnnotationsReader.php diff --git a/ModelDescriber/Annotations/OpenApiAnnotationsReader.php b/src/ModelDescriber/Annotations/OpenApiAnnotationsReader.php similarity index 100% rename from ModelDescriber/Annotations/OpenApiAnnotationsReader.php rename to src/ModelDescriber/Annotations/OpenApiAnnotationsReader.php diff --git a/ModelDescriber/Annotations/PropertyPhpDocReader.php b/src/ModelDescriber/Annotations/PropertyPhpDocReader.php similarity index 100% rename from ModelDescriber/Annotations/PropertyPhpDocReader.php rename to src/ModelDescriber/Annotations/PropertyPhpDocReader.php diff --git a/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php b/src/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php similarity index 100% rename from ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php rename to src/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php diff --git a/ModelDescriber/Annotations/UpdateClassDefinitionResult.php b/src/ModelDescriber/Annotations/UpdateClassDefinitionResult.php similarity index 100% rename from ModelDescriber/Annotations/UpdateClassDefinitionResult.php rename to src/ModelDescriber/Annotations/UpdateClassDefinitionResult.php diff --git a/ModelDescriber/ApplyOpenApiDiscriminatorTrait.php b/src/ModelDescriber/ApplyOpenApiDiscriminatorTrait.php similarity index 100% rename from ModelDescriber/ApplyOpenApiDiscriminatorTrait.php rename to src/ModelDescriber/ApplyOpenApiDiscriminatorTrait.php diff --git a/ModelDescriber/BazingaHateoasModelDescriber.php b/src/ModelDescriber/BazingaHateoasModelDescriber.php similarity index 100% rename from ModelDescriber/BazingaHateoasModelDescriber.php rename to src/ModelDescriber/BazingaHateoasModelDescriber.php diff --git a/ModelDescriber/EnumModelDescriber.php b/src/ModelDescriber/EnumModelDescriber.php similarity index 100% rename from ModelDescriber/EnumModelDescriber.php rename to src/ModelDescriber/EnumModelDescriber.php diff --git a/ModelDescriber/FallbackObjectModelDescriber.php b/src/ModelDescriber/FallbackObjectModelDescriber.php similarity index 100% rename from ModelDescriber/FallbackObjectModelDescriber.php rename to src/ModelDescriber/FallbackObjectModelDescriber.php diff --git a/ModelDescriber/FormModelDescriber.php b/src/ModelDescriber/FormModelDescriber.php similarity index 100% rename from ModelDescriber/FormModelDescriber.php rename to src/ModelDescriber/FormModelDescriber.php diff --git a/ModelDescriber/JMSModelDescriber.php b/src/ModelDescriber/JMSModelDescriber.php similarity index 100% rename from ModelDescriber/JMSModelDescriber.php rename to src/ModelDescriber/JMSModelDescriber.php diff --git a/ModelDescriber/ModelDescriberInterface.php b/src/ModelDescriber/ModelDescriberInterface.php similarity index 100% rename from ModelDescriber/ModelDescriberInterface.php rename to src/ModelDescriber/ModelDescriberInterface.php diff --git a/ModelDescriber/ObjectModelDescriber.php b/src/ModelDescriber/ObjectModelDescriber.php similarity index 100% rename from ModelDescriber/ObjectModelDescriber.php rename to src/ModelDescriber/ObjectModelDescriber.php diff --git a/ModelDescriber/SelfDescribingModelDescriber.php b/src/ModelDescriber/SelfDescribingModelDescriber.php similarity index 100% rename from ModelDescriber/SelfDescribingModelDescriber.php rename to src/ModelDescriber/SelfDescribingModelDescriber.php diff --git a/ModelDescriber/SelfDescribingModelInterface.php b/src/ModelDescriber/SelfDescribingModelInterface.php similarity index 100% rename from ModelDescriber/SelfDescribingModelInterface.php rename to src/ModelDescriber/SelfDescribingModelInterface.php diff --git a/NelmioApiDocBundle.php b/src/NelmioApiDocBundle.php similarity index 66% rename from NelmioApiDocBundle.php rename to src/NelmioApiDocBundle.php index fad44e2c6..f5d040308 100644 --- a/NelmioApiDocBundle.php +++ b/src/NelmioApiDocBundle.php @@ -30,4 +30,21 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new PhpDocExtractorPass()); $container->addCompilerPass(new CustomProcessorPass()); } + + /** + * Allows using the new directory structure on Symfony < 6.1. + * Without this no proper namespace is set for twig templates. + * + * @see \Symfony\Component\HttpKernel\Bundle\AbstractBundle::getPath() + */ + public function getPath(): string + { + if (!isset($this->path)) { + $reflected = new \ReflectionObject($this); + // assume the modern directory structure by default + $this->path = \dirname($reflected->getFileName(), 2); + } + + return $this->path; + } } diff --git a/OpenApiPhp/ModelRegister.php b/src/OpenApiPhp/ModelRegister.php similarity index 100% rename from OpenApiPhp/ModelRegister.php rename to src/OpenApiPhp/ModelRegister.php diff --git a/OpenApiPhp/Util.php b/src/OpenApiPhp/Util.php similarity index 100% rename from OpenApiPhp/Util.php rename to src/OpenApiPhp/Util.php diff --git a/Processor/MapQueryStringProcessor.php b/src/Processor/MapQueryStringProcessor.php similarity index 100% rename from Processor/MapQueryStringProcessor.php rename to src/Processor/MapQueryStringProcessor.php diff --git a/Processor/MapRequestPayloadProcessor.php b/src/Processor/MapRequestPayloadProcessor.php similarity index 100% rename from Processor/MapRequestPayloadProcessor.php rename to src/Processor/MapRequestPayloadProcessor.php diff --git a/Processor/NullablePropertyProcessor.php b/src/Processor/NullablePropertyProcessor.php similarity index 100% rename from Processor/NullablePropertyProcessor.php rename to src/Processor/NullablePropertyProcessor.php diff --git a/PropertyDescriber/ArrayPropertyDescriber.php b/src/PropertyDescriber/ArrayPropertyDescriber.php similarity index 100% rename from PropertyDescriber/ArrayPropertyDescriber.php rename to src/PropertyDescriber/ArrayPropertyDescriber.php diff --git a/PropertyDescriber/BooleanPropertyDescriber.php b/src/PropertyDescriber/BooleanPropertyDescriber.php similarity index 100% rename from PropertyDescriber/BooleanPropertyDescriber.php rename to src/PropertyDescriber/BooleanPropertyDescriber.php diff --git a/PropertyDescriber/CompoundPropertyDescriber.php b/src/PropertyDescriber/CompoundPropertyDescriber.php similarity index 100% rename from PropertyDescriber/CompoundPropertyDescriber.php rename to src/PropertyDescriber/CompoundPropertyDescriber.php diff --git a/PropertyDescriber/DateTimePropertyDescriber.php b/src/PropertyDescriber/DateTimePropertyDescriber.php similarity index 100% rename from PropertyDescriber/DateTimePropertyDescriber.php rename to src/PropertyDescriber/DateTimePropertyDescriber.php diff --git a/PropertyDescriber/DictionaryPropertyDescriber.php b/src/PropertyDescriber/DictionaryPropertyDescriber.php similarity index 100% rename from PropertyDescriber/DictionaryPropertyDescriber.php rename to src/PropertyDescriber/DictionaryPropertyDescriber.php diff --git a/PropertyDescriber/FloatPropertyDescriber.php b/src/PropertyDescriber/FloatPropertyDescriber.php similarity index 100% rename from PropertyDescriber/FloatPropertyDescriber.php rename to src/PropertyDescriber/FloatPropertyDescriber.php diff --git a/PropertyDescriber/IntegerPropertyDescriber.php b/src/PropertyDescriber/IntegerPropertyDescriber.php similarity index 100% rename from PropertyDescriber/IntegerPropertyDescriber.php rename to src/PropertyDescriber/IntegerPropertyDescriber.php diff --git a/PropertyDescriber/NullablePropertyDescriber.php b/src/PropertyDescriber/NullablePropertyDescriber.php similarity index 100% rename from PropertyDescriber/NullablePropertyDescriber.php rename to src/PropertyDescriber/NullablePropertyDescriber.php diff --git a/PropertyDescriber/NullablePropertyTrait.php b/src/PropertyDescriber/NullablePropertyTrait.php similarity index 100% rename from PropertyDescriber/NullablePropertyTrait.php rename to src/PropertyDescriber/NullablePropertyTrait.php diff --git a/PropertyDescriber/ObjectPropertyDescriber.php b/src/PropertyDescriber/ObjectPropertyDescriber.php similarity index 100% rename from PropertyDescriber/ObjectPropertyDescriber.php rename to src/PropertyDescriber/ObjectPropertyDescriber.php diff --git a/PropertyDescriber/PropertyDescriber.php b/src/PropertyDescriber/PropertyDescriber.php similarity index 100% rename from PropertyDescriber/PropertyDescriber.php rename to src/PropertyDescriber/PropertyDescriber.php diff --git a/PropertyDescriber/PropertyDescriberAwareInterface.php b/src/PropertyDescriber/PropertyDescriberAwareInterface.php similarity index 100% rename from PropertyDescriber/PropertyDescriberAwareInterface.php rename to src/PropertyDescriber/PropertyDescriberAwareInterface.php diff --git a/PropertyDescriber/PropertyDescriberAwareTrait.php b/src/PropertyDescriber/PropertyDescriberAwareTrait.php similarity index 100% rename from PropertyDescriber/PropertyDescriberAwareTrait.php rename to src/PropertyDescriber/PropertyDescriberAwareTrait.php diff --git a/PropertyDescriber/PropertyDescriberInterface.php b/src/PropertyDescriber/PropertyDescriberInterface.php similarity index 100% rename from PropertyDescriber/PropertyDescriberInterface.php rename to src/PropertyDescriber/PropertyDescriberInterface.php diff --git a/PropertyDescriber/RequiredPropertyDescriber.php b/src/PropertyDescriber/RequiredPropertyDescriber.php similarity index 100% rename from PropertyDescriber/RequiredPropertyDescriber.php rename to src/PropertyDescriber/RequiredPropertyDescriber.php diff --git a/PropertyDescriber/StringPropertyDescriber.php b/src/PropertyDescriber/StringPropertyDescriber.php similarity index 100% rename from PropertyDescriber/StringPropertyDescriber.php rename to src/PropertyDescriber/StringPropertyDescriber.php diff --git a/Render/Html/AssetsMode.php b/src/Render/Html/AssetsMode.php similarity index 100% rename from Render/Html/AssetsMode.php rename to src/Render/Html/AssetsMode.php diff --git a/Render/Html/GetNelmioAsset.php b/src/Render/Html/GetNelmioAsset.php similarity index 96% rename from Render/Html/GetNelmioAsset.php rename to src/Render/Html/GetNelmioAsset.php index 0ec88f9d8..0eada281e 100644 --- a/Render/Html/GetNelmioAsset.php +++ b/src/Render/Html/GetNelmioAsset.php @@ -27,8 +27,8 @@ class GetNelmioAsset extends AbstractExtension public function __construct(AssetExtension $assetExtension) { $this->assetExtension = $assetExtension; - $this->cdnUrl = 'https://cdn.jsdelivr.net/gh/nelmio/NelmioApiDocBundle/Resources/public'; - $this->resourcesDir = __DIR__.'/../../Resources/public'; + $this->cdnUrl = 'https://cdn.jsdelivr.net/gh/nelmio/NelmioApiDocBundle/public'; + $this->resourcesDir = __DIR__.'/../../../public'; } public function getFunctions(): array diff --git a/Render/Html/HtmlOpenApiRenderer.php b/src/Render/Html/HtmlOpenApiRenderer.php similarity index 100% rename from Render/Html/HtmlOpenApiRenderer.php rename to src/Render/Html/HtmlOpenApiRenderer.php diff --git a/Render/Html/Renderer.php b/src/Render/Html/Renderer.php similarity index 100% rename from Render/Html/Renderer.php rename to src/Render/Html/Renderer.php diff --git a/Render/Json/JsonOpenApiRenderer.php b/src/Render/Json/JsonOpenApiRenderer.php similarity index 100% rename from Render/Json/JsonOpenApiRenderer.php rename to src/Render/Json/JsonOpenApiRenderer.php diff --git a/Render/OpenApiRenderer.php b/src/Render/OpenApiRenderer.php similarity index 100% rename from Render/OpenApiRenderer.php rename to src/Render/OpenApiRenderer.php diff --git a/Render/RenderOpenApi.php b/src/Render/RenderOpenApi.php similarity index 100% rename from Render/RenderOpenApi.php rename to src/Render/RenderOpenApi.php diff --git a/Render/Yaml/YamlOpenApiRenderer.php b/src/Render/Yaml/YamlOpenApiRenderer.php similarity index 100% rename from Render/Yaml/YamlOpenApiRenderer.php rename to src/Render/Yaml/YamlOpenApiRenderer.php diff --git a/RouteDescriber/FosRestDescriber.php b/src/RouteDescriber/FosRestDescriber.php similarity index 100% rename from RouteDescriber/FosRestDescriber.php rename to src/RouteDescriber/FosRestDescriber.php diff --git a/RouteDescriber/PhpDocDescriber.php b/src/RouteDescriber/PhpDocDescriber.php similarity index 100% rename from RouteDescriber/PhpDocDescriber.php rename to src/RouteDescriber/PhpDocDescriber.php diff --git a/RouteDescriber/RouteArgumentDescriber.php b/src/RouteDescriber/RouteArgumentDescriber.php similarity index 100% rename from RouteDescriber/RouteArgumentDescriber.php rename to src/RouteDescriber/RouteArgumentDescriber.php diff --git a/RouteDescriber/RouteArgumentDescriber/RouteArgumentDescriberInterface.php b/src/RouteDescriber/RouteArgumentDescriber/RouteArgumentDescriberInterface.php similarity index 100% rename from RouteDescriber/RouteArgumentDescriber/RouteArgumentDescriberInterface.php rename to src/RouteDescriber/RouteArgumentDescriber/RouteArgumentDescriberInterface.php diff --git a/RouteDescriber/RouteArgumentDescriber/SymfonyMapQueryParameterDescriber.php b/src/RouteDescriber/RouteArgumentDescriber/SymfonyMapQueryParameterDescriber.php similarity index 100% rename from RouteDescriber/RouteArgumentDescriber/SymfonyMapQueryParameterDescriber.php rename to src/RouteDescriber/RouteArgumentDescriber/SymfonyMapQueryParameterDescriber.php diff --git a/RouteDescriber/RouteArgumentDescriber/SymfonyMapQueryStringDescriber.php b/src/RouteDescriber/RouteArgumentDescriber/SymfonyMapQueryStringDescriber.php similarity index 100% rename from RouteDescriber/RouteArgumentDescriber/SymfonyMapQueryStringDescriber.php rename to src/RouteDescriber/RouteArgumentDescriber/SymfonyMapQueryStringDescriber.php diff --git a/RouteDescriber/RouteArgumentDescriber/SymfonyMapRequestPayloadDescriber.php b/src/RouteDescriber/RouteArgumentDescriber/SymfonyMapRequestPayloadDescriber.php similarity index 100% rename from RouteDescriber/RouteArgumentDescriber/SymfonyMapRequestPayloadDescriber.php rename to src/RouteDescriber/RouteArgumentDescriber/SymfonyMapRequestPayloadDescriber.php diff --git a/RouteDescriber/RouteDescriberInterface.php b/src/RouteDescriber/RouteDescriberInterface.php similarity index 100% rename from RouteDescriber/RouteDescriberInterface.php rename to src/RouteDescriber/RouteDescriberInterface.php diff --git a/RouteDescriber/RouteDescriberTrait.php b/src/RouteDescriber/RouteDescriberTrait.php similarity index 100% rename from RouteDescriber/RouteDescriberTrait.php rename to src/RouteDescriber/RouteDescriberTrait.php diff --git a/RouteDescriber/RouteMetadataDescriber.php b/src/RouteDescriber/RouteMetadataDescriber.php similarity index 100% rename from RouteDescriber/RouteMetadataDescriber.php rename to src/RouteDescriber/RouteMetadataDescriber.php diff --git a/Routing/FilteredRouteCollectionBuilder.php b/src/Routing/FilteredRouteCollectionBuilder.php similarity index 100% rename from Routing/FilteredRouteCollectionBuilder.php rename to src/Routing/FilteredRouteCollectionBuilder.php diff --git a/Util/ControllerReflector.php b/src/Util/ControllerReflector.php similarity index 100% rename from Util/ControllerReflector.php rename to src/Util/ControllerReflector.php diff --git a/Util/SetsContextTrait.php b/src/Util/SetsContextTrait.php similarity index 100% rename from Util/SetsContextTrait.php rename to src/Util/SetsContextTrait.php diff --git a/Resources/views/Redocly/index.html.twig b/templates/Redocly/index.html.twig similarity index 100% rename from Resources/views/Redocly/index.html.twig rename to templates/Redocly/index.html.twig diff --git a/Resources/views/SwaggerUi/index.html.twig b/templates/SwaggerUi/index.html.twig similarity index 100% rename from Resources/views/SwaggerUi/index.html.twig rename to templates/SwaggerUi/index.html.twig diff --git a/Tests/ApiDocGeneratorTest.php b/tests/ApiDocGeneratorTest.php similarity index 100% rename from Tests/ApiDocGeneratorTest.php rename to tests/ApiDocGeneratorTest.php diff --git a/Tests/Command/DumpCommandTest.php b/tests/Command/DumpCommandTest.php similarity index 100% rename from Tests/Command/DumpCommandTest.php rename to tests/Command/DumpCommandTest.php diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/tests/DependencyInjection/ConfigurationTest.php similarity index 100% rename from Tests/DependencyInjection/ConfigurationTest.php rename to tests/DependencyInjection/ConfigurationTest.php diff --git a/Tests/DependencyInjection/NelmioApiDocExtensionTest.php b/tests/DependencyInjection/NelmioApiDocExtensionTest.php similarity index 100% rename from Tests/DependencyInjection/NelmioApiDocExtensionTest.php rename to tests/DependencyInjection/NelmioApiDocExtensionTest.php diff --git a/Tests/Describer/AbstractDescriberTest.php b/tests/Describer/AbstractDescriberTest.php similarity index 100% rename from Tests/Describer/AbstractDescriberTest.php rename to tests/Describer/AbstractDescriberTest.php diff --git a/Tests/Describer/ApiPlatformDescriberTest.php b/tests/Describer/ApiPlatformDescriberTest.php similarity index 100% rename from Tests/Describer/ApiPlatformDescriberTest.php rename to tests/Describer/ApiPlatformDescriberTest.php diff --git a/Tests/Describer/RouteDescriberTest.php b/tests/Describer/RouteDescriberTest.php similarity index 100% rename from Tests/Describer/RouteDescriberTest.php rename to tests/Describer/RouteDescriberTest.php diff --git a/Tests/Functional/BazingaFunctionalTest.php b/tests/Functional/BazingaFunctionalTest.php similarity index 100% rename from Tests/Functional/BazingaFunctionalTest.php rename to tests/Functional/BazingaFunctionalTest.php diff --git a/Tests/Functional/Configs/CleanUnusedComponentsProcessor.yaml b/tests/Functional/Configs/CleanUnusedComponentsProcessor.yaml similarity index 100% rename from Tests/Functional/Configs/CleanUnusedComponentsProcessor.yaml rename to tests/Functional/Configs/CleanUnusedComponentsProcessor.yaml diff --git a/Tests/Functional/ConfigurableContainerFactory.php b/tests/Functional/ConfigurableContainerFactory.php similarity index 100% rename from Tests/Functional/ConfigurableContainerFactory.php rename to tests/Functional/ConfigurableContainerFactory.php diff --git a/Tests/Functional/Controller/ApiController.php b/tests/Functional/Controller/ApiController.php similarity index 100% rename from Tests/Functional/Controller/ApiController.php rename to tests/Functional/Controller/ApiController.php diff --git a/Tests/Functional/Controller/ApiController80.php b/tests/Functional/Controller/ApiController80.php similarity index 100% rename from Tests/Functional/Controller/ApiController80.php rename to tests/Functional/Controller/ApiController80.php diff --git a/Tests/Functional/Controller/ApiController81.php b/tests/Functional/Controller/ApiController81.php similarity index 100% rename from Tests/Functional/Controller/ApiController81.php rename to tests/Functional/Controller/ApiController81.php diff --git a/Tests/Functional/Controller/BazingaController.php b/tests/Functional/Controller/BazingaController.php similarity index 100% rename from Tests/Functional/Controller/BazingaController.php rename to tests/Functional/Controller/BazingaController.php diff --git a/Tests/Functional/Controller/BazingaTypedController.php b/tests/Functional/Controller/BazingaTypedController.php similarity index 100% rename from Tests/Functional/Controller/BazingaTypedController.php rename to tests/Functional/Controller/BazingaTypedController.php diff --git a/Tests/Functional/Controller/ClassApiController80.php b/tests/Functional/Controller/ClassApiController80.php similarity index 100% rename from Tests/Functional/Controller/ClassApiController80.php rename to tests/Functional/Controller/ClassApiController80.php diff --git a/Tests/Functional/Controller/ClassApiController81.php b/tests/Functional/Controller/ClassApiController81.php similarity index 100% rename from Tests/Functional/Controller/ClassApiController81.php rename to tests/Functional/Controller/ClassApiController81.php diff --git a/Tests/Functional/Controller/Controller2209.php b/tests/Functional/Controller/Controller2209.php similarity index 100% rename from Tests/Functional/Controller/Controller2209.php rename to tests/Functional/Controller/Controller2209.php diff --git a/Tests/Functional/Controller/FOSRestController.php b/tests/Functional/Controller/FOSRestController.php similarity index 100% rename from Tests/Functional/Controller/FOSRestController.php rename to tests/Functional/Controller/FOSRestController.php diff --git a/Tests/Functional/Controller/FOSRestController80.php b/tests/Functional/Controller/FOSRestController80.php similarity index 100% rename from Tests/Functional/Controller/FOSRestController80.php rename to tests/Functional/Controller/FOSRestController80.php diff --git a/Tests/Functional/Controller/FOSRestController81.php b/tests/Functional/Controller/FOSRestController81.php similarity index 100% rename from Tests/Functional/Controller/FOSRestController81.php rename to tests/Functional/Controller/FOSRestController81.php diff --git a/Tests/Functional/Controller/InvokableController80.php b/tests/Functional/Controller/InvokableController80.php similarity index 100% rename from Tests/Functional/Controller/InvokableController80.php rename to tests/Functional/Controller/InvokableController80.php diff --git a/Tests/Functional/Controller/InvokableController81.php b/tests/Functional/Controller/InvokableController81.php similarity index 100% rename from Tests/Functional/Controller/InvokableController81.php rename to tests/Functional/Controller/InvokableController81.php diff --git a/Tests/Functional/Controller/JMSController.php b/tests/Functional/Controller/JMSController.php similarity index 100% rename from Tests/Functional/Controller/JMSController.php rename to tests/Functional/Controller/JMSController.php diff --git a/Tests/Functional/Controller/JMSController80.php b/tests/Functional/Controller/JMSController80.php similarity index 100% rename from Tests/Functional/Controller/JMSController80.php rename to tests/Functional/Controller/JMSController80.php diff --git a/Tests/Functional/Controller/JMSController81.php b/tests/Functional/Controller/JMSController81.php similarity index 100% rename from Tests/Functional/Controller/JMSController81.php rename to tests/Functional/Controller/JMSController81.php diff --git a/Tests/Functional/Controller/MapQueryStringController.php b/tests/Functional/Controller/MapQueryStringController.php similarity index 100% rename from Tests/Functional/Controller/MapQueryStringController.php rename to tests/Functional/Controller/MapQueryStringController.php diff --git a/Tests/Functional/Controller/TestController.php b/tests/Functional/Controller/TestController.php similarity index 100% rename from Tests/Functional/Controller/TestController.php rename to tests/Functional/Controller/TestController.php diff --git a/Tests/Functional/Controller/UndocumentedController.php b/tests/Functional/Controller/UndocumentedController.php similarity index 100% rename from Tests/Functional/Controller/UndocumentedController.php rename to tests/Functional/Controller/UndocumentedController.php diff --git a/Tests/Functional/ControllerTest.php b/tests/Functional/ControllerTest.php similarity index 100% rename from Tests/Functional/ControllerTest.php rename to tests/Functional/ControllerTest.php diff --git a/Tests/Functional/CsrfProtectionFunctionalTest.php b/tests/Functional/CsrfProtectionFunctionalTest.php similarity index 100% rename from Tests/Functional/CsrfProtectionFunctionalTest.php rename to tests/Functional/CsrfProtectionFunctionalTest.php diff --git a/Tests/Functional/Entity/ArrayItems/Bar.php b/tests/Functional/Entity/ArrayItems/Bar.php similarity index 100% rename from Tests/Functional/Entity/ArrayItems/Bar.php rename to tests/Functional/Entity/ArrayItems/Bar.php diff --git a/Tests/Functional/Entity/ArrayItems/Dictionary.php b/tests/Functional/Entity/ArrayItems/Dictionary.php similarity index 100% rename from Tests/Functional/Entity/ArrayItems/Dictionary.php rename to tests/Functional/Entity/ArrayItems/Dictionary.php diff --git a/Tests/Functional/Entity/ArrayItems/Foo.php b/tests/Functional/Entity/ArrayItems/Foo.php similarity index 100% rename from Tests/Functional/Entity/ArrayItems/Foo.php rename to tests/Functional/Entity/ArrayItems/Foo.php diff --git a/Tests/Functional/Entity/Article.php b/tests/Functional/Entity/Article.php similarity index 100% rename from Tests/Functional/Entity/Article.php rename to tests/Functional/Entity/Article.php diff --git a/Tests/Functional/Entity/Article81.php b/tests/Functional/Entity/Article81.php similarity index 100% rename from Tests/Functional/Entity/Article81.php rename to tests/Functional/Entity/Article81.php diff --git a/Tests/Functional/Entity/ArticleInterface.php b/tests/Functional/Entity/ArticleInterface.php similarity index 100% rename from Tests/Functional/Entity/ArticleInterface.php rename to tests/Functional/Entity/ArticleInterface.php diff --git a/Tests/Functional/Entity/ArticleType81.php b/tests/Functional/Entity/ArticleType81.php similarity index 100% rename from Tests/Functional/Entity/ArticleType81.php rename to tests/Functional/Entity/ArticleType81.php diff --git a/Tests/Functional/Entity/ArticleType81IntBacked.php b/tests/Functional/Entity/ArticleType81IntBacked.php similarity index 100% rename from Tests/Functional/Entity/ArticleType81IntBacked.php rename to tests/Functional/Entity/ArticleType81IntBacked.php diff --git a/Tests/Functional/Entity/ArticleType81NotBacked.php b/tests/Functional/Entity/ArticleType81NotBacked.php similarity index 100% rename from Tests/Functional/Entity/ArticleType81NotBacked.php rename to tests/Functional/Entity/ArticleType81NotBacked.php diff --git a/Tests/Functional/Entity/BazingaUser.php b/tests/Functional/Entity/BazingaUser.php similarity index 100% rename from Tests/Functional/Entity/BazingaUser.php rename to tests/Functional/Entity/BazingaUser.php diff --git a/Tests/Functional/Entity/CompoundEntity.php b/tests/Functional/Entity/CompoundEntity.php similarity index 100% rename from Tests/Functional/Entity/CompoundEntity.php rename to tests/Functional/Entity/CompoundEntity.php diff --git a/Tests/Functional/Entity/CompoundEntityNested.php b/tests/Functional/Entity/CompoundEntityNested.php similarity index 100% rename from Tests/Functional/Entity/CompoundEntityNested.php rename to tests/Functional/Entity/CompoundEntityNested.php diff --git a/Tests/Functional/Entity/CustomDateTime.php b/tests/Functional/Entity/CustomDateTime.php similarity index 100% rename from Tests/Functional/Entity/CustomDateTime.php rename to tests/Functional/Entity/CustomDateTime.php diff --git a/Tests/Functional/Entity/Dummy.php b/tests/Functional/Entity/Dummy.php similarity index 100% rename from Tests/Functional/Entity/Dummy.php rename to tests/Functional/Entity/Dummy.php diff --git a/Tests/Functional/Entity/EntityThroughNameConverter.php b/tests/Functional/Entity/EntityThroughNameConverter.php similarity index 100% rename from Tests/Functional/Entity/EntityThroughNameConverter.php rename to tests/Functional/Entity/EntityThroughNameConverter.php diff --git a/Tests/Functional/Entity/EntityThroughNameConverterNested.php b/tests/Functional/Entity/EntityThroughNameConverterNested.php similarity index 100% rename from Tests/Functional/Entity/EntityThroughNameConverterNested.php rename to tests/Functional/Entity/EntityThroughNameConverterNested.php diff --git a/Tests/Functional/Entity/EntityWithAlternateType80.php b/tests/Functional/Entity/EntityWithAlternateType80.php similarity index 100% rename from Tests/Functional/Entity/EntityWithAlternateType80.php rename to tests/Functional/Entity/EntityWithAlternateType80.php diff --git a/Tests/Functional/Entity/EntityWithAlternateType81.php b/tests/Functional/Entity/EntityWithAlternateType81.php similarity index 100% rename from Tests/Functional/Entity/EntityWithAlternateType81.php rename to tests/Functional/Entity/EntityWithAlternateType81.php diff --git a/Tests/Functional/Entity/EntityWithFalsyDefaults.php b/tests/Functional/Entity/EntityWithFalsyDefaults.php similarity index 100% rename from Tests/Functional/Entity/EntityWithFalsyDefaults.php rename to tests/Functional/Entity/EntityWithFalsyDefaults.php diff --git a/Tests/Functional/Entity/EntityWithNullableSchemaSet.php b/tests/Functional/Entity/EntityWithNullableSchemaSet.php similarity index 100% rename from Tests/Functional/Entity/EntityWithNullableSchemaSet.php rename to tests/Functional/Entity/EntityWithNullableSchemaSet.php diff --git a/Tests/Functional/Entity/EntityWithObjectType.php b/tests/Functional/Entity/EntityWithObjectType.php similarity index 100% rename from Tests/Functional/Entity/EntityWithObjectType.php rename to tests/Functional/Entity/EntityWithObjectType.php diff --git a/Tests/Functional/Entity/EntityWithRef.php b/tests/Functional/Entity/EntityWithRef.php similarity index 100% rename from Tests/Functional/Entity/EntityWithRef.php rename to tests/Functional/Entity/EntityWithRef.php diff --git a/Tests/Functional/Entity/JMSComplex80.php b/tests/Functional/Entity/JMSComplex80.php similarity index 100% rename from Tests/Functional/Entity/JMSComplex80.php rename to tests/Functional/Entity/JMSComplex80.php diff --git a/Tests/Functional/Entity/JMSComplex81.php b/tests/Functional/Entity/JMSComplex81.php similarity index 100% rename from Tests/Functional/Entity/JMSComplex81.php rename to tests/Functional/Entity/JMSComplex81.php diff --git a/Tests/Functional/Entity/JMSDualComplex.php b/tests/Functional/Entity/JMSDualComplex.php similarity index 100% rename from Tests/Functional/Entity/JMSDualComplex.php rename to tests/Functional/Entity/JMSDualComplex.php diff --git a/Tests/Functional/Entity/JMSDualComplex80.php b/tests/Functional/Entity/JMSDualComplex80.php similarity index 100% rename from Tests/Functional/Entity/JMSDualComplex80.php rename to tests/Functional/Entity/JMSDualComplex80.php diff --git a/Tests/Functional/Entity/JMSDualComplex81.php b/tests/Functional/Entity/JMSDualComplex81.php similarity index 100% rename from Tests/Functional/Entity/JMSDualComplex81.php rename to tests/Functional/Entity/JMSDualComplex81.php diff --git a/Tests/Functional/Entity/JMSNamingStrategyConstraints.php b/tests/Functional/Entity/JMSNamingStrategyConstraints.php similarity index 100% rename from Tests/Functional/Entity/JMSNamingStrategyConstraints.php rename to tests/Functional/Entity/JMSNamingStrategyConstraints.php diff --git a/Tests/Functional/Entity/JMSNamingStrategyConstraints80.php b/tests/Functional/Entity/JMSNamingStrategyConstraints80.php similarity index 100% rename from Tests/Functional/Entity/JMSNamingStrategyConstraints80.php rename to tests/Functional/Entity/JMSNamingStrategyConstraints80.php diff --git a/Tests/Functional/Entity/JMSNamingStrategyConstraints81.php b/tests/Functional/Entity/JMSNamingStrategyConstraints81.php similarity index 100% rename from Tests/Functional/Entity/JMSNamingStrategyConstraints81.php rename to tests/Functional/Entity/JMSNamingStrategyConstraints81.php diff --git a/Tests/Functional/Entity/JMSNote.php b/tests/Functional/Entity/JMSNote.php similarity index 100% rename from Tests/Functional/Entity/JMSNote.php rename to tests/Functional/Entity/JMSNote.php diff --git a/Tests/Functional/Entity/JMSNote80.php b/tests/Functional/Entity/JMSNote80.php similarity index 100% rename from Tests/Functional/Entity/JMSNote80.php rename to tests/Functional/Entity/JMSNote80.php diff --git a/Tests/Functional/Entity/JMSNote81.php b/tests/Functional/Entity/JMSNote81.php similarity index 100% rename from Tests/Functional/Entity/JMSNote81.php rename to tests/Functional/Entity/JMSNote81.php diff --git a/Tests/Functional/Entity/JMSUser.php b/tests/Functional/Entity/JMSUser.php similarity index 100% rename from Tests/Functional/Entity/JMSUser.php rename to tests/Functional/Entity/JMSUser.php diff --git a/Tests/Functional/Entity/JMSUser80.php b/tests/Functional/Entity/JMSUser80.php similarity index 100% rename from Tests/Functional/Entity/JMSUser80.php rename to tests/Functional/Entity/JMSUser80.php diff --git a/Tests/Functional/Entity/JMSUser81.php b/tests/Functional/Entity/JMSUser81.php similarity index 100% rename from Tests/Functional/Entity/JMSUser81.php rename to tests/Functional/Entity/JMSUser81.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChat.php b/tests/Functional/Entity/NestedGroup/JMSChat.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChat.php rename to tests/Functional/Entity/NestedGroup/JMSChat.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChat80.php b/tests/Functional/Entity/NestedGroup/JMSChat80.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChat80.php rename to tests/Functional/Entity/NestedGroup/JMSChat80.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChat81.php b/tests/Functional/Entity/NestedGroup/JMSChat81.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChat81.php rename to tests/Functional/Entity/NestedGroup/JMSChat81.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatFriend.php b/tests/Functional/Entity/NestedGroup/JMSChatFriend.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatFriend.php rename to tests/Functional/Entity/NestedGroup/JMSChatFriend.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatFriend80.php b/tests/Functional/Entity/NestedGroup/JMSChatFriend80.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatFriend80.php rename to tests/Functional/Entity/NestedGroup/JMSChatFriend80.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatFriend81.php b/tests/Functional/Entity/NestedGroup/JMSChatFriend81.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatFriend81.php rename to tests/Functional/Entity/NestedGroup/JMSChatFriend81.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatLivingRoom.php b/tests/Functional/Entity/NestedGroup/JMSChatLivingRoom.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatLivingRoom.php rename to tests/Functional/Entity/NestedGroup/JMSChatLivingRoom.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatRoom.php b/tests/Functional/Entity/NestedGroup/JMSChatRoom.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatRoom.php rename to tests/Functional/Entity/NestedGroup/JMSChatRoom.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatRoom80.php b/tests/Functional/Entity/NestedGroup/JMSChatRoom80.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatRoom80.php rename to tests/Functional/Entity/NestedGroup/JMSChatRoom80.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatRoom81.php b/tests/Functional/Entity/NestedGroup/JMSChatRoom81.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatRoom81.php rename to tests/Functional/Entity/NestedGroup/JMSChatRoom81.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatRoomUser.php b/tests/Functional/Entity/NestedGroup/JMSChatRoomUser.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatRoomUser.php rename to tests/Functional/Entity/NestedGroup/JMSChatRoomUser.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatRoomUser80.php b/tests/Functional/Entity/NestedGroup/JMSChatRoomUser80.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatRoomUser80.php rename to tests/Functional/Entity/NestedGroup/JMSChatRoomUser80.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatRoomUser81.php b/tests/Functional/Entity/NestedGroup/JMSChatRoomUser81.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatRoomUser81.php rename to tests/Functional/Entity/NestedGroup/JMSChatRoomUser81.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatUser.php b/tests/Functional/Entity/NestedGroup/JMSChatUser.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatUser.php rename to tests/Functional/Entity/NestedGroup/JMSChatUser.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatUser80.php b/tests/Functional/Entity/NestedGroup/JMSChatUser80.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatUser80.php rename to tests/Functional/Entity/NestedGroup/JMSChatUser80.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSChatUser81.php b/tests/Functional/Entity/NestedGroup/JMSChatUser81.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSChatUser81.php rename to tests/Functional/Entity/NestedGroup/JMSChatUser81.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSPicture.php b/tests/Functional/Entity/NestedGroup/JMSPicture.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSPicture.php rename to tests/Functional/Entity/NestedGroup/JMSPicture.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSPicture80.php b/tests/Functional/Entity/NestedGroup/JMSPicture80.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSPicture80.php rename to tests/Functional/Entity/NestedGroup/JMSPicture80.php diff --git a/Tests/Functional/Entity/NestedGroup/JMSPicture81.php b/tests/Functional/Entity/NestedGroup/JMSPicture81.php similarity index 100% rename from Tests/Functional/Entity/NestedGroup/JMSPicture81.php rename to tests/Functional/Entity/NestedGroup/JMSPicture81.php diff --git a/Tests/Functional/Entity/PrivateProtectedExposure.php b/tests/Functional/Entity/PrivateProtectedExposure.php similarity index 100% rename from Tests/Functional/Entity/PrivateProtectedExposure.php rename to tests/Functional/Entity/PrivateProtectedExposure.php diff --git a/Tests/Functional/Entity/QueryModel/ArrayQueryModel.php b/tests/Functional/Entity/QueryModel/ArrayQueryModel.php similarity index 100% rename from Tests/Functional/Entity/QueryModel/ArrayQueryModel.php rename to tests/Functional/Entity/QueryModel/ArrayQueryModel.php diff --git a/Tests/Functional/Entity/QueryModel/FilterQueryModel.php b/tests/Functional/Entity/QueryModel/FilterQueryModel.php similarity index 100% rename from Tests/Functional/Entity/QueryModel/FilterQueryModel.php rename to tests/Functional/Entity/QueryModel/FilterQueryModel.php diff --git a/Tests/Functional/Entity/QueryModel/PaginationQueryModel.php b/tests/Functional/Entity/QueryModel/PaginationQueryModel.php similarity index 100% rename from Tests/Functional/Entity/QueryModel/PaginationQueryModel.php rename to tests/Functional/Entity/QueryModel/PaginationQueryModel.php diff --git a/Tests/Functional/Entity/QueryModel/SortEnum.php b/tests/Functional/Entity/QueryModel/SortEnum.php similarity index 100% rename from Tests/Functional/Entity/QueryModel/SortEnum.php rename to tests/Functional/Entity/QueryModel/SortEnum.php diff --git a/Tests/Functional/Entity/QueryModel/SortQueryModel.php b/tests/Functional/Entity/QueryModel/SortQueryModel.php similarity index 100% rename from Tests/Functional/Entity/QueryModel/SortQueryModel.php rename to tests/Functional/Entity/QueryModel/SortQueryModel.php diff --git a/Tests/Functional/Entity/SymfonyConstraints80.php b/tests/Functional/Entity/SymfonyConstraints80.php similarity index 100% rename from Tests/Functional/Entity/SymfonyConstraints80.php rename to tests/Functional/Entity/SymfonyConstraints80.php diff --git a/Tests/Functional/Entity/SymfonyConstraints81.php b/tests/Functional/Entity/SymfonyConstraints81.php similarity index 100% rename from Tests/Functional/Entity/SymfonyConstraints81.php rename to tests/Functional/Entity/SymfonyConstraints81.php diff --git a/Tests/Functional/Entity/SymfonyConstraintsWithValidationGroups.php b/tests/Functional/Entity/SymfonyConstraintsWithValidationGroups.php similarity index 100% rename from Tests/Functional/Entity/SymfonyConstraintsWithValidationGroups.php rename to tests/Functional/Entity/SymfonyConstraintsWithValidationGroups.php diff --git a/Tests/Functional/Entity/SymfonyConstraintsWithValidationGroups80.php b/tests/Functional/Entity/SymfonyConstraintsWithValidationGroups80.php similarity index 100% rename from Tests/Functional/Entity/SymfonyConstraintsWithValidationGroups80.php rename to tests/Functional/Entity/SymfonyConstraintsWithValidationGroups80.php diff --git a/Tests/Functional/Entity/SymfonyConstraintsWithValidationGroups81.php b/tests/Functional/Entity/SymfonyConstraintsWithValidationGroups81.php similarity index 100% rename from Tests/Functional/Entity/SymfonyConstraintsWithValidationGroups81.php rename to tests/Functional/Entity/SymfonyConstraintsWithValidationGroups81.php diff --git a/Tests/Functional/Entity/SymfonyDiscriminator80.php b/tests/Functional/Entity/SymfonyDiscriminator80.php similarity index 100% rename from Tests/Functional/Entity/SymfonyDiscriminator80.php rename to tests/Functional/Entity/SymfonyDiscriminator80.php diff --git a/Tests/Functional/Entity/SymfonyDiscriminator81.php b/tests/Functional/Entity/SymfonyDiscriminator81.php similarity index 100% rename from Tests/Functional/Entity/SymfonyDiscriminator81.php rename to tests/Functional/Entity/SymfonyDiscriminator81.php diff --git a/Tests/Functional/Entity/SymfonyDiscriminatorFileMapping.php b/tests/Functional/Entity/SymfonyDiscriminatorFileMapping.php similarity index 100% rename from Tests/Functional/Entity/SymfonyDiscriminatorFileMapping.php rename to tests/Functional/Entity/SymfonyDiscriminatorFileMapping.php diff --git a/Tests/Functional/Entity/SymfonyDiscriminatorOne.php b/tests/Functional/Entity/SymfonyDiscriminatorOne.php similarity index 100% rename from Tests/Functional/Entity/SymfonyDiscriminatorOne.php rename to tests/Functional/Entity/SymfonyDiscriminatorOne.php diff --git a/Tests/Functional/Entity/SymfonyDiscriminatorTwo.php b/tests/Functional/Entity/SymfonyDiscriminatorTwo.php similarity index 100% rename from Tests/Functional/Entity/SymfonyDiscriminatorTwo.php rename to tests/Functional/Entity/SymfonyDiscriminatorTwo.php diff --git a/Tests/Functional/Entity/SymfonyMapQueryString.php b/tests/Functional/Entity/SymfonyMapQueryString.php similarity index 100% rename from Tests/Functional/Entity/SymfonyMapQueryString.php rename to tests/Functional/Entity/SymfonyMapQueryString.php diff --git a/Tests/Functional/Entity/User.php b/tests/Functional/Entity/User.php similarity index 100% rename from Tests/Functional/Entity/User.php rename to tests/Functional/Entity/User.php diff --git a/Tests/Functional/Entity/VirtualProperty.php b/tests/Functional/Entity/VirtualProperty.php similarity index 100% rename from Tests/Functional/Entity/VirtualProperty.php rename to tests/Functional/Entity/VirtualProperty.php diff --git a/Tests/Functional/Entity/VirtualProperty80.php b/tests/Functional/Entity/VirtualProperty80.php similarity index 100% rename from Tests/Functional/Entity/VirtualProperty80.php rename to tests/Functional/Entity/VirtualProperty80.php diff --git a/Tests/Functional/Entity/VirtualProperty81.php b/tests/Functional/Entity/VirtualProperty81.php similarity index 100% rename from Tests/Functional/Entity/VirtualProperty81.php rename to tests/Functional/Entity/VirtualProperty81.php diff --git a/Tests/Functional/EntityExcluded/ApiPlatform2/Dummy.php b/tests/Functional/EntityExcluded/ApiPlatform2/Dummy.php similarity index 100% rename from Tests/Functional/EntityExcluded/ApiPlatform2/Dummy.php rename to tests/Functional/EntityExcluded/ApiPlatform2/Dummy.php diff --git a/Tests/Functional/EntityExcluded/ApiPlatform3/Dummy.php b/tests/Functional/EntityExcluded/ApiPlatform3/Dummy.php similarity index 100% rename from Tests/Functional/EntityExcluded/ApiPlatform3/Dummy.php rename to tests/Functional/EntityExcluded/ApiPlatform3/Dummy.php diff --git a/Tests/Functional/EntityExcluded/BazingaUserTyped.php b/tests/Functional/EntityExcluded/BazingaUserTyped.php similarity index 100% rename from Tests/Functional/EntityExcluded/BazingaUserTyped.php rename to tests/Functional/EntityExcluded/BazingaUserTyped.php diff --git a/Tests/Functional/EntityExcluded/SerializedNameEnt.php b/tests/Functional/EntityExcluded/SerializedNameEnt.php similarity index 100% rename from Tests/Functional/EntityExcluded/SerializedNameEnt.php rename to tests/Functional/EntityExcluded/SerializedNameEnt.php diff --git a/Tests/Functional/EntityExcluded/Symfony7/SerializedNameEntity.php b/tests/Functional/EntityExcluded/Symfony7/SerializedNameEntity.php similarity index 100% rename from Tests/Functional/EntityExcluded/Symfony7/SerializedNameEntity.php rename to tests/Functional/EntityExcluded/Symfony7/SerializedNameEntity.php diff --git a/Tests/Functional/FOSRestTest.php b/tests/Functional/FOSRestTest.php similarity index 100% rename from Tests/Functional/FOSRestTest.php rename to tests/Functional/FOSRestTest.php diff --git a/Tests/Functional/Fixtures/Controller2209.json b/tests/Functional/Fixtures/Controller2209.json similarity index 100% rename from Tests/Functional/Fixtures/Controller2209.json rename to tests/Functional/Fixtures/Controller2209.json diff --git a/Tests/Functional/Fixtures/MapQueryStringCleanupComponents.json b/tests/Functional/Fixtures/MapQueryStringCleanupComponents.json similarity index 100% rename from Tests/Functional/Fixtures/MapQueryStringCleanupComponents.json rename to tests/Functional/Fixtures/MapQueryStringCleanupComponents.json diff --git a/Tests/Functional/Fixtures/MapQueryStringController.json b/tests/Functional/Fixtures/MapQueryStringController.json similarity index 100% rename from Tests/Functional/Fixtures/MapQueryStringController.json rename to tests/Functional/Fixtures/MapQueryStringController.json diff --git a/Tests/Functional/Form/DocumentType.php b/tests/Functional/Form/DocumentType.php similarity index 100% rename from Tests/Functional/Form/DocumentType.php rename to tests/Functional/Form/DocumentType.php diff --git a/Tests/Functional/Form/DummyEmptyType.php b/tests/Functional/Form/DummyEmptyType.php similarity index 100% rename from Tests/Functional/Form/DummyEmptyType.php rename to tests/Functional/Form/DummyEmptyType.php diff --git a/Tests/Functional/Form/DummyType.php b/tests/Functional/Form/DummyType.php similarity index 100% rename from Tests/Functional/Form/DummyType.php rename to tests/Functional/Form/DummyType.php diff --git a/Tests/Functional/Form/EntityType.php b/tests/Functional/Form/EntityType.php similarity index 100% rename from Tests/Functional/Form/EntityType.php rename to tests/Functional/Form/EntityType.php diff --git a/Tests/Functional/Form/ExtendedBuiltinType.php b/tests/Functional/Form/ExtendedBuiltinType.php similarity index 100% rename from Tests/Functional/Form/ExtendedBuiltinType.php rename to tests/Functional/Form/ExtendedBuiltinType.php diff --git a/Tests/Functional/Form/FormWithAlternateSchemaType.php b/tests/Functional/Form/FormWithAlternateSchemaType.php similarity index 100% rename from Tests/Functional/Form/FormWithAlternateSchemaType.php rename to tests/Functional/Form/FormWithAlternateSchemaType.php diff --git a/Tests/Functional/Form/FormWithCsrfProtectionDisabledType.php b/tests/Functional/Form/FormWithCsrfProtectionDisabledType.php similarity index 100% rename from Tests/Functional/Form/FormWithCsrfProtectionDisabledType.php rename to tests/Functional/Form/FormWithCsrfProtectionDisabledType.php diff --git a/Tests/Functional/Form/FormWithCsrfProtectionEnabledType.php b/tests/Functional/Form/FormWithCsrfProtectionEnabledType.php similarity index 100% rename from Tests/Functional/Form/FormWithCsrfProtectionEnabledType.php rename to tests/Functional/Form/FormWithCsrfProtectionEnabledType.php diff --git a/Tests/Functional/Form/FormWithModel.php b/tests/Functional/Form/FormWithModel.php similarity index 100% rename from Tests/Functional/Form/FormWithModel.php rename to tests/Functional/Form/FormWithModel.php diff --git a/Tests/Functional/Form/FormWithRefType.php b/tests/Functional/Form/FormWithRefType.php similarity index 100% rename from Tests/Functional/Form/FormWithRefType.php rename to tests/Functional/Form/FormWithRefType.php diff --git a/Tests/Functional/Form/UserType.php b/tests/Functional/Form/UserType.php similarity index 100% rename from Tests/Functional/Form/UserType.php rename to tests/Functional/Form/UserType.php diff --git a/Tests/Functional/FunctionalTest.php b/tests/Functional/FunctionalTest.php similarity index 100% rename from Tests/Functional/FunctionalTest.php rename to tests/Functional/FunctionalTest.php diff --git a/Tests/Functional/JMSFunctionalTest.php b/tests/Functional/JMSFunctionalTest.php similarity index 100% rename from Tests/Functional/JMSFunctionalTest.php rename to tests/Functional/JMSFunctionalTest.php diff --git a/Tests/Functional/ModelDescriber/NameConverter.php b/tests/Functional/ModelDescriber/NameConverter.php similarity index 100% rename from Tests/Functional/ModelDescriber/NameConverter.php rename to tests/Functional/ModelDescriber/NameConverter.php diff --git a/Tests/Functional/ModelDescriber/VirtualTypeClassDoesNotExistsHandlerDefinedDescriber.php b/tests/Functional/ModelDescriber/VirtualTypeClassDoesNotExistsHandlerDefinedDescriber.php similarity index 100% rename from Tests/Functional/ModelDescriber/VirtualTypeClassDoesNotExistsHandlerDefinedDescriber.php rename to tests/Functional/ModelDescriber/VirtualTypeClassDoesNotExistsHandlerDefinedDescriber.php diff --git a/Tests/Functional/NelmioKernel.php b/tests/Functional/NelmioKernel.php similarity index 100% rename from Tests/Functional/NelmioKernel.php rename to tests/Functional/NelmioKernel.php diff --git a/Tests/Functional/Resources/routes-attributes.yaml b/tests/Functional/Resources/routes-attributes.yaml similarity index 100% rename from Tests/Functional/Resources/routes-attributes.yaml rename to tests/Functional/Resources/routes-attributes.yaml diff --git a/Tests/Functional/Resources/routes.yaml b/tests/Functional/Resources/routes.yaml similarity index 100% rename from Tests/Functional/Resources/routes.yaml rename to tests/Functional/Resources/routes.yaml diff --git a/Tests/Functional/Resources/serializer/discriminator.yaml b/tests/Functional/Resources/serializer/discriminator.yaml similarity index 100% rename from Tests/Functional/Resources/serializer/discriminator.yaml rename to tests/Functional/Resources/serializer/discriminator.yaml diff --git a/Tests/Functional/SwaggerPHPApiComplianceTest.php b/tests/Functional/SwaggerPHPApiComplianceTest.php similarity index 100% rename from Tests/Functional/SwaggerPHPApiComplianceTest.php rename to tests/Functional/SwaggerPHPApiComplianceTest.php diff --git a/Tests/Functional/SwaggerUiTest.php b/tests/Functional/SwaggerUiTest.php similarity index 100% rename from Tests/Functional/SwaggerUiTest.php rename to tests/Functional/SwaggerUiTest.php diff --git a/Tests/Functional/SymfonyFunctionalTest.php b/tests/Functional/SymfonyFunctionalTest.php similarity index 100% rename from Tests/Functional/SymfonyFunctionalTest.php rename to tests/Functional/SymfonyFunctionalTest.php diff --git a/Tests/Functional/TestBundle.php b/tests/Functional/TestBundle.php similarity index 100% rename from Tests/Functional/TestBundle.php rename to tests/Functional/TestBundle.php diff --git a/Tests/Functional/TestKernel.php b/tests/Functional/TestKernel.php similarity index 99% rename from Tests/Functional/TestKernel.php rename to tests/Functional/TestKernel.php index 29e26876f..5741764a1 100644 --- a/Tests/Functional/TestKernel.php +++ b/tests/Functional/TestKernel.php @@ -168,8 +168,8 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load $c->loadFromExtension('api_platform', [ 'mapping' => ['paths' => [ !class_exists(ApiProperty::class) - ? '%kernel.project_dir%/Tests/Functional/EntityExcluded/ApiPlatform3' - : '%kernel.project_dir%/Tests/Functional/EntityExcluded/ApiPlatform2', + ? '%kernel.project_dir%/tests/Functional/EntityExcluded/ApiPlatform3' + : '%kernel.project_dir%/tests/Functional/EntityExcluded/ApiPlatform2', ]], ]); diff --git a/Tests/Functional/ValidationGroupsFunctionalTest.php b/tests/Functional/ValidationGroupsFunctionalTest.php similarity index 100% rename from Tests/Functional/ValidationGroupsFunctionalTest.php rename to tests/Functional/ValidationGroupsFunctionalTest.php diff --git a/Tests/Functional/WebTestCase.php b/tests/Functional/WebTestCase.php similarity index 100% rename from Tests/Functional/WebTestCase.php rename to tests/Functional/WebTestCase.php diff --git a/Tests/Helper.php b/tests/Helper.php similarity index 100% rename from Tests/Helper.php rename to tests/Helper.php diff --git a/Tests/Model/ModelRegistryTest.php b/tests/Model/ModelRegistryTest.php similarity index 100% rename from Tests/Model/ModelRegistryTest.php rename to tests/Model/ModelRegistryTest.php diff --git a/Tests/ModelDescriber/Annotations/AnnotationReaderTest.php b/tests/ModelDescriber/Annotations/AnnotationReaderTest.php similarity index 100% rename from Tests/ModelDescriber/Annotations/AnnotationReaderTest.php rename to tests/ModelDescriber/Annotations/AnnotationReaderTest.php diff --git a/Tests/ModelDescriber/Annotations/Fixture/CompoundStub.php b/tests/ModelDescriber/Annotations/Fixture/CompoundStub.php similarity index 100% rename from Tests/ModelDescriber/Annotations/Fixture/CompoundStub.php rename to tests/ModelDescriber/Annotations/Fixture/CompoundStub.php diff --git a/Tests/ModelDescriber/Annotations/Fixture/CompoundValidationRule.php b/tests/ModelDescriber/Annotations/Fixture/CompoundValidationRule.php similarity index 100% rename from Tests/ModelDescriber/Annotations/Fixture/CompoundValidationRule.php rename to tests/ModelDescriber/Annotations/Fixture/CompoundValidationRule.php diff --git a/Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php b/tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php similarity index 100% rename from Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php rename to tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php diff --git a/Tests/ModelDescriber/ApplyOpenApiDiscriminatorTraitTest.php b/tests/ModelDescriber/ApplyOpenApiDiscriminatorTraitTest.php similarity index 100% rename from Tests/ModelDescriber/ApplyOpenApiDiscriminatorTraitTest.php rename to tests/ModelDescriber/ApplyOpenApiDiscriminatorTraitTest.php diff --git a/Tests/ModelDescriber/Fixtures/SelfDescribingModel.php b/tests/ModelDescriber/Fixtures/SelfDescribingModel.php similarity index 100% rename from Tests/ModelDescriber/Fixtures/SelfDescribingModel.php rename to tests/ModelDescriber/Fixtures/SelfDescribingModel.php diff --git a/Tests/ModelDescriber/FormModelDescriberTest.php b/tests/ModelDescriber/FormModelDescriberTest.php similarity index 100% rename from Tests/ModelDescriber/FormModelDescriberTest.php rename to tests/ModelDescriber/FormModelDescriberTest.php diff --git a/Tests/ModelDescriber/SelfDescribingModelDescriberTest.php b/tests/ModelDescriber/SelfDescribingModelDescriberTest.php similarity index 100% rename from Tests/ModelDescriber/SelfDescribingModelDescriberTest.php rename to tests/ModelDescriber/SelfDescribingModelDescriberTest.php diff --git a/Tests/Render/Html/GetNelmioAssetTest.php b/tests/Render/Html/GetNelmioAssetTest.php similarity index 97% rename from Tests/Render/Html/GetNelmioAssetTest.php rename to tests/Render/Html/GetNelmioAssetTest.php index 063393e3b..3ba8f91e8 100644 --- a/Tests/Render/Html/GetNelmioAssetTest.php +++ b/tests/Render/Html/GetNelmioAssetTest.php @@ -31,8 +31,8 @@ public function test($mode, $asset, $expectedContent) public function provideAsset() { - $cdnDir = 'https://cdn.jsdelivr.net/gh/nelmio/NelmioApiDocBundle/Resources/public'; - $resourceDir = __DIR__.'/../../../Resources/public'; + $cdnDir = 'https://cdn.jsdelivr.net/gh/nelmio/NelmioApiDocBundle/public'; + $resourceDir = __DIR__.'/../../../public'; return $this->provideCss($cdnDir, $resourceDir) + $this->provideJs($cdnDir, $resourceDir) diff --git a/Tests/Render/RenderOpenApiTest.php b/tests/Render/RenderOpenApiTest.php similarity index 100% rename from Tests/Render/RenderOpenApiTest.php rename to tests/Render/RenderOpenApiTest.php diff --git a/Tests/RouteDescriber/FosRestDescriberTest.php b/tests/RouteDescriber/FosRestDescriberTest.php similarity index 100% rename from Tests/RouteDescriber/FosRestDescriberTest.php rename to tests/RouteDescriber/FosRestDescriberTest.php diff --git a/Tests/RouteDescriber/RouteMetadataDescriberTest.php b/tests/RouteDescriber/RouteMetadataDescriberTest.php similarity index 100% rename from Tests/RouteDescriber/RouteMetadataDescriberTest.php rename to tests/RouteDescriber/RouteMetadataDescriberTest.php diff --git a/Tests/Routing/FilteredRouteCollectionBuilderTest.php b/tests/Routing/FilteredRouteCollectionBuilderTest.php similarity index 100% rename from Tests/Routing/FilteredRouteCollectionBuilderTest.php rename to tests/Routing/FilteredRouteCollectionBuilderTest.php diff --git a/Tests/SwaggerPhp/UtilTest.php b/tests/SwaggerPhp/UtilTest.php similarity index 100% rename from Tests/SwaggerPhp/UtilTest.php rename to tests/SwaggerPhp/UtilTest.php diff --git a/Tests/Util/ControllerReflectorTest.php b/tests/Util/ControllerReflectorTest.php similarity index 100% rename from Tests/Util/ControllerReflectorTest.php rename to tests/Util/ControllerReflectorTest.php