93 Commits

Author SHA1 Message Date
Alan Poulain
b9718f3400 Compatibility with Symfony 4.3 (#1524)
* Use twig instead of templating

* Fix at least one suite test in Travis

* Use Twig namespace (Twig > 1.10 and TwigBundle > 2.2)
2022-04-26 16:58:48 +03:00
Vitaliy Chesnokov
8a6213cbd2
Removed duplicated constraints in Format field. Improved format for field type of form 2019-04-29 12:39:48 +03:00
Vitaliy Chesnokov
d78f8887a9
Pass the data about field name and field class to template 2019-04-29 12:39:45 +03:00
Vitaliy Chesnokov
cd87930d29
Check the version in methods response 2019-04-25 21:50:32 +03:00
Adam Prager
7919b24971 Use the response map in the html view 2016-01-26 04:36:38 +01:00
Sullivan SENECHAL
32de80f97f
Fix deprecated route options 2015-10-22 14:42:16 +02:00
William Durand
0a1cef77ad
cs 2015-03-06 11:19:08 +01:00
Bez Hermoso
859421df9a Form errors parser. Mirrored actual form-errors response by FOSRest. Made sure that FieldErrors is not duplicated. 2014-10-10 11:59:19 -07:00
Martin Janser
b8cc4d9264 Fix parsing of filters, default values, descriptions and base path in SwaggerFormatter 2014-10-06 10:50:14 +02:00
Bez Hermoso
0d17c10b70 Collection handling fix. 2014-09-04 11:29:31 -07:00
Bez Hermoso
5fa69a0504 Tests for aliased collections; Swagger formatting for wrapped collections. 2014-09-04 11:19:54 -07:00
Bez Hermoso
480fcc5ecd Added clear() 2014-08-25 10:14:04 -07:00
Bez Hermoso
a5a13501e2 Alternate model naming strategy. 2014-08-25 10:14:04 -07:00
jaugustin
ae2c62fad1 add show/hide button and list/expand operations buttons on sections
add a new parameter default_sections_opened: false (default)
To start with sections opened or closed
2014-08-23 17:17:46 +02:00
Bez Hermoso
d99c209f7d Fix: 'items' parameter for collections in parameters. 2014-08-19 12:32:06 -07:00
William Durand
d32381d18d Merge pull request #476 from bezhermoso/swagger-collection-parameter
[Fix] Missing handling for DataTypes::COLLECTION in parameters (input)
2014-08-16 14:29:11 +02:00
Bez Hermoso
b289a6e846 Missing handling for DataTypes::COLLECTION in parameters (input) 2014-08-15 09:47:35 -07:00
Bez Hermoso
18004189b3 Ability to specify param-type of input class. 2014-08-14 12:41:27 -07:00
Bez Hermoso
b7f5fb58d4 Added definition when is provided. 2014-08-04 10:58:41 -07:00
Bez Hermoso
9824a6ba3c Added default value handling. 2014-07-29 10:25:06 -07:00
Bez Hermoso
abaeb374e8 Added 'type' to API item if applicable. 2014-07-29 10:25:06 -07:00
Bez Hermoso
9d3c0a8c29 Swagger support:
Unified data types [actualType and subType]
Updated tests.
JMS parsing fixes; updated {Validator,FormType}Parser, FOSRestHandler, and AbstractFormatter, and updated DataTypes enum.
Modified dataType checking.
Updated tests.
Updated DataTypes enum.
Quick fix and added doc comments.
CS fixes.
Refactored FormTypeParser to produce nested parameters. Updated tests accordingly.
Logical and CS fixes.
Sub-forms and more tests.
Logical and CS fixes.
Swagger support: created formatter.
Configuration and resourcePath logic update.
ApiDoc annotation update. Updated formatter and added tests.
Parameter formatting.
Added tests for SwaggerFormatter.
Added  option in annotation, and the corresponding logic for parsing the supplied values and processing them in the formatter.
Routing update.
Updated tests.
Removed unused dependency and updated doc comments.
Renamed 'responseModels' to 'responseMap'
Update the resource filtering and formatting of response messages.
Updated check for 200 response model.
Ignore data_class and always use form-type to avoid conflicts.
Fix: add 'type' even if '' is specified.
Refactored responseMap; added parsedResponseMap. Added tests and updated some.
Fix: add 'type' even if '' is specified.
Initial commit of command.
Finished logic for dumping files.
Updated doc comment; added license and added more meaningful class comment.
Array of models support.
2014-07-29 10:25:06 -07:00
Bez Hermoso
bb723bdb40 Added new tests for Swagger doc controllers. Also some CS fixes. 2014-07-29 10:25:06 -07:00
Bez Hermoso
ee0496af65 Update swagger-support.md 2014-07-29 10:25:05 -07:00
Bez Hermoso
6f85aed33c Swagger support:
Unified data types [actualType and subType]
Updated tests.
JMS parsing fixes; updated {Validator,FormType}Parser, FOSRestHandler, and AbstractFormatter, and updated DataTypes enum.
Modified dataType checking.
Updated tests.
Updated DataTypes enum.
Quick fix and added doc comments.
CS fixes.
Refactored FormTypeParser to produce nested parameters. Updated tests accordingly.
Logical and CS fixes.
Sub-forms and more tests.
Logical and CS fixes.
Swagger support: created formatter.
Configuration and resourcePath logic update.
ApiDoc annotation update. Updated formatter and added tests.
Parameter formatting.
Added tests for SwaggerFormatter.
Added  option in annotation, and the corresponding logic for parsing the supplied values and processing them in the formatter.
Routing update.
Updated tests.
Removed unused dependency and updated doc comments.
Renamed 'responseModels' to 'responseMap'
Update the resource filtering and formatting of response messages.
Updated check for 200 response model.
Ignore data_class and always use form-type to avoid conflicts.
Fix: add 'type' even if '' is specified.
Refactored responseMap; added parsedResponseMap. Added tests and updated some.
Fix: add 'type' even if '' is specified.
Initial commit of command.
Finished logic for dumping files.
Updated doc comment; added license and added more meaningful class comment.

Array of models support.
2014-07-29 10:25:05 -07:00
William DURAND
a817081ab2 Add missing array key checks
Fixes #423
2014-06-27 10:07:03 +02:00
Jonathan Chan
d4e12d66f2 Add default values support for form types
Adding displaying default value in Markdown

updating tests to work with new default value
2014-06-26 11:20:49 -04:00
William DURAND
39dd41e285 Merge pull request #388 from yoshz/feature/body_format
Added configuration to disable body formats
2014-06-25 10:30:56 +02:00
Bez Hermoso
14d1021c8b Unified data types [actualType and subType]
This is the result of https://github.com/nelmio/NelmioApiDocBundle/issues/410.

This PR aims to provide a uniform way of declaring data-types of parameters for
parsers and handlers to follow. In turn, this would allow formatters to
determine data-types in a cleaner and less volatile manner. (See use-case that
can be improved with this PR:
https://github.com/nelmio/NelmioApiDocBundle/blob/master/Formatter/AbstractFormatter.php#L103)

This is possible by the addition two properties to each property item in
`response`, and `parameters` fields in each API endpoint produced by the
`ApiDocExtractor`:

* `actualType` Contains a value from one of the `DataTypes` class constants.

* `subType` Can contain either `null`, or any other `DataTypes` class constant.
This is relevant when the `actualType` is a `DataTypes::COLLECTION`, wherein
`subType` would specify the type of the collection items. It is also relevant
when `actualType` is a `DataTypes::MODEL`, wherein `subType` would contain an
identifier of the model (the FQCN or anything the parser would wish to specify)

Examples:

```php

array(
    'id' => array(
        'dataType' => 'integer',
        'actualType' => DataTypes::INTEGER,
        'subType' => null,
    ),
    'profile' => array(
        'dataType' => 'object (Profile)',
        'actualType' => DataTypes::MODEL,
        'subType' => 'Foo\Entity\Profile',
        'children' => array(
            'name' => array(
                'dataType' => 'string',
                'actualType' => DataTypes::STRING,
                'subType' => null,
             ),
            'birthDate' => array(
                'dataType' => 'date',
                'actualType' => DataTypes::DATE,
                'subType' => null,
            ),
        )
    ),
    'languages' => array(
        'dataType' => 'array of strings',
        'actualType' => DataTypes::COLLECTION,
        'subType' => DataTypes::STRING,
    ),
    'roles' => array(
        'dataType' => 'array of choices',
        'actualType' => DataTypes::COLLECTION,
        'subType' => DataTypes::ENUM,
    ),
    'groups' => array(
        'dataType' => 'array of objects (Group)',
        'actualType' => DataTypes::COLLECTION,
        'subType' => 'Foo\Entity\Group',
    ),
    'profileRevisions' => array(
         'dataType' => 'array of objects (Profile)',
         'actualType' => DataTypes::COLLECTION,
         'subType' => 'Foo\Entity\Profile',
    ),
    'address' => array(
        'dataType' => 'object (a_type_a_custom_JMS_serializer_handler_handles)',
        'actualType' => DataTypes::MODEL,
        'subType' => 'a_type_a_custom_JMS_serializer_handler_handles',
    ),
);
```

When a formatter omits the `dataType` property or leaves it blank, it is
inferred within `ApiDocExtractor` before everything is passed to formatters.
2014-06-25 09:05:48 +02:00
William DURAND
b48650a9e0 Fix CS 2014-06-25 08:52:01 +02:00
Yosh de Vos
624802b57a Added configuration to disable body formats 2014-05-21 15:59:55 +02:00
Yosh de Vos
8402c748ee Added request formats configuration 2014-05-18 21:25:30 +02:00
William DURAND
4b6efc6631 Fix undefined index in AbstractFormatter 2013-12-16 16:47:21 +01:00
William DURAND
d7fd929379 Fix CS 2013-11-14 10:33:57 +01:00
Kevin Saliou
23bc2b6f47 make api method headers anchor links so a speicif method can be refered to through its unique id 2013-09-06 13:42:19 +02:00
Josh Hall-Bachner
5e1549a29d Built parse-merging into the ApiDocExtractor.
Wired up a "post-parse" pass to allow recursive parsing across multiple parsers.
2013-06-30 23:46:41 -07:00
Josh Hall-Bachner
0913157399 Added the initial structure for a Symfony Validation handler that is injected into the parsers. 2013-06-30 23:46:41 -07:00
Josh Hall-Bachner
a9f0613cee Added a configuration parameter to determine the default body format. 2013-06-04 15:30:07 -07:00
Pierre-Yves LEBECQ
13efea8975 Added support for the jms version annotations in formatters 2013-05-12 14:54:01 +02:00
Ismael Ambrosi
0c2cad6f0a Added check for deprecated setting
Avoids adding the method as deprecated if the value of the deprecated setting is false
2013-05-08 11:00:44 -03:00
Patryk Szlagowski
0eb538083a motd configuration 2013-04-08 11:44:43 +02:00
Patryk Kala
3b6e9da91a Ability to mark function as deprecated 2013-03-31 20:35:46 +02:00
Pierre-Yves LEBECQ
67db76990e [Formatter] Fixed MarkdownFormatter. 2013-03-21 14:36:52 +01:00
William DURAND
2fd3f33ad8 Fix 8c9b8331d066269d48ca374280937be264767ee6
* tests
* CS
2013-03-17 16:40:39 +01:00
William DURAND
8c9b8331d0 Merge pull request #138 from drgomesp/section-grouping
Section grouping
2013-03-17 16:13:56 +01:00
drgomesp
381476a2eb Changed html structure and css for sections 2013-02-25 17:27:09 -03:00
drgomesp
9c601664d1 #138 Added section grouping as a higher level key to the resources array 2013-02-21 15:46:59 -03:00
drgomesp
b4792d1cd5 Changed conditional to work with default value as null 2013-02-14 14:16:54 -02:00
drgomesp
ad4eae7dd7 #25 Added handling of sections on the processCollection method of the AbstractFormatter 2013-02-13 17:08:35 -02:00
Greg Holland
62b30fdb87 Fix spacing & indentation 2013-01-08 16:38:52 -08:00