852 Commits

Author SHA1 Message Date
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
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
e1fef0a98f
Change in a config file 2021-03-23 14:29:59 +01:00
Thomas Lallement
a72588861f Add support for 'c' format 2021-03-16 11:05:00 +01:00
Thomas Lallement
56d4b78bf1 CS Fix 2021-03-16 10:48:12 +01:00
Thomas Lallement
a945a47e32 CS Fixes 2021-03-16 10:46:21 +01:00
Thomas Lallement
73ad2e3cdf Fix property naming 2021-03-16 10:42:37 +01:00
Thomas Lallement
7f9b00d620 Code improvements and add unit test 2021-03-16 10:40:12 +01:00
Javier Spagnoletti
b08bf79212 Fix calls to nonexistent method ControllerReflector::getReflectionClassAndMethod() 2021-03-14 17:19:25 +01:00
Javier Spagnoletti
bfd197fafd Let PHPUnit fail on warnings and risky tests 2021-03-14 17:18:13 +01:00
Guilhem Niot
a48fb7b48a
Merge pull request #1796 from phansys/autoload
Declare "autoload-dev" for `Nelmio\ApiDocBundle\Tests\` namespace
2021-03-14 17:11:27 +01:00
Guilhem Niot
a4d2c6f761
Merge pull request #1793 from derrabus/patch-1
Fix branch alias
2021-03-14 17:10:00 +01:00
Guilhem Niot
f857061475
Merge pull request #1791 from phansys/useless_checks
Remove old useless configurations from tests
2021-03-14 17:08:49 +01:00
Guilhem Niot
d3a7d9bc28
Merge pull request #1790 from phansys/deps
Use explicit dependency declarations
2021-03-14 17:08:12 +01:00
Guilhem Niot
5ece42591d Merge branch 'origin/3.x' 2021-03-14 17:05:31 +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
645531cf3e
Merge pull request #1789 from derrabus/feature/constraint-attributes
Added support for constraint attributes
2021-03-14 16:38:32 +01:00
Javier Spagnoletti
301da08cb3 Declare "autoload-dev" for Nelmio\ApiDocBundle\Tests\ namespace 2021-03-12 17:46:40 -03:00
Alexander M. Turek
deb80730e1
Fix branch alias 2021-03-12 13:16:07 +01:00
Alexander M. Turek
16221de418 Added support for constraint attributes 2021-03-12 10:57:40 +01:00
Javier Spagnoletti
3ef1549bf8 Use explicit dependency declarations 2021-03-12 00:35:44 -03:00
Javier Spagnoletti
64952d155c Remove old useless configurations from tests 2021-03-12 00:01:22 -03:00
Thomas Lallement
f2c75ebc9d
Fix Open API doc for DateTime requirements
When using the following requierement:

```
@Rest\QueryParam(name="updatedFrom", strict=true, nullable=true, requirements=@Constraints\DateTime("Y-m-d\TH:i:s"))
```

According to the OpenAPI 3.0 documentation https://swagger.io/specification/, we should have "format": "date-time" rather than "format": "DateTime" in the generated doc
2021-03-11 19:06:17 +01:00
Dmitry Pchelintsev
8f646b8484
allow areas annotation for controller class (#1528)
Co-authored-by: pchol <spchols@gmail.com>
Co-authored-by: Guilhem Niot <guilhem@gniot.fr>
2021-03-03 20:47:08 +01:00
Christopher Davis
883d7b6c89
Apply enum from Choice Constraints to Items When Choice is Multiple (#1784)
* Apply `enum` from Choice Constraints to Items When Choice is Multiple

Otherwise JSON schema like this is generated:

```
"property": {
  "type": "array",
  "enum": ["one", "two", "three"],
  "items": {
    "type": "string"
  }
}
```

With this change, however, this schema is generated:

```
"property": {
  "type": "array",
  "items": {
    "type": "string",
    "enum": ["one", "two", "three"]
  }
}
```

A possible downside here is that the symfony constraint stuff happens
before types are figured out from PHPDoc. So it's _possible_ to end up
with something that won't validated. Take something like this:

```
/**
 * @Assert\Choice(multiple=true, choices={"..."})
 * @var string
 */
```

This would generate:

```
"property": {
  "type": "string",
  "items": {
    "enum": ["..."]
  }
}
```

* Fix CS

* cs

* more cs

* fix tests

Co-authored-by: Guilhem Niot <guilhem@gniot.fr>
2021-02-19 09:41:32 +01:00
Guilhem Niot
ceda09fe85
Merge pull request #1781 from chrisguitarguy/fix_lengths
Check Min and Max in Length Constraints Before Setting in Schemas
2021-02-16 01:03:59 +01:00
Guilhem Niot
d074e05436
Merge pull request #1777 from saleh199/add_yaml_doc
Add Yaml Documentation
2021-02-16 01:01:33 +01:00
Christopher Davis
530311c489 Check Min and Max in Length Constraints Before Setting in Schemas
Sometimes folks will set a `min` length without a max, for instance and
the generated open api schema would previously have been nonsense:

```
"property": {
  "type":"string",
  "maxLength":0,
  "minLength":1
}
```
2021-02-10 10:33:55 -06:00
Saleh Saeed
774057a91a
Revert DocumentationController name 2021-02-08 22:54:21 +01:00
Guilhem Niot
1b4437d88a
Merge pull request #1776 from chrisguitarguy/discriminator_field
Support Polymorphism via the Symfony Discriminator Map
2021-02-08 22:46:49 +01:00
Christopher Davis
87004fc428 Don't Use ref in Discriminator mapping
Instead just include the schema ref directly per the documentation.
2021-02-08 15:39:14 -06:00
Guilhem Niot
1913b1ab23
Merge pull request #1774 from illuin-tech/master
Support oauth2 scopes in Security annotation
2021-02-08 22:17:01 +01:00