private function configurePost(Post $operation, array $options)
    {
        if (!$operation->summary) {
            $operation->summary = 'Create a '.$options['entity_name'].' entity';
        }

        if (!isset($operation->parameters['body'])) {
            $operation->parameters[] = new Parameter(
                [
                    'parameter' => 'body',
                    'in' => 'body',
                    'name' => 'body',
                    'required' => true,
                    'schema' => [
                        '$ref' => '#/definitions/'.$options['entity_name'],
                    ],
                ]
            );
        }

        $this->appendResponses(
            $operation,
            [
                new Response(
                    [
                        'response' => 201,
                        'description' => 'Entity Created',
                    ]
                ),
                new Response(
                    [
                        'response' => 400,
                        'description' => 'Validation Exception',
                    ]
                ),
            ]
        );
    }
private function configurePost(Post $operation, array $options)
    {
        if (!$operation->summary) {
            $operation->summary = 'Create a '.$options['entity_name'].' entity';
        }

        if (!isset($operation->parameters['body'])) {
            $operation->parameters[] = new Parameter(
                [
                    'parameter' => 'body',
                    'in' => 'body',
                    'name' => 'body',
                    'required' => true,
                    'schema' => [
                        '$ref' => '#/definitions/'.$options['entity_name'],
                    ],
                ]
            );
        }

        $this->appendResponses(
            $operation,
            [
                new Response(
                    [
                        'response' => 201,
                        'description' => 'Entity Created',
                    ]
                ),
                new Response(
                    [
                        'response' => 400,
                        'description' => 'Validation Exception',
                    ]
                ),
            ]
        );
    }
private function configurePost ( Post $ operation , array $ options ) { if ( ! $ operation -> summary ) { $ operation -> summary = 'Create a ' . $ options [ 'entity_name' ] . ' entity' ; } if ( ! isset ( $ operation -> parameters [ 'body' ] ) ) { $ operation -> parameters [ ] = new Parameter ( [ 'parameter' => 'body' , 'in' => 'body' , 'name' => 'body' , 'required' => true , 'schema' => [ '$ref' => '#/definitions/' . $ options [ 'entity_name' ] , ] , ] ) ; } $ this -> appendResponses ( $ operation , [ new Response ( [ 'response' => 201 , 'description' => 'Entity Created' , ] ) , new Response ( [ 'response' => 400 , 'description' => 'Validation Exception' , ] ) , ] ) ; }
Configure a Post annotation with FosRest data.

@param Post  $operation
@param array $options
Configure a Post annotation with FosRest data .