mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Simplify enum nodes
This commit is contained in:
parent
8e03ef99fa
commit
f25c2f1eeb
@ -28,23 +28,17 @@ class Configuration implements ConfigurationInterface
|
|||||||
->children()
|
->children()
|
||||||
->scalarNode('enabled')->defaultTrue()->end()
|
->scalarNode('enabled')->defaultTrue()->end()
|
||||||
->scalarNode('endpoint')->defaultValue('/app_dev.php')->end()
|
->scalarNode('endpoint')->defaultValue('/app_dev.php')->end()
|
||||||
->scalarNode('json_declaration_method')
|
->enumNode('json_declaration_method')
|
||||||
|
->values(array('format_param', 'accept_header'))
|
||||||
->defaultValue('format_param')
|
->defaultValue('format_param')
|
||||||
->validate()
|
|
||||||
->ifNotInArray(array('format_param', 'accept_header'))
|
|
||||||
->thenInvalid("Unknown json declaration method '%s'.")
|
|
||||||
->end()
|
|
||||||
->end()
|
->end()
|
||||||
->arrayNode('authentication')
|
->arrayNode('authentication')
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('name')->isRequired()->end()
|
->scalarNode('name')->isRequired()->end()
|
||||||
->scalarNode('delivery')
|
->enumNode('delivery')
|
||||||
|
// header|query|request, but only query is implemented for now
|
||||||
|
->values(array('query'))
|
||||||
->isRequired()
|
->isRequired()
|
||||||
->validate()
|
|
||||||
// header|query|request, but only query is implemented for now
|
|
||||||
->ifNotInArray(array('query'))
|
|
||||||
->thenInvalid("Unknown authentication delivery type '%s'.")
|
|
||||||
->end()
|
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user