547 Commits

Author SHA1 Message Date
Frederik Holz
aa18c6c83b
[3.x]: Hide the default section per area with new config parameter (#1868)
* Add new config node disable_default_routes to prevent registering RouteDescriber to specific areas which allowes disabling rendering of default routes, Adjust tests accordingly

* Add documentation for new config variable

* Change disable_default_routes to filter route collection instead of disabling route describer, Add test for new handling in FilteredRouteCollectionBuilder

* Change naming of matching method for disabling default routes

* Fix codestyle issue

* Fix codestyle issue

* Change naming of dataProvider to match testing name

Co-authored-by: Frederik Holz <team-orange@auxmoney.com>
2021-10-06 19:28:59 +02:00
Mathieu Ducrot
1306106931
Update templates comment path for bundle override (#1864)
## Changelog

Fix the comment path from SwaggerUI to SwaggerUi since case does matter for template override to work.
2021-08-23 12:06:14 +02:00
Fabien Salathe
74036e974a Remove dead code
Removed an unused property
2021-08-03 10:24:24 +02:00
Guilhem Niot
305668a345 Explictly enable property access in the tests (related to https://github.com/symfony/symfony/pull/40140, it is a dev dependency) 2021-06-14 13:28:11 +02:00
Nicolas
27e6599b1a Add a check for Constraint class existing before using it
*Context*: NelmioApiDocBundle does not require clients to have the symfony/validator package. However it requires it in its dev dependencies.

*Problem*: If client of library does not have symfony/validator and uses PHP8, NelmioApiDocBundle will assume that symfony/validator is installed, in `SymfonyConstraintAnnotationReader.php`

*Solution*: We should not assume that client has symfony/validator. So before reading attributes of this class, we now try to see if class exists. 
- Tests still run.
- Tested in a project without symfony/validator and requiring this version, it now works.

The error before this fix was : 
Exception: `ClassNotFound`
Message for me: `Attempted to load class "Constraint" from namespace "Symfony\Component\Validator".
Did you forget a "use" statement for e.g. "JsonSchema\Constraints\Constraint" or "Doctrine\DBAL\Schema\Constraint"?`
2021-06-14 13:24:45 +02:00
Guilhem Niot
75794a74ec
Adapt https://github.com/nelmio/NelmioApiDocBundle/pull/1814 to 3.x 2021-05-09 17:32:00 +02:00
Alexandru Năstase
9b258b10bb Add extra name_patterns example to areas docs
Add an extra `name_patterns` example to areas docs
2021-05-09 17:25:00 +02:00
Guilhem Niot
67d626682d
Merge pull request #1808 from derrabus/bugfix/service-locator
Added a class to the nelmio_api_doc.generator_locator service definition
2021-04-19 10:13:09 +02:00
Alexander M. Turek
a2191826de Added a class to the nelmio_api_doc.generator_locator service definition 2021-04-18 17:48:12 +02:00
Guilhem Niot
a306d6c96e
Merge pull request #1803 from javiereguiluz/patch-1
[Doc] Some minor fixes in index.rst
2021-03-24 00:28:34 +01:00
Javier Eguiluz
051fca9070
[Doc] Some minor fixes in index.rst 2021-03-23 20:13:05 +01:00
Guilhem Niot
5e6140cd65
Merge pull request #1797 from nelmio/BACKPORT
Added support for constraint attributes
2021-03-14 17:03:59 +01:00
Alexander M. Turek
12ac91bfcd Added support for constraint attributes 2021-03-14 17:02:52 +01:00
Guilhem Niot
e57ede23ed Use annotations reader without cache 2020-12-29 10:27:09 +01:00
Guilhem Niot
820c058de7
Update build status with github actions 2020-12-22 11:27:56 +01:00
Guilhem Niot
3895e17fe4 Fix exposure of private/protected methods 2020-12-16 23:46:29 +01:00
Guilhem Niot
76c6f05023 Use stable version of FOSRestBundle 2020-12-16 21:31:45 +01:00
Guilhem Niot
0a3785fd26 Fix cs 2020-12-10 22:30:50 +01:00
Guilhem Niot
6d995a6e03
Add php 8 support (#1745)
* Add php 8 support

* Ignore platform reqs

* Change php constraint

* Use vendor/bin/simple-phpunit directly

* Remove willdurand/hateoas-bundle when testing php8

* Merge 3.x

* Move to github actions

* Fix the tests

* Change ./phpunit permissions

* Update deprecations policy
2020-12-10 21:59:36 +01:00
Guilhem Niot
67b28f1f7f
Allow the usage of @SWG\Definition on form types (#1751) 2020-12-02 15:39:15 +01:00
Guilhem Niot
90f835f1ef
Allow to not document form types fields (#1752)
* Allow the usage of `@SWG\Definition` on form types

* Allow to not document form types fields

* Reduce the number of changes
2020-12-02 15:38:38 +01:00
Guilhem Niot
f60724e90a
Merge pull request #1747 from nelmio/arrayitemserror
Improve error when the items type of an array is not specified
2020-11-28 18:34:49 +01:00
Guilhem Niot
a01fd1e4f0 Fix error 2020-11-28 16:11:05 +01:00
Guilhem Niot
68bf1670f3 Fix CS 2020-11-20 17:10:21 +01:00
Guilhem Niot
0912c85a0d Improve error when the items type of an array is not specified 2020-11-20 17:06:56 +01:00
Guilhem Niot
00e4b53802
Merge pull request #1727 from lucassabreu/add-utf8-charset
(feat): add utf-8 charset to response
2020-10-04 09:48:59 +02:00
Lucas dos Santos Abreu
b022f6b219 (feat): add utf-8 charset to response
`swagger-ui-bundle` is very sensible to encoding changes because of the
RegExp performed.

ensuring UTF-8 on the response prevents end-user config to break it.

the annotations already needs to be UTF-8 compatible to generate the
JSON, so it should not break users applications.
2020-10-02 14:04:16 -03:00
Alex Kalineskou
290df23dc0 Fix property_exists for SymfonyConstraintAnnotationReader 2020-09-29 12:30:21 +02:00
Guilhem Niot
f6edaf8816
Merge pull request #1722 from phansys/git_attributes
Exclude development files from dist package
2020-09-29 12:23:19 +02:00
Javier Spagnoletti
e8ce0960a2 Exclude development files from dist package 2020-09-28 10:36:17 -03:00
Guilhem Niot
6faec06321
Fix the tests (#1720)
* Fix the tests

* Add a comment

* fix the tests

* cs
2020-09-20 20:38:26 +02:00
Guilhem Niot
318fa82cc0
Merge pull request #1718 from rishirajpurohit/enhancement/make-RouteDescriberTrait-public
Remove the @internal tag to avoid deprecations on symfony 5.1 (#1673)
2020-09-20 20:16:29 +02:00
Rishiraj Purohit
b579dbe3dc remove internal tag to avoid deprecation warnings 2020-09-20 12:53:27 +02:00
Guilhem Niot
ab8c44f520 Adapt https://github.com/nelmio/NelmioApiDocBundle/pull/1711 to 3.x 2020-09-09 08:52:15 +02:00
Alex Kalineskou
0da1909cb9 Add support for allowNull for Assert\NotBlank 2020-09-09 08:45:53 +02:00
Guilhem Niot
c1903db109 Fix the JMSModelDescriber 2020-09-09 08:38:25 +02:00
Paul Dugas
429d809f41 Ignore ReflectionException for "magic" JMS\Accessor methods (#1715)
* Update JMSModelDescriber.php

Ignore ReflectionException thrown when getter or setter from JMS\ Accessor are "magic" methods.

* Add tests to avoid future regressions

* CS

Co-authored-by: Guilhem Niot <guilhem.niot@gmail.com>
2020-09-09 08:38:08 +02:00
Guilhem Niot
d9f1611f72
Release version 3.7 2020-08-12 11:06:17 +02:00
Adir Kuhn
71f0cfddcb
Supports reflection for routes configured in PHP files. (#1701)
By default the PHP configuration routes returns an array with the controller name and method, since the reflection class was typed for string only this was causing an exception when the user was not using YAML or XML configuration.
This changes removes the string type hint from the method and checks if it's an array or string to do the reflection.

Co-authored-by: Adir Kuhn <adir@123inkt.nl>
2020-08-11 16:46:05 +02:00
Guilhem Niot
edf6b70175 Apply StyleCI fixes 2020-08-06 10:26:59 +02:00
Guilhem Niot
ff4726f38d Update StyleCI config 2020-08-06 10:25:35 +02:00
Guilhem Niot
0d2552edab
Update the links in the README 2020-07-24 16:58:58 +02:00
Guilhem Niot
0fd910b34a
Update the installation command 2020-07-24 16:57:39 +02:00
SAMUEL NELA
0e7803888a
Excluded tests from classmap (#1521) 2020-07-24 15:48:12 +02:00
Guilhem Niot
b9d49e5799
Update CHANGELOG.md 2020-07-24 15:45:52 +02:00
Guilhem Niot
523d28e955
Add annotations support at methods level when using the JMS serializer (#1682) 2020-07-18 13:31:41 +02:00
Guilhem Niot
8948d5418b
Add methods metadata support for models (#1678)
* Add methods metadata support for models

* fix cs
2020-07-12 14:54:39 +02:00
Guilhem Niot
f998c1632f
Fix Changelog 2020-07-11 18:05:11 +02:00
Guilhem Niot
f420532121
Support using annotations only at the class level of controllers (#1668)
* Support using annotations only at the class level of controllers

* Fix dependencies

* Bump dependency
2020-07-11 17:53:09 +02:00
pratyam
fe39acd6a8
Bugfix/remove pattern from property expression message error (#1670)
* remove pattern added from the Expression Violation message.

This string confuses the API client showing a violation message instead of having a Regex. Any informatory message for the client should be placed in "description"

* fix tests

* fix typo
2020-07-04 16:27:40 +02:00