18 Commits

Author SHA1 Message Date
Guilhem Niot
dcc1cd8964
Fix parameter sharing example (#2004) 2022-06-11 09:56:29 +02:00
Guilhem Niot
7bc9462e7e Fix DOCtor-RST errors 2022-05-12 23:59:36 +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
Guilhem Niot
200ec0fdcb Merge branch '3.x' 2021-11-04 00:06:42 +01:00
Quentin Stoeckel
653a1f1776
Fix path to index.html.twig in documentation (#1883)
This fixes a minor typo in [*Re-add Google Fonts* part of the documentation](https://symfony.com/bundles/NelmioApiDocBundle/current/faq.html#re-add-google-fonts): using an uppercase `i` breaks template override.
2021-10-06 19:29:54 +02:00
Frederik Holz
aa18c6c83b
[3.x]: Hide the default section per area with new config parameter (#1868)
* Add new config node disable_default_routes to prevent registering RouteDescriber to specific areas which allowes disabling rendering of default routes, Adjust tests accordingly

* Add documentation for new config variable

* Change disable_default_routes to filter route collection instead of disabling route describer, Add test for new handling in FilteredRouteCollectionBuilder

* Change naming of matching method for disabling default routes

* Fix codestyle issue

* Fix codestyle issue

* Change naming of dataProvider to match testing name

Co-authored-by: Frederik Holz <team-orange@auxmoney.com>
2021-10-06 19:28:59 +02:00
Mathieu Ducrot
1306106931
Update templates comment path for bundle override (#1864)
## Changelog

Fix the comment path from SwaggerUI to SwaggerUi since case does matter for template override to work.
2021-08-23 12:06:14 +02:00
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
Gripinskiy Sergey
57f8cf4634 Question about @SWG\Tag annotation added to FAQ (#1525) 2019-06-15 15:22:54 +02:00
Quentin Stoeckel
1e9585a415 faq.rst: enhance readability in symfony.com docs (#1420)
It may be a bit less readable on GitHub though.
2018-10-31 16:34:46 +01:00
Quentin Stoeckel
6c6a04bba7 Various documentation enhancements (#1423) 2018-10-31 16:33:06 +01:00
David Buchmann
ca118c0fcc
complete example for template in faq 2018-07-16 14:15:27 +02:00
Markus Poerschke
c771c684a8 Customizable template and remove Google Fonts (#1357)
* Allow to override certain parts of the template

* Twig template can be defined via config
* Blocks can be used to override/extend only parts of the template

* Fix spelling in documentation

* Fix extension configuration tree

* Fix unit tests by making constructor argument optional

* Add fonts block and split swagger initialization into own block

* Fix code style

* Remove Google fonts, remove configuration and add changelog entry

* Remove template argument from service definition

* Add correct path for overriding template

* Move re-add of Google Fonts to FAQ section in documentation.

* Remove unused class import
2018-07-16 09:45:18 +02:00
David Buchmann
d0e16d6001 adjust to feedback 2018-05-08 08:08:20 +02:00
David Buchmann
16fa7cf618 add more entries to the faq 2018-05-07 10:05:03 +02:00
Guilhem Niot
9bf00b5196 Support @Model through ref 2018-03-22 18:37:29 +01:00
Guilhem N
37dfb8ef0d Document how to customize models documentation (#1237) 2018-02-20 09:59:00 +01:00
Roman Borysenko
c048adf7b7 Update index.rst (#1223)
* Update index.rst

* Create faq.rst

Frequently Asked Questions added

* Update faq.rst

* Update index.rst

Comment removed

* Update index.rst

* Update index.rst

* Update index.rst

* Update index.rst

* Update index.rst
2018-02-13 17:13:09 +01:00