Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class {{controllerName}} extends Controller
{{#bodyParams}}
// Make sure that the client is providing something that we can consume
$consumes = [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}];
$inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0];
$inputFormat = $request->headers->has('Content-Type')?explode(";",$request->headers->get('Content-Type'))[0]:$consumes[0];
if (!in_array($inputFormat, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function addPetAction(Request $request)
{
// Make sure that the client is providing something that we can consume
$consumes = ['application/json', 'application/xml'];
$inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0];
$inputFormat = $request->headers->has('Content-Type')?explode(";",$request->headers->get('Content-Type'))[0]:$consumes[0];
if (!in_array($inputFormat, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
Expand Down Expand Up @@ -491,7 +491,7 @@ public function updatePetAction(Request $request)
{
// Make sure that the client is providing something that we can consume
$consumes = ['application/json', 'application/xml'];
$inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0];
$inputFormat = $request->headers->has('Content-Type')?explode(";",$request->headers->get('Content-Type'))[0]:$consumes[0];
if (!in_array($inputFormat, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public function placeOrderAction(Request $request)
{
// Make sure that the client is providing something that we can consume
$consumes = [];
$inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0];
$inputFormat = $request->headers->has('Content-Type')?explode(";",$request->headers->get('Content-Type'))[0]:$consumes[0];
if (!in_array($inputFormat, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function createUserAction(Request $request)
{
// Make sure that the client is providing something that we can consume
$consumes = [];
$inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0];
$inputFormat = $request->headers->has('Content-Type')?explode(";",$request->headers->get('Content-Type'))[0]:$consumes[0];
if (!in_array($inputFormat, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
Expand Down Expand Up @@ -138,7 +138,7 @@ public function createUsersWithArrayInputAction(Request $request)
{
// Make sure that the client is providing something that we can consume
$consumes = [];
$inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0];
$inputFormat = $request->headers->has('Content-Type')?explode(";",$request->headers->get('Content-Type'))[0]:$consumes[0];
if (!in_array($inputFormat, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
Expand Down Expand Up @@ -217,7 +217,7 @@ public function createUsersWithListInputAction(Request $request)
{
// Make sure that the client is providing something that we can consume
$consumes = [];
$inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0];
$inputFormat = $request->headers->has('Content-Type')?explode(";",$request->headers->get('Content-Type'))[0]:$consumes[0];
if (!in_array($inputFormat, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
Expand Down Expand Up @@ -592,7 +592,7 @@ public function updateUserAction(Request $request, $username)
{
// Make sure that the client is providing something that we can consume
$consumes = [];
$inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0];
$inputFormat = $request->headers->has('Content-Type')?explode(";",$request->headers->get('Content-Type'))[0]:$consumes[0];
if (!in_array($inputFormat, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
Expand Down