713 Commits

Author SHA1 Message Date
William Durand
c6741d5710 Merge pull request #369 from emmanuelballery/fixes_for_ff36
Fixes HTML structures for FF36 (and maybe other old browsers)
2014-06-27 10:24:27 +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
William DURAND
a817081ab2 Add missing array key checks
Fixes #423
2014-06-27 10:07:03 +02:00
William Durand
03f6142a84 Merge pull request #422 from nelmio/bezhermoso-expand_form_type_parser
Unified data types [actualType and subType]
2014-06-27 09:54:14 +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
William Durand
a2a4782af5 Merge pull request #408 from jonmchan/ParamDefaults
Add default values support for form types
2014-06-26 17:54:22 +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
df7387aec9 Merge pull request #419 from jonmchan/addParameterBugFix
Fixed small bug introduced when adding 'new parameter'
2014-06-26 00:04:36 +02:00
Jonathan Chan
ba5e2d1454 Fixed small bug introduced when adding 'new parameter' 2014-06-25 13:29:59 -04:00
William Durand
ea2201762d Merge pull request #345 from AlexeyKupershtokh/web-profiler
Symfony web profiler integration
2014-06-25 10:56:43 +02: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
William DURAND
8ddade0e30 Merge pull request #407 from jonmchan/ParameterTypeSupport 2014-06-25 10:25:59 +02:00
Jonathan Chan
1cd77e2f14 added support to properly handle file upload POST 2014-06-25 10:25:45 +02:00
Jonathan Chan
210596eae9 adding support for different parameter types 2014-06-25 10:25:45 +02:00
Jonathan Chan
b124824a8d added file type to FormType Parser 2014-06-25 10:25:45 +02:00
William DURAND
96e5d15f1b Merge pull request #412 from grEvenX/nullable_request_support 2014-06-25 10:20:00 +02:00
Even André Fiskvik
b4e874e2dc Add support for nullable option in RequestParam 2014-06-25 10:19:30 +02:00
William DURAND
607d031051 Merge pull request #413 from bezhermoso/unified_data_types 2014-06-25 09:06:32 +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 2.6.0 2014-06-25 08:52:01 +02:00
William Durand
87b690d5e1 Merge pull request #409 from stof/patch-2
Simplified the Travis configuration
2014-06-25 08:51:55 +02:00
Christophe Coevoet
8d3fd662bf Fixed the retrieval of the validation MetadataFactory
The service is private so getting it from the container get() method is invalid and it does not work anymore in Symfony 2.5 because the service gets inlined.
2014-06-18 09:38:16 +02:00
Christophe Coevoet
df1c85ae5e Simplified the Travis configuration
The tests against specific Symfony versions are now running only for a single PHP version to limit the number of jobs in the build matrix. They are also installing the full Symfony repo to be sure that all components are actually at the specified version without the need to require each of them explicitly.
2014-06-17 19:01:48 +02:00
William Durand
56124e7c40 Merge pull request #395 from fechu/master
Implement tags in ApiDoc annotation.
2014-06-01 15:56:45 +02:00
Sandro Meier
106b42530c Add documentation for tag property 2014-05-27 19:33:52 +02:00
Sandro Meier
dfd094371d Implement Tags for functions. 2014-05-27 13:33:50 +02:00
William Durand
dfb089f993 Merge pull request #392 from marco-jantke/submit-on-enter-sandbox-mode
Pressing enter in the sandbox mode will now lead to submit the form.
2014-05-26 10:51:28 +02:00
Marco Jantke
d7c70720b0 Pressing enter in the sandbox mode will now lead to submit the form. 2014-05-23 15:30:21 +02:00
Yosh de Vos
624802b57a Added configuration to disable body formats 2014-05-21 15:59:55 +02:00
William Durand
221f109ad6 Merge pull request #386 from marco-jantke/window-location-hash-fix
Remove hash when closing a method container again. Added small hash help...
2014-05-19 12:03:46 +02:00
William Durand
3771e2d834 Merge pull request #385 from yoshz/master
Added request formats configuration
2014-05-19 10:45:49 +02:00
Yosh de Vos
8402c748ee Added request formats configuration 2014-05-18 21:25:30 +02:00
Marco Jantke
df7be182cd Remove hash when closing a method container again. Added small hash helper functions. 2014-05-18 01:24:52 +02:00
William Durand
968a162544 Merge pull request #365 from pyrech/master
Fix #357 - doc broken with Validator Constraints in FOSRestBundle requirements
2014-05-16 23:52:41 +02:00
Loick Piera
d0149c65ab fix #357 2014-05-16 22:04:24 +02:00
William DURAND
fa92011126 fix cs 2.5.2 2014-05-16 11:33:58 +02:00
William Durand
a88e7d8278 Merge pull request #381 from mvdbos/master
Only render sandbox config if  the sandbox is enabled
2014-05-15 19:01:35 +02:00
Matthijs van den Bos
86d9c31340 Only show sandbox config if enabled 2014-05-14 22:05:03 +02:00
William Durand
493963f0c0 Merge pull request #375 from merk/2.5-fix
Fix ValidatorParser in symfony 2.5
2014-05-12 12:01:33 -04: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
Tim Nagel
c366ffba84 Fix ValidatorParser in symfony 2.5
Fixes #373
2014-04-30 22:18:06 +10:00
Emmanuel BALLERY
0a42d1773c Fix wrong HTML structure a>div 2014-04-24 23:02:56 +02:00
Emmanuel BALLERY
7150ac17de Remove duplicate HTML ID 2014-04-24 23:00:13 +02:00
Emmanuel BALLERY
f2b606fc23 Fix wrong HTML structure ul>li 2014-04-24 22:59:12 +02:00
Emmanuel BALLERY
c78466bbb9 Fix wrong HTML tag 2014-04-24 22:58:34 +02:00
William Durand
1c553e93ec Merge pull request #363 from cedriclombardot/fix-model-type
Fix parse of input forms with options required
2014-04-23 12:13:35 +02:00
Cedric LOMBARDOT
4181079d8b Fix parse of input forms with options required
When form like model type was parsed this pass the required 'class' option to enable the build of the class
2014-04-11 09:45:35 +00:00