Skip to content

Exceptions to status code#123

Merged
dunglas merged 1 commit into
api-platform:masterfrom
soyuka:doc-exceptions
Oct 17, 2016
Merged

Exceptions to status code#123
dunglas merged 1 commit into
api-platform:masterfrom
soyuka:doc-exceptions

Conversation

@soyuka

@soyuka soyuka commented Oct 14, 2016

Copy link
Copy Markdown
Member

Document api-platform/core#797 in configuration

Should this be added to another chapter too?

Comment thread core/configuration.md Outdated
# Enable the Nelmio Api doc integration.
enable_nelmio_api_doc: false

# Map exceptions to http status codes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTP

Comment thread core/configuration.md
# Map exceptions to http status codes
exception_to_status:
Symfony\Component\Serializer\Exception\ExceptionInterface: 400 # with a status code
ApiPlatform\Core\Exception\InvalidArgumentException: 'HTTP_BAD_REQUEST' # or with a constant defined in the 'Symfony\Component\HttpFoundation\Response' class

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a misfeature. Sorry that I didn't catch this.

Symfony 3.2 will support using PHP constants in YAML: http://symfony.com/blog/new-in-symfony-3-2-php-constants-in-yaml-files

We should remove this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I mean we should remove it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I hesitated to keep this feature because of that. But no comments during the PR, so...

@dunglas
dunglas merged commit 384cc42 into api-platform:master Oct 17, 2016
@dunglas

dunglas commented Oct 17, 2016

Copy link
Copy Markdown
Member

Thanks @soyuka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants