169 Commits

Author SHA1 Message Date
Cyril VERLOOP
205828d18d
Fix typo "expect" to "except" in documentation. (#2008) 2022-07-15 23:16:37 +02:00
Guilhem Niot
dcc1cd8964
Fix parameter sharing example (#2004) 2022-06-11 09:56:29 +02:00
Christopher Davis
235963df41
Merge pull request #1902 from chrisguitarguy/constraint_groups
Respect Constraint Validation Groups When Describing Models
2022-06-10 16:15:42 -05:00
Guilhem Niot
b2b6d0f798
Merge pull request #1999 from chrisguitarguy/rm_inline_styles
Remove Inline Styles in Favor of the Stylesheet
2022-06-10 21:27:23 +02:00
Guilhem Niot
ee1fabe245
Merge pull request #2003 from nelmio/GuilhemN-patch-2
Clarify default policy on routes
2022-06-03 19:14:32 +02:00
Guilhem Niot
ba28741721
Merge pull request #2000 from stopfstedt/with_annotation
corrects config option name in docs.
2022-05-31 14:19:20 +02:00
Guilhem Niot
7520ef407f
Clarify default policy on routes 2022-05-31 14:17:59 +02:00
Guilhem Niot
ed33ee8e4a
Fix the docs 2022-05-31 14:09:25 +02:00
Stefan Topfstedt
89194219f9 corrects config option name in docs. 2022-05-18 11:55:35 -07:00
Christopher Davis
49bad6743c Remove Inline Styles in Favor of the Stylesheet
Should fix https://github.com/nelmio/NelmioApiDocBundle/issues/1770
2022-05-16 08:56:52 -05:00
Christopher Davis
a697792092 Merge remote-tracking branch 'origin/master' into constraint_groups 2022-05-12 18:45:41 -05:00
Guilhem Niot
7bc9462e7e Fix DOCtor-RST errors 2022-05-12 23:59:36 +02:00
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
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
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
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
Bartłomiej Jakub Kwiatek
a362f869ad
correct indentation in configuration example 2022-03-04 20:09:11 +01: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
c3525ec9c9 Update Swagger-ui to version 4.1.3 2022-01-05 16:18:00 +01:00
Guilhem Niot
ade4b6c17c
Merge branch 'master' into constraint_groups 2021-12-19 11:38:47 +01:00
jeremy
babf788636
Proposal: Add `header_block` Twig Block (#1896)
* Adding ``header_block`` Twig Block

In attempting to remove the default green header from the API docs (I am integrating the docs into a site that already has a header), I have found that the only possible way to do so is to overwrite the entire ``index.html.twig`` file.  This is because the existing ``{% header %}`` twig tags are placed *inside* the ``<header>`` HTML tags.  So, if one overrides the ``{% header %}`` block, it only adjusts the header content, as opposed to allowing control over the entire header object.

To resolve this problem I considered two methods:

- Move the existing ``{% header %}`` tags _*outside*_ of the ``<header>`` tags.  This would resolve the problem in the simplest fashion, but would be a breaking change for those currently overriding the block.

- Add a new twig block, placing its tags *_outside_* the existing ``<header>`` tags.  This would leave the existing functionality as-is, and would not break any current implementations.

I chose the latter for the reasons specified above, and suggested the name ``{% header_block %}``.  Thanks for considering this proposal.

* Add Location of Original Twig Template

This doc page advises that one can `have a look at the original template to see which blocks can be overridden`, but does not say where the original template can be found.  This edit adds that information so that users don't have to resort to searching for keywords (like I just had to).

Note that I haven't run any tests as this is a docs-only change.
2021-12-11 14:41:46 +01:00
Guilhem Niot
a184cb8ef4
Fix deprecations (#1923) 2021-12-11 14:19:43 +01:00
Christopher Davis
7357de9c16 Add a Configuration Option to Enable Validation Groups
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.
2021-11-06 07:13:56 -05:00
jeremy
0ed76d7d24
Add Location of Original Template (#1897)
This doc page advises that one can `have a look at the original template to see which blocks can be overridden`, but does not say where the original template can be found.  This edit adds that information so that users don't have to resort to searching for keywords (like I just had to).

Note that I haven't run any tests as this is a docs-only change.
2021-11-04 00:13:42 +01: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
Guilhem Niot
9c729ab7b7
Fix support without twig (#1878)
* fix support without twig

* Support null openApiRenderer

* Register a twig extension instead of registering twig function at runtime

* fix tests
2021-09-22 23:43:32 +02:00
Guilhem Niot
b53edda10c
Merge pull request #1842 from zdenekdrahos/html-dump
Dump documentation to a static HTML and YAML file
2021-09-03 20:28:19 +02:00
Marek Makovec
d73dd8ffe3 Update swagger-ui to 3.52.0 2021-09-01 17:45:49 +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
Zdeněk Drahoš
1a21f1855e Enable overriding server url for yaml and json export from console 2021-07-29 12:22:54 +02:00
Zdeněk Drahoš
1f29be85f4 Use json renderer in controller 2021-07-29 12:01:54 +02:00
Zdeněk Drahoš
1b9be28ad6 Enable dumping docs to yaml 2021-07-29 11:57:00 +02:00
Javier Eguiluz
5232463cad
[Doc] Fix some minor RST issues 2021-07-16 17:39:22 +02:00
Javier Eguiluz
d107dc6dd6
[Doc] Fix a minor syntax issue (#1846) 2021-07-09 19:03:13 +02:00
Zdeněk Drahoš
9cb6006b69 Refactoring including assets 2021-06-27 10:00:43 +02:00
Zdeněk Drahoš
5124f07ece Enable dumping html docs with cdn and offline assets 2021-06-27 09:24:35 +02:00
Zdeněk Drahoš
4ebee933c4 Extract rendering docs from command and controller 2021-06-27 08:41:33 +02:00
Victor Passapera
730feba2d9 Updates documentation to show a side effect of design decision.
When using serializer context groups in JMS serializer, even if just using the Default group in one place explicitly and leaving it blank in another, they will be treated as different component schemas, even though to the serializer outcome they are the same.

Documenting behavior of decision with side effect.
2021-05-30 21:00:03 -07:00
Alexandru Năstase
9b258b10bb Add extra name_patterns example to areas docs
Add an extra `name_patterns` example to areas docs
2021-05-09 17:25:00 +02:00
Alexandru Năstase
791b0ce15d
Add extra name_patterns example to areas docs
Add an extra `name_patterns` example to areas docs
2021-05-07 16:56:52 +02:00
Guilhem Niot
a7573897fb Merge branch '3.x' 2021-04-23 15:18:59 +02:00