42 Commits

Author SHA1 Message Date
Guilhem Niot
523d28e955
Add annotations support at methods level when using the JMS serializer (#1682) 2020-07-18 13:31:41 +02:00
Asmir Mustafic
2fd95e2242
add support for jms serializer inline property feature 2020-05-07 20:02:10 +02:00
Guilhem Niot
d58b4a4d66 Apply fixes from StyleCI 2020-02-23 16:50:24 +00:00
Nadrshin
99f5d37601 Support JMS "bool" type (alias for "boolean") (#1547) 2019-11-14 21:06:26 +01: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
Guilhem N
73f07aac50
Tipo 2019-02-13 21:18:18 +01:00
Guilhem N
0414277d0a
Minor fix 2019-02-13 21:13:17 +01:00
Asmir Mustafic
fd7b5e1679
fix missing previous recursive call 2019-01-26 21:03:21 +01: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
Asmir Mustafic
66bcf02903
when the naming strategy is not available, we are using jms/serializer 2.0 2019-01-26 20:55:29 +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
Asmir Mustafic
7f78ef9ba6 Restore jms nested groups feature (#1402)
* fix missing variable definition

* fix caching typo

* do not pre allocate reserved names

* use model hash instead of spl hash

* register later the model
2018-10-10 17:24:13 +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
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
Guilhem N
f193fdb1f1
Inject the AnnotationsReader in Model describers instead of internal classes (#1203) 2018-01-24 19:58:38 +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
8a53891ee9
Merge pull request #1132 from 7thcubic/complex_groups
Fix complex groups context for jms models
2018-01-03 12:01:06 +01:00
David Buchmann
f4a9ad7ef7 do not fail if phpdocumentor is not available 2017-12-28 10:46:05 +01:00
David Buchmann
75cf1201ed Apply fixes from StyleCI 2017-12-22 17:42:18 +00:00
Guilhem N
48107de67d
Merge branch 'master' into complex_groups 2017-12-21 17:17:36 +01:00
David Buchmann
3fa948aee8 set up DI and add type support 2017-12-19 08:56:35 +01:00
David Buchmann
fe3629cdeb WIP parse phpdoc annotations in jms models 2017-12-19 08:56:35 +01:00
Yi Ping
3b81fa4f2f changes 2017-12-18 08:06:19 +08: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
Wesley Lancel
3adf8c3d97 Fix type for float / double for JMS models (#1077)
* Fix type for float / double for JMS models

* Set format for number type
2017-09-09 20:40:21 +02:00
Guilhem Niot
b8479d02e1 Add JMS serializer support 2017-07-25 10:09:41 +02:00