50 Commits

Author SHA1 Message Date
Filip Benčo
78664ef9ec
OpenApi 3 Support (#1623)
* Initial pass for OA3 upgrade

* Fix Util Tests

* Fix first batch of Unit Tests. Up to Model

* Another batch of fixed tests

* Update annotations

* Convert Model & Property Describers

* Update tests, Fix RouteDescribers, FIx additional bugs

* Another batch of updates

* Another batch of fixed Functional Tests

* Fix FunctionalTest tests

* Fix Bazinga Tests

* FIx FOS Rest

* Fix JMS TEsts & describers

* Fix all Tests

* Fix few stuff from own CR

* CS Fixes

* CS Fixes 2

* CS Fixes 3

* CS Fixes 4

* Remove collection bug

* Updates after first CRs

* CS

* Drop support for SF3

* Update the docs

* Add an upgrade guide

* misc doc fixes

* Configurable media types

* Code Style Fixes

* Don't use ::$ref for @Response and @RequestBody

* Fix upgrading guide

* Fix OA case

Co-authored-by: Filip Benčo <filip.benco@websupport.sk>
Co-authored-by: Guilhem Niot <guilhem.niot@gmail.com>
Co-authored-by: Mantis Development <mantis@users.noreply.github.com>
2020-05-28 13:19:11 +02:00
Asmir Mustafic
2fd95e2242
add support for jms serializer inline property feature 2020-05-07 20:02:10 +02:00
Asmir Mustafic
eb255010a0 Support typed embedded relation with willdurand/hateoas 3.0 (#1510)
* allow typed embedded relation with hateoas 3.0

* symfony/framework-bundle 4.2.7 is broken

https://github.com/symfony/symfony/pull/31156

* internal public methods
2019-05-02 10:02:16 +02:00
Asmir Mustafic
65e940f7f8
use jms serialization groups detection 2019-04-17 22:05:30 +02:00
Asmir Mustafic
d6ea99420e Allow model describers on jms custom types (#1495)
* allow model describers on jms custom types

* add fallback describer

* test custom type def

* remove object_fallback describer from the container when jms is not active
2019-04-16 12:13:33 +02:00
Asmir Mustafic
0fb5d7afa2
jms 2.0 groups tested 2019-01-26 21:03:21 +01:00
Asmir Mustafic
d15b4123c1
add hateoas v3 compat 2019-01-26 20:55:52 +01:00
Guilhem N
0bca7f377d
Merge pull request #1447 from AyrtonRicardo/master
Change validation to allow fields described as DateTimeInterface.
2019-01-02 23:20:13 +01:00
Romain BigZ Richard
9968027aad feature: Add new validation from constraints.
- Add minimum and maximum from the range annotation
- Add maximum from the LessThan and LessThanOrEqual annotation

FIX: remove the extra date-time format, which was not standard and not in sync with what symfony exposes
Swagger specifies that date-time should follow the RFC3339, and this is what symfony does as default.
2018-12-19 16:25:14 +01:00
Ayrton Ricardo
2ddf4362c0 Change validation to allow fields described as DateTimeInterface. 2018-12-10 14:21:09 +01:00
Michael Moll
d37a543502 fix codestyle errors 2018-11-11 20:31:50 +01:00
Asmir Mustafic
9bae1115d6 jms serializer group names are based on the internal property name, not on the serialized name (#1421) 2018-10-17 17:19:37 +02:00
Piotr Antosik
a9d6b3fd46
Fix choice annotation with callback method name without class 2018-09-26 16:51:43 +02:00
Pavel Batanov
995ade1c8d Respect property name for constraints 2018-09-11 13:42:50 +03:00
Guilhem N
99833189fd
Ignore Type::$nullable (#1391) 2018-08-30 01:10:36 +02:00
Guilhem N
fcb36d8e8d
AssertLength doesn't make the field required (#1389) 2018-08-30 00:32:11 +02:00
Asmir Mustafic
bd26696f8f respect jms serializer nested group exclusion 2018-08-26 22:58:35 +02:00
Javier Spagnoletti
df9893428e [JMSModelDescriber] Allow to use free form objects from JMS serialization (#1368)
* [JMSModelDescriber] Allow to use free form objects from JMS serialization

* Remove unused variable

* Refactor `describeItem()`

* Add more tests

* early detect of free form objects

* Add test for array property without type

* Merge `findPropertyType()` and `registerPropertyType()` methods

* Update `registerPropertyType()` in order to set "object" as type for arrays with undefined item types

* Set "additionalProperties" definition for arrays without defined items

* Simplified `registerPropertyType()`

* Merged `registerPropertyType()` into `describeItem()`

* Fix comment

* Fix comment
2018-08-21 17:41:32 +02:00
Asmir Mustafic
09e6f30572 Jms serializer default groups should not generate new definitions when possible (#1367)
* if the group does not define per property exclusion, then remove possible obsolete property exclusions

* if the group is using only the default group, then is as not defining a group

* test that the user does not get a new alias just because another property pf the same object has some groups

* use strict comparison
2018-07-26 14:14:26 +02:00
Javier Spagnoletti
1063972c27 [JMSModelDescriber] Update JMSModelDescriber in order to iterate over nested array definitions (#1365) 2018-07-23 18:35:05 +02:00
Guilhem N
abc3e71114
Fixes tests 2018-06-03 19:19:29 +02:00
Palluel-Lafleur Frédéric
c2f036c159 fix(SymfonyConstraintAnnotationReader): fixed enum guessing in Assert… (#1325)
* fix(SymfonyConstraintAnnotationReader): fixed enum guessing in Assert\Choicewhen callback parameter is used

* fix(SymfonyConstraints): turn double quotes in single quotes
2018-05-20 15:59:52 +02:00
Guilhem N
304b3f5816
Merge pull request #1313 from phansys/modeldescriber
Normalize description for classes implementing `\DateTimeInterface`
2018-05-05 23:20:03 +02:00
Asmir Mustafic
4253ff6b67 Merge pull request #1277 from goetas/bazinga-hateoas
Add basic BazingaHateoasBundle support
2018-05-05 14:49:17 +02:00
Javier Spagnoletti
dbd2076921 Normalize description for classes implementing \DateTimeInterface 2018-05-04 15:22:18 -03:00
Asmir Mustafic
c5b1d538f8 Improve support for JMS dictionaries (associative arrays) (#1301)
* improve support for JMS dictionaries (associative arrays)

Doc: https://swagger.io/docs/specification/data-models/dictionaries/

* use schema merge instead of reflection
2018-04-21 16:57:37 +02:00
Guilhem Niot
8026ff46eb Support `@Model` in in-object annotations 2018-03-22 19:14:01 +01:00
Guilhem Niot
7d99a96cf4 Allow to change a property name 2018-02-19 21:42:56 +01:00
Martijn van Kempen
c72085a507 Added test for the Symfony constraints (#1213)
* Added test for the Symfony constraints

* Added missing ,

* Removed whiteline

* Moved test from JMS to FunctionTest

* Style ci changes

* Removed unused code

* Removed use
2018-02-05 18:39:58 +01:00
Martijn van Kempen
b07043ce33 Added Symfony constraint annotation reader (#1202)
* Added Symfony constraint annotation reader

* StyleCI analysis changes

* StyleCI analysis

* StyleCI analysis

* No longer adding the constraint description for NotBlank and NotNull

* Updated doc comment

* Removed @param

* Removed the AbstractComparison condition

* Using Assert and removed unused method
2018-01-25 14:59:48 +01:00
Robert Gruber
fe9d12772b Add some missing property attributes for JMS model describer (#1196)
* Add some missing property attributes for JMS model describer

* Introduce own Swagger definition annotation reader

* Shorten annotation mapping by using merge
2018-01-24 15:20:20 +01:00
Guilhem N
73a5f104d6
Use @SWG\Parameter type when set instead of throwing (#1174)
* Add an exception

* Just use the manually defined type when set

* Update the jms model describer
2018-01-11 12:26:59 +01:00
Guilhem Niot
eb77f3708c Cleanup 2018-01-04 11:34:23 +01:00
Guilhem N
48107de67d
Merge branch 'master' into complex_groups 2017-12-21 17:17:36 +01:00
David Buchmann
66872da552 add functional test for docblock model describer 2017-12-19 08:58:48 +01:00
Guilhem Niot
f03e33f551 Fix CS 2017-12-18 21:07:44 +01:00
Myroslav
ac7b924129 Read more properties from swagger property annotation (#1146)
* read default property from swagger property annotation

* read enum from swagger property annotation

* a small fixes
2017-12-17 16:58:41 +01:00
Guilhem Niot
a4fe1f8078 Fix CS 2017-12-17 10:44:07 +01:00
Christian Schiffler
8da1ac0296 Pass real property to swagger annotation reader
The type invariation (changing from the real property to the sub items
definition) causes the swagger annotations to end up on the created
`Items` entry.
This changes the behaviour to update the real property entry with the
swagger annotation.

Additionally this ensures that "description", "title" and "example" are
only updated on `Schema` instances.
2017-12-15 17:39:18 +01:00
Kori
29ec20bda1 Fix exception when attempting to read swagger annotation for virtual property (#1136)
* Fix exception when attempting to read swagger annotation for virtual property

* drop jms 1.0, add stopwatch for dependency
2017-12-09 14:31:56 +01:00
Yi Ping
d4bf23bcfb Fix complex groups for jms serializer 2017-12-08 10:38:49 +08:00
Myroslav
01f691c456 support swagger property annotation to extend description properties of model (#1125)
* support swagger property annotation to descripe properties of model

* support swagger property annotation to descripe properties of model

* fix issues from PR review

* rename method

* remove redundant annotations and revert changes into composer.json

* fix issues from PR comments

* use symfony 3 for default tests

* revert chages

* use symfony 3 for default tests

* revert changes in travis config
2017-12-03 19:30:44 +01:00
Guilhem Niot
1fb8371e80 Add DateTime support 2017-07-25 10:31:23 +02:00
Guilhem Niot
b8479d02e1 Add JMS serializer support 2017-07-25 10:09:41 +02:00
Guilhem Niot
9c0db1ea51 Fix symfony 4 support 2017-06-14 14:22:46 +02:00
Guilhem Niot
de40660341 Add groups support 2017-06-13 13:34:26 +02:00
Guilhem N
14ae741115
Add models support 2017-01-14 17:36:56 +01:00
Guilhem N
c797269bef
Change the vendor to "Nelmio" 2016-12-29 12:09:26 +01:00
Ener-Getick
c37d615071
Update dependencies 2016-07-29 18:40:56 +02:00
Ener-Getick
170249b369
Add ApiPlatform support 2016-07-29 10:22:40 +02:00