diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index 4a85553..50550a3 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -39,6 +39,7 @@ class Configuration implements ConfigurationInterface
->children()
->scalarNode('enabled')->defaultTrue()->end()
->scalarNode('endpoint')->defaultNull()->end()
+ ->scalarNode('accept_type')->defaultValue('')->end()
->arrayNode('request_format')
->addDefaultsIfNotSet()
->children()
diff --git a/DependencyInjection/NelmioApiDocExtension.php b/DependencyInjection/NelmioApiDocExtension.php
index 19790aa..2718679 100644
--- a/DependencyInjection/NelmioApiDocExtension.php
+++ b/DependencyInjection/NelmioApiDocExtension.php
@@ -32,6 +32,7 @@ class NelmioApiDocExtension extends Extension
$container->setParameter('nelmio_api_doc.sandbox.enabled', $config['sandbox']['enabled']);
$container->setParameter('nelmio_api_doc.sandbox.endpoint', $config['sandbox']['endpoint']);
$container->setParameter('nelmio_api_doc.sandbox.request_format.method', $config['sandbox']['request_format']['method']);
+ $container->setParameter('nelmio_api_doc.sandbox.accept_type', $config['sandbox']['accept_type']);
$container->setParameter('nelmio_api_doc.sandbox.request_format.default_format', $config['sandbox']['request_format']['default_format']);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
diff --git a/Formatter/HtmlFormatter.php b/Formatter/HtmlFormatter.php
index 8204891..9d5449f 100644
--- a/Formatter/HtmlFormatter.php
+++ b/Formatter/HtmlFormatter.php
@@ -45,6 +45,11 @@ class HtmlFormatter extends AbstractFormatter
*/
private $requestFormatMethod;
+ /**
+ * @var string
+ */
+ private $acceptType;
+
/**
* @var array
*/
@@ -90,6 +95,14 @@ class HtmlFormatter extends AbstractFormatter
$this->engine = $engine;
}
+ /**
+ * @param string $acceptType
+ */
+ public function setAcceptType($acceptType)
+ {
+ $this->acceptType = $acceptType;
+ }
+
/**
* @param string $method
*/
@@ -144,6 +157,7 @@ class HtmlFormatter extends AbstractFormatter
'endpoint' => $this->endpoint,
'enableSandbox' => $this->enableSandbox,
'requestFormatMethod' => $this->requestFormatMethod,
+ 'acceptType' => $this->acceptType,
'defaultRequestFormat' => $this->defaultRequestFormat,
'date' => date(DATE_RFC822),
'css' => file_get_contents(__DIR__ . '/../Resources/public/css/screen.css'),
diff --git a/README.md b/README.md
index 1c70635..898a74e 100644
--- a/README.md
+++ b/README.md
@@ -213,7 +213,7 @@ configure this sandbox using the following parameters:
delivery: query # only query delivery is supported for now
enabled: true # default: true, you can set this parameter to `false` to disable the sandbox
endpoint: http://sandbox.example.com/ # default: /app_dev.php, use this parameter to define which URL to call through the sandbox
-
+ accept_type: application/json # default null, if set, the value is automatically populated as the Accept header
The bundle provides a way to register multiple `input` parsers. The first parser that can handle the specified
input is used, so you can configure their priorities via container tags. Here's an example parser service registration:
diff --git a/Resources/config/formatters.xml b/Resources/config/formatters.xml
index 6a8ae76..98f29c5 100644
--- a/Resources/config/formatters.xml
+++ b/Resources/config/formatters.xml
@@ -43,6 +43,9 @@