* Return a Result Object from AnnotationsReader::updateDefinition
This is so we can make a decision on whether or not a schema's type or
ref has been manually defined by a user via an `@OA\Schema` annotation
as something other than an object.
If it has been defined, this bundle should not read model properties any
further as it causes errors.
I put this in AnnotationReader as it seemed the most flexible in the
long run. It could have gone in `OpenApiAnnotationsReader`, but then any
additional things added to `updateDefinition` could be left out of the
decision down the road. This is also a convenient place to decide this
once for `ObjectModelDescriber` and `JMSModelDescriber`.
* Stop Model Describer if a Schema Type or Ref Has Been Defined
Via the result object added in the previous commit.
This lets user "short circuit" the model describers by manually defining
the schema type or ref on a plain PHP object or form. For example,
a collection class could be defined like this:
/**
* @OA\Schema(type="array", @OA\Items(ref=@Model(type=SomeEntity::class)))
*/
class SomeCollection implements \IteratorAggregate { }
Previously the model describer would error as it tries to merge the
`array` schema with the already defiend `object` schema. Now it will
prefer the array schema and skip reading all the properties of the
object.
* Add a Documentation Bit on Stopping Property Description
* Mark UpdateClassDefinitionResult as Internal
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.
* 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>
* 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
* fix missing variable definition
* fix caching typo
* do not pre allocate reserved names
* use model hash instead of spl hash
* register later the model
* [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
* 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
* Add some missing property attributes for JMS model describer
* Introduce own Swagger definition annotation reader
* Shorten annotation mapping by using merge