713 Commits

Author SHA1 Message Date
Christopher Davis
10d6d57ca7 Remove Some Trailing Comma 2021-11-06 07:42:38 -05:00
Christopher Davis
477442588a Fix CS 2021-11-06 07:42:38 -05:00
Christopher Davis
76949ca537 Fix a Deprecated Method Call on Symfony 5.3 2021-11-06 07:42:33 -05:00
Christopher Davis
7357de9c16 Add a Configuration Option to Enable Validation Groups
If this was turned on by default, that seems like a _large_ BC break as
folks entire OpenAPI doc could change underneath them.

The config option defaults to false and users can enable it if they
desire.
2021-11-06 07:13:56 -05:00
Christopher Davis
cc962b72c8 Add Validation Group Support to SymfonyConstraintAnnotationReader
This support is gated behind a flag as turning it on seems like it would
be a large backwards incompatible change.
2021-11-06 07:13:41 -05:00
jeremy
0ed76d7d24
Add Location of Original Template (#1897)
This doc page advises that one can `have a look at the original template to see which blocks can be overridden`, but does not say where the original template can be found.  This edit adds that information so that users don't have to resort to searching for keywords (like I just had to).

Note that I haven't run any tests as this is a docs-only change.
2021-11-04 00:13:42 +01:00
Guilhem Niot
e16d1fedb9 Fix CS 2021-11-04 00:09:07 +01:00
Guilhem Niot
200ec0fdcb Merge branch '3.x' 2021-11-04 00:06:42 +01:00
Vladislav
35cf37e338
Fix #1885 update psr/log and psr/container (#1892)
Co-authored-by: Vlad Gaiduk <uahaiduk@gmail.com>
2021-11-03 23:57:21 +01:00
Guilhem Niot
a2775b5c10
Update outdated swagger annotations namespace (#1898) 2021-11-03 23:55:56 +01:00
Samaël tomas
efa83ca54e
Fix OpenApiRenderer list could be null (#1881)
Co-authored-by: Samael tomas <samael.tomas@wizbii.com>
2021-10-19 14:29:11 +02:00
Quentin Stoeckel
653a1f1776
Fix path to index.html.twig in documentation (#1883)
This fixes a minor typo in [*Re-add Google Fonts* part of the documentation](https://symfony.com/bundles/NelmioApiDocBundle/current/faq.html#re-add-google-fonts): using an uppercase `i` breaks template override.
2021-10-06 19:29:54 +02:00
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
Guilhem Niot
9c729ab7b7
Fix support without twig (#1878)
* fix support without twig

* Support null openApiRenderer

* Register a twig extension instead of registering twig function at runtime

* fix tests
2021-09-22 23:43:32 +02:00
Guilhem Niot
b53edda10c
Merge pull request #1842 from zdenekdrahos/html-dump
Dump documentation to a static HTML and YAML file
2021-09-03 20:28:19 +02:00
Guilhem Niot
67bd715eac
Merge pull request #1869 from Nemrtvej/mm-update-swagger-ui
Update swagger-ui to 3.52.0
2021-09-03 20:27:08 +02:00
Marek Makovec
d73dd8ffe3 Update swagger-ui to 3.52.0 2021-09-01 17:45:49 +02:00
Zdeněk Drahoš
22b1a7e8d1 Add @internal to renderer classes 2021-08-28 08:29:07 +02:00
Guilhem Niot
69d07979d3
symfony/property-info is a mandatory dependency 2021-08-27 17:20:17 +02:00
Guilhem Niot
2f25ca63e9
Merge pull request #1863 from onatskyy/fix_getCollectionValueType_deprecation
Fix Symfony\Component\PropertyInfo\Type::getCollectionValueType() deprecation notice for symfony >=5.3
2021-08-27 17:06:50 +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
Alexander Onatskiy
0667881cdb Fix Symfony\Component\PropertyInfo\Type::getCollectionValueType() deprecation notice for symfony >=5.3 2021-08-18 16:12:47 +03:00
Martin Rademacher
74a440a2b1
Always provide a context to swagger-php (#1860)
The next swagger-php release will make `context` a required parameter
for `Analysis` and adding annotations to it.
2021-08-17 21:52:21 +02:00
Asmir Mustafic
985b43fb60
log name collisions (#1862) 2021-08-17 21:51:11 +02:00
Guilhem Niot
6ebb9cc9b4
Merge pull request #1861 from goetas/test-jms
Improve jms testing by checking that collisions are not generated
2021-08-16 16:40:54 +02:00
Asmir Mustafic
0bcdc59b88
add missing typehint 2021-08-16 15:19:26 +02:00
Asmir Mustafic
497afa1361
improve testing by checking explicitly that collisions are not generated 2021-08-16 13:11:59 +02:00
Guilhem Niot
478fb2efe0 Merge branch 3.x 2021-08-03 10:25:50 +02:00
Fabien Salathe
74036e974a Remove dead code
Removed an unused property
2021-08-03 10:24:24 +02:00
Guilhem Niot
c097e27b69
Merge pull request #1804 from JeResilieMonContrat-com/form_child_documentation
Display non native form type childs description and title properly
2021-08-03 09:37:16 +02:00
Guilhem Niot
be014ff11b
Merge pull request #1830 from nelmio/ADDPROP
Fix additionalProperties support
2021-08-03 09:35:12 +02:00
Zdeněk Drahoš
1a21f1855e Enable overriding server url for yaml and json export from console 2021-07-29 12:22:54 +02:00
Zdeněk Drahoš
181f4b2763 Keep server_url from Request only in RenderOpenApi 2021-07-29 12:11:10 +02:00
Zdeněk Drahoš
1f29be85f4 Use json renderer in controller 2021-07-29 12:01:54 +02:00
Zdeněk Drahoš
1b9be28ad6 Enable dumping docs to yaml 2021-07-29 11:57:00 +02:00
Guilhem Niot
06bc5136d7
Merge pull request #1851 from javiereguiluz/patch-3
[Doc] Fix some minor RST issues
2021-07-18 18:59:37 +02:00
Javier Eguiluz
5232463cad
[Doc] Fix some minor RST issues 2021-07-16 17:39:22 +02:00
Zdeněk Drahoš
2c890ff93b Hotfix testing private service in Symfony < 5.3
https://github.com/nelmio/NelmioApiDocBundle/runs/3031148906?check_suite_focus=true#step:7:106
Error: Call to undefined method Nelmio\ApiDocBundle\Tests\Render\Html\GetNelmioAssetTest::getContainer()

https://symfony.com/blog/new-in-symfony-4-1-simpler-service-testing
In practice, tests based on WebTestCase and KernelTestCase now access to a special container via the static::$container property that allows fetching non-removed private services:

https://github.com/symfony/symfony/blob/5.3/CHANGELOG-5.3.md#changelog-for-53x
feature #40366 [FrameworkBundle] Add KernelTestCase::getContainer() (Nyholm)
static $container @deprecated since Symfony 5.3, use static::getContainer() instead
2021-07-10 18:00:11 +02:00
Javier Eguiluz
d107dc6dd6
[Doc] Fix a minor syntax issue (#1846) 2021-07-09 19:03:13 +02:00
Zdeněk Drahoš
9cb6006b69 Refactoring including assets 2021-06-27 10:00:43 +02:00
Zdeněk Drahoš
5124f07ece Enable dumping html docs with cdn and offline assets 2021-06-27 09:24:35 +02:00
Zdeněk Drahoš
4ebee933c4 Extract rendering docs from command and controller 2021-06-27 08:41:33 +02:00
Alexander Melihov
2df454c0c3
Compound validation rule support (#1818)
* Compound validation rule support

* Compound validation rule support

* Compound validation rule support

* Compound validation rule support

* Remove duplicated method

* error during merge

* wrong variable name

* Simplify PR

* Fix CS

* Use same indentation as before

Co-authored-by: Guilhem Niot <guilhem@gniot.fr>
Co-authored-by: Guilhem Niot <guilhem.niot@gmail.com>
2021-06-16 09:59:06 +02:00
Guilhem Niot
187f55941c Merge branch 3.x 2021-06-14 13:28:23 +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
Guilhem Niot
1023ae2453 Merge branch 3.x 2021-06-14 13:25:30 +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
b2c5b619a6
Merge pull request #1833 from NicolasCharpentier/NicolasCharpentier-patch-symfony-validator-optional-dependency
Add a check for Constraint class existing before using it
2021-06-14 13:23:15 +02:00
Nicolas
bd952b170e
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-11 07:23:54 +02:00
Guilhem Niot
ee00f02a48 Fix additionalProperties support 2021-06-07 19:23:02 +02:00