145 Commits

Author SHA1 Message Date
William Durand
dd6a5e32c3 Merge pull request #799 from debesha/master
Fixed bug with wrong form parsing when several custom inner types exist
2016-02-24 17:46:38 +01:00
William Durand
4e65cd3bc3 Merge pull request #805 from obense/master
Fix Collection Type options - Symfony 2.8 Support
2016-02-24 17:45:32 +01:00
Teoh Han Hui
c1c711bc26 Handle circular references in DunglasApiParser
Fixes #678, reverts #800
2016-02-18 23:18:43 +08:00
Olivier Bense
18c9fb8c29 Fix Collection Type options - Symfony 2.8 Support 2016-02-09 14:32:49 +01:00
Kévin Dunglas
abb100b29b Handle circular references in DunglasApiParser. Close #678. 2016-02-04 08:34:34 +01:00
Dmitry Malyshenko
0ed53788d2 Fixed bug with wrong form parsing when several custom inner types exist 2016-02-03 10:02:33 +00:00
William Durand
d5395cc0ea
Fix CS 2015-12-04 09:15:21 +01:00
Ener-Getick
67b7b46627 Add symfony 3.0 support 2015-12-02 16:19:12 +01:00
William Durand
4fad200d7b Merge pull request #758 from dunglas/master
Fix tests related to DunglasApiBundle
2015-11-22 08:22:33 +01:00
Kévin Dunglas
224af02f7f Fix tests related to DunglasApiBundle 2015-11-21 18:36:13 +01:00
Florian Strübe
aa10f9a2da Introduced default-value parameter to JsonSerializableParser
JSP is now able to set a default value for scalar types
This makes merging the parser result with other parser results easier
and gives some additional info when creating docs

Removed PHP doc comment block
2015-11-10 14:34:53 +01:00
William Durand
9df40af264
Support Symfony 2.8+
Fix #738
2015-10-27 17:15:32 +01:00
William Durand
09bb83e149
Restore 5.3 compat (implicit)
Implicit means: it's a best effort approach
but there is no guarantee that this bundle
will continue to work well with PHP < 5.4
2015-10-27 09:23:44 +01:00
Benjamin Paap
490a9081ec Options for form were not passed through 2015-10-26 11:11:28 +01:00
William Durand
716f3f19de
fix test suite by disabling a broken feature 2015-10-22 22:46:25 +02:00
William Durand
ce71bf0629
Fix CS 2015-10-22 14:42:59 +02:00
Fred Cox
406a4e1b5b Add support for using name in the input and output options for JsonSerializable and validation parsers 2015-07-01 14:05:10 +03:00
Fred Cox
37c6465700 Add a parser for jsonSerializable classes 2015-07-01 14:04:38 +03:00
William Durand
647131ab8e Merge pull request #586 from PedroTroller/fix/subform-options
Pass children options to subform
2015-05-16 13:07:10 +02:00
Kévin Dunglas
9c465e37ca Fix DunglasApi filters supports. Fix tests. 2015-05-14 23:23:41 +02:00
Stéphane Reuille
dc20b249e7 fix memory limit issue wirh entity list
Allow to disable mapping of entity list to avoid memory limit error on long list
2015-05-13 14:51:15 +02:00
Kévin Dunglas
79c1c4e4f4 Enhanced DunglasApiBundle support 2015-04-29 09:11:54 +02:00
Kévin Dunglas
c47265bb71 Fix DunglasJsonLdApiBundle support 2015-04-07 22:21:36 +02:00
Kévin Dunglas
adc03ba26d DunglasJsonLdApiBundle support 2015-03-20 09:53:48 +01:00
pedro
ff38cd4568 Pass children options to subform 2015-03-16 11:12:26 +01:00
William Durand
d8c05dbf57 Merge pull request #584 from PedroTroller/feature/form-options
Add form options to ApiDoc input
2015-03-13 17:22:24 +01:00
pedro
d121e28d69 Add form options to ApiDoc input
Update index.md

Remove unused variable. $arguments is now named $options
2015-03-13 16:15:29 +01: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
Jonathan Eskew
37ae52ba0a Update parser to convert empty array defaults to null
Don't let empty arrays get passed through as defaults.
2014-09-26 14:19:55 -04:00
Bez Hermoso
f5c1b06807 Support for collections. 2014-09-04 10:47:57 -07:00
Samuel ROZE
3e3ef87b79 Added nested JMS groups exclusion 2014-08-18 11:32:36 +02:00
Bez Hermoso
bcaaf28d61 Default to DataTypes::STRING 2014-08-04 10:02:18 -07:00
William DURAND
6c7c53e78d Fix CS & file permissions 2014-07-30 10:50:23 +02:00
ogizanagi
4939d116e0 Fix embedded collection of custom FormType Error
Fix an error when trying to use embedded form collections.

Referenced issue: #442
2014-07-21 22:27:09 +02:00
Paweł Mikołajczuk
55f26508ab Don't parse custom properties as classes.
Sometimes instead real class name we can use custom handler name. Then this class can't be initialized and we will get this exception ```ReflectionException: Class custom_handler_name does not exist```
2014-07-10 11:46:30 +02:00
Sander Marechal
b66e5c4449 Parse JSM\Inline, fixes #372 2014-07-08 13:20:13 +02:00
gnat42
48e7bd2616 If a description is not provided use form label
It would be nice if there was no description the form label was used instead. In the future I think it would be even better to have the label as an header, and the description as 'additional' instructions.
2014-07-03 13:34:07 -06:00
Giorgio Premi
e2c2d00075 FormTypeParser: FormType constructor should be called when possible 2014-06-27 10:58:53 +02:00
William DURAND
0030ce6825 Merge pull request #358 from pborreli/typos 2014-06-27 10:22:56 +02:00
Pascal Borreli
dbc3fcbb73 Fixed typos 2014-06-27 10:22:36 +02:00
Bez Hermoso
882f658599 Added 'default' parameters in {JmsMetadata,Validator}Parser, and FOSRestHandler. 2014-06-27 10:19:28 +02:00
William Durand
0d1bde9f8a Merge pull request #352 from sroze/output-post-parser
Add PostParserInterface to JmsMetadataParser to get ValidatorParser found children parsed
2014-06-27 10:14:51 +02:00
Bez Hermoso
3a31c93c94 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.

Ignore data_class and always use form-type to avoid conflicts.

Quick fix.
2014-06-27 09:35:18 +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
Jonathan Chan
b124824a8d added file type to FormType Parser 2014-06-25 10:25:45 +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
William DURAND
fa92011126 fix cs 2014-05-16 11:33:58 +02:00
William Durand
36c223ab3a Merge pull request #329 from maxromanovsky/form-type-parser-improvements
Form Parser improvements for date, datetime & choice form types (format & types)
2014-05-12 11:56:00 -04:00