-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
670 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# RESTful Webservices in Symfony | ||
|
||
## Coding Challenge 6 - POST vs. PUT | ||
|
||
### Tasks | ||
|
||
- implement controllers to create and update attendees and workshops | ||
- both should be possible with JSON and XML | ||
|
||
### Solution | ||
|
||
- use an `ArgumentValueResolver` (or alternativly the new `#[MapRequestPayload]` attribute) to deserialize the request's content | ||
- use the `*Repository`s to save the object into the database | ||
- *CREATE:* use HTTP method `POST`, return an HTTP 201 (Created) status code and | ||
set the `Location` header with the help of the `UrlGenerator` | ||
- *UPDATE:* use HTTP method `PUT`, return an HTTP 204 (No Content) status code and leave the response body empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# RESTful Webservices in Symfony | ||
|
||
## Coding Challenge 7 - Validation | ||
|
||
### Tasks | ||
|
||
- introduce Symfony's Validator to validate the request content used to create and update workshops and attendees | ||
|
||
### Solution | ||
|
||
- require the Symfony Validator component: `composer require validator` | ||
- add validation constraints to your model properties (e.g. NotBlank, Email) | ||
- inject the `Validator` Service in your `ValueResolver`s | ||
- for now throw an `UnprocessableEntityHttpException` on validation errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.