685 Commits

Author SHA1 Message Date
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
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
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
Javier Eguiluz
d107dc6dd6
[Doc] Fix a minor syntax issue (#1846) 2021-07-09 19:03:13 +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
Guilhem Niot
40dfcf4184
Merge pull request #1829 from nelmio/PROPACCESS
Explictly enable property access in the tests
2021-06-07 19:09:58 +02:00
Guilhem Niot
d8a7859484 Explictly enable property access in the tests (related to https://github.com/symfony/symfony/pull/40140, it is a dev dependency) 2021-06-07 19:04:16 +02:00
Guilhem Niot
6e7d681368
Merge pull request #1828 from nelmio/CACHE
Change the management of the cache of composer
2021-06-07 18:54:27 +02:00
Guilhem Niot
ce6ed1ee80 Change the management of the cache of composer 2021-06-07 18:52:44 +02:00
Guilhem Niot
5808651c19
Merge pull request #1820 from vpassapera/patch-1
Updates documentation to show a side effect of design decision regarding context groups with JMS serializer
2021-06-07 18:31:53 +02:00
Victor Passapera
730feba2d9 Updates documentation to show a side effect of design decision.
When using serializer context groups in JMS serializer, even if just using the Default group in one place explicitly and leaving it blank in another, they will be treated as different component schemas, even though to the serializer outcome they are the same.

Documenting behavior of decision with side effect.
2021-05-30 21:00:03 -07:00
Guilhem Niot
7f3926cc89
Merge pull request #1823 from chrisguitarguy/fix_constraints
Fix Count and Range Constraints
2021-05-27 13:25:30 +02:00
Christopher Davis
5f1645db40 Check min/max On Range Constraints Before Use
Previously it was possible to set only one of the min or max values and
get a schema like:

    "property": {
      "type": "integer",
      "minimum": 1,
      "maximum": 0
    }

Also possible that `Range` would be used with {min,max}PropertyPath and
you'd get a schema with both minimum and max set to zero.

With the checks in place, that's no longer the case.
2021-05-25 06:44:16 -05:00
Christopher Davis
7fd8c0ecfe Check if min and max Are Set on Count Constraints
It's possible to set a count constraint with a min but no max, which
would generate an OpenAPI Schema like...

    "property": {
        "type": "array",
        "minItems": 1,
        "maxItems": 0
    }

With this change the schema will only set `minItems` in that example.
2021-05-25 06:44:09 -05:00
Guilhem Niot
1899a9e7ba Merge branch '3.x' 2021-05-09 17:32:51 +02:00
Guilhem Niot
75794a74ec
Adapt https://github.com/nelmio/NelmioApiDocBundle/pull/1814 to 3.x 2021-05-09 17:32:00 +02:00
Guilhem Niot
a6f32712c8
Merge pull request #1814 from beerline/master
feature: Add new validation from constraints.
2021-05-09 17:29:40 +02:00
Guilhem Niot
8a60890a97 Merge branch 3.x 2021-05-09 17:26:35 +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
69dc435ecc
Merge pull request #1815 from alexandrunastase/patch-1
Add extra `name_patterns` example to areas docs
2021-05-09 17:21:16 +02:00
Alexandru Năstase
791b0ce15d
Add extra name_patterns example to areas docs
Add an extra `name_patterns` example to areas docs
2021-05-07 16:56:52 +02:00
beerline
d8231024c3 feature: Add new validation from constraints.
- Add minimum for GreaterThanOrEqual
- add minimum and exclusiveMinimum LessThanOrEqual annotation
2021-05-07 14:18:44 +02:00
Guilhem Niot
ef0ca8259d
Merge pull request #1810 from derrabus/bugfix/psr-cache-2-and-3
Allow psr/cache versions 2 and 3
2021-04-23 15:29:17 +02:00
Guilhem Niot
3832ad3481 CS 2021-04-23 15:21:04 +02:00
Guilhem Niot
a7573897fb Merge branch '3.x' 2021-04-23 15:18:59 +02:00
Alexander M. Turek
0f15282292 Allow psr/cache versions 2 and 3 2021-04-19 14:56:15 +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
Yoann Laissus
7858afec09 Display form type childs description and title properly 2021-03-30 14:42:47 +02:00
Guilhem Niot
bf77277f2f
Merge pull request #1788 from raziel057/patch-1
Fix Open API doc for DateTime requirements
2021-03-26 22:54:00 +01:00
Guilhem Niot
14975b3140
Update RouteDescriber/FosRestDescriber.php
Co-authored-by: Javier Spagnoletti <phansys@gmail.com>
2021-03-26 22:51:40 +01:00
tlallement
d6a2d1240a Fix for PHP 7.1 2021-03-24 18:10:45 +01:00
tlallement
0e7ebe5650 Small fixes for RFC3339 and new assertion 2021-03-24 18:01:32 +01:00