836 Commits

Author SHA1 Message Date
Christopher Davis
ccd3689faa Expand the Documentation on Groups to Include Validation
With some examples of objects and the use of model as well as some
implications for generated code.
2022-05-11 08:52:48 -05:00
Christopher Davis
6b2ef45b24 Merge remote-tracking branch 'origin/master' into constraint_groups 2022-05-11 08:18:52 -05:00
Christopher Davis
d27cc8fc3b
Merge pull request #1994 from virtualize/master
fixed doc typo that broke the models section
2022-05-11 08:07:17 -05:00
Christoph Wieseke
fdb2182834
fixed doc typo the broke the models section 2022-05-09 16:31:09 +02:00
Tobias Sette
f66ab2a516
docs(commands.rst): fix command name (#1989) 2022-05-02 22:39:33 +02:00
Christopher Davis
da02f3ad33
Stop Model Property Description When a Schema Type or Ref is Already Defined (#1978)
* 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
2022-04-30 20:28:05 +02:00
Krystian Marcisz
6ac4f07872
[Docs] Add PHP Attributes examples (#1985)
* [Docs] Add PHP Attributes examples

* Fix namespaces
2022-04-30 20:25:41 +02:00
Guilhem Niot
cb03d99c97 Remote Context::root() usage 2022-04-30 20:20:38 +02:00
Guilhem Niot
5d747aefc3 fix CS 2022-04-30 20:10:00 +02:00
Guilhem Niot
52e7fc4de1 Use the same root context everywhere 2022-04-30 20:07:44 +02:00
Benjamin Georgeault
42349cb4cf Add previous exception to BadRequestHttpException on SwaggerUiController. Improve debug. 2022-04-27 10:08:37 +02:00
Guilhem Niot
05d16e6814
Add links to swagger php examples 2022-04-21 23:36:09 +02:00
Valentin Salmeron
35ea6f2759
Update areas.rst (#1983)
* Update areas.rst

'with_annotations' option is not mentioned in actual documentation

* Slight changes

* Rephrase
2022-04-21 23:18:01 +02:00
Guilhem Niot
f8c030d096
Improve "no describer found" error message (#1979) 2022-04-13 19:54:31 +02:00
Guilhem Niot
fca94057d2 Merge remote-tracking branch 'origin/master' into constraint_groups 2022-04-13 19:43:23 +02:00
Baptiste Lafontaine
1302bc7568
Create an enum model describer (#1965)
* Create an enum model describer

* Bump Api-Platform

Co-authored-by: Guilhem Niot <guilhem@gniot.fr>
2022-04-04 11:42:44 +02:00
Guilhem Niot
2295f68b89
Add support of inline path parameters (#1973)
* Add support of inline path parameters

* Fix CS
2022-03-28 14:37:14 +02:00
Guilhem Niot
8111ce645b
Reproduce and fix duplicate operation id errors (#1972)
* Replicate and fix duplicate operation id errors

* Fix CS
2022-03-28 14:36:03 +02:00
Guilhem Niot
9cd417efb4
Merge pull request #1969 from nelmio/TESTS
Fix the tests
2022-03-24 15:14:49 +01:00
Guilhem Niot
a39317726a CS 2022-03-21 17:04:37 +01:00
Guilhem Niot
e722f642ad Fix the tests 2022-03-21 17:03:22 +01:00
Guilhem Niot
625aa151f0
Merge pull request #1966 from Flower7C3/patch-1
correct indentation in configuration example
2022-03-21 16:46:36 +01:00
Bartłomiej Jakub Kwiatek
a362f869ad
correct indentation in configuration example 2022-03-04 20:09:11 +01:00
Guilhem Niot
8fb8d90f24
Update link to zircote/swagger-php upgrade documentation 2022-02-28 11:54:53 +01:00
Guilhem Niot
7d827d5141
Merge pull request #1955 from thomaspicquet/master
Fixed Areas attribute to work like the documentation specifies
2022-02-28 11:52:28 +01:00
Thomas Picquet
405a5247e1 check $properties['value'] is not empty 2022-02-02 08:47:26 -08:00
Guilhem Niot
5ed0d31294
Merge pull request #1954 from jackcutting/allow-complete-override-of-security
Allow global security policies to be removed
2022-02-01 16:11:57 +01:00
Thomas Picquet
f363eeef66 set value key 2022-01-28 07:40:09 -08:00
Thomas Picquet
5b51214765 styleci fix 2022-01-28 07:38:19 -08:00
Thomas Picquet
11f61af93b keep it BC 2022-01-28 07:37:28 -08:00
Thomas Picquet
ebde54f251 style fix 2022-01-28 07:34:08 -08:00
Thomas Picquet
53954031b5 Fixed Areas attribute to work like the documentation specifies 2022-01-28 07:30:39 -08:00
Jack Cutting
4bc12f1034 Add link to Security documentation to the Learn More section 2022-01-26 17:39:42 +00:00
Jack Cutting
9545a0ce52 Allow security policies to be removed using the Security annotation by passing it a name of null. 2022-01-26 17:33:35 +00:00
Guilhem Niot
1885d25cd9
Merge pull request #1948 from nelmio/GuilhemN-patch-2
Allow more versions of phpdocumentor/reflection-docblock
2022-01-10 17:10:58 +01:00
Guilhem Niot
4b9905fe8b Allow more versions of phpdocumentor/reflection-docblock 2022-01-10 17:10:13 +01:00
Guilhem Niot
3bc05aa6dc
Merge pull request #1949 from nelmio/FIXTESTS
Fix the tests
2022-01-10 17:09:09 +01:00
Guilhem Niot
e0b25e5580 zircote/swagger-php attributes were moved to Attributes namespace 2022-01-10 17:08:13 +01:00
Guilhem Niot
411cb4c27d Do not use open api version from api-platform 2022-01-10 16:50:49 +01:00
Guilhem Niot
43212d9b7e Context::getRootContext() was removed 2022-01-10 16:50:45 +01:00
Guilhem Niot
d14471d403
Merge pull request #1946 from nelmio/SWAGGERUI
Update Swagger-ui to version 4.1.3
2022-01-05 16:23:18 +01:00
Guilhem Niot
a928d69609
Merge pull request #1942 from sdaoudi/patch-1
Fixed minor typo
2022-01-05 16:22:44 +01:00
Guilhem Niot
c3525ec9c9 Update Swagger-ui to version 4.1.3 2022-01-05 16:18:00 +01:00
DAOUDI Soufian
49deb52322
Fixed minor type 2021-12-29 22:18:35 +01:00
Guilhem Niot
cc6731ae77
Merge pull request #1938 from magnetik/1937
Fixes symfony serializer being mandatory
2021-12-23 15:15:40 +01:00
Baptiste Lafontaine
a4e8de7a75 Fixes symfony serializer being mandatory 2021-12-23 14:13:06 +01:00
Guilhem Niot
16608de67f Merge branch '3.x' 2021-12-22 11:31:52 +01:00
Guilhem Niot
ced932b8e7
Test more PHP 8.1 attributes support (#1936)
* Test `@Areas` as a php 8.1 attribute

* Test `@Security` as PHP 8.1 attribute
2021-12-21 16:39:08 +01:00
Alex Kalineskou
cc97b0ba45
Add support for php attributes (#1932)
* Add support for php attributes

* Fix tests for php 8.1

* Simplify the annotations

* Revert the changes to the tests

* CS

* Test FOSRest parsing of attributes

* CS

* typo

* CS

* Test fetchArticle php 8.1 attributes

* Fix namespaces

Co-authored-by: Guilhem Niot <guilhem@gniot.fr>
2021-12-21 16:16:14 +01:00
Guilhem Niot
3d263a525d
Merge pull request #1933 from nelmio/SF6
Use an early version of Api-platform with symfony 6 support in one test case
2021-12-21 13:53:56 +01:00