Skip to content

Commit 4a648a1

Browse files
Mokhtar Tlilisfmok
authored andcommitted
update readme and changelog files
1 parent 08d5b3f commit 4a648a1

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 1.2.2
4+
- Handle deserialization exceptions
5+
- Update composer.json minimum-stability
6+
- Update readme.md
7+
38
## 1.2.1
49
- Update composer.json description
510
- Update readme.md

README.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
- Request data supported: `json`, `xml` and `form` based on header content type.
99
- Resolve inputs arguments for controllers actions.
10-
- Validate DTO inputs objects (An option to enable or disable it).
11-
- Global YAML configuration
12-
- Custom Configuration via Input Attribute per controller action
10+
- Validate DTO inputs objects.
11+
- Global YAML configuration.
12+
- Custom Configuration via Input Attribute per controller action.
1313

1414
### Installation
1515
Require the bundle with composer:
@@ -86,17 +86,45 @@ Content-Type: application/problem+json; charset=utf-8
8686
}
8787
```
8888

89+
### Deserialization (v1.2.2)
90+
91+
Whether the request data contains invalid syntax or invalid attributes types a clear 400 json response will return:
92+
93+
- Data Error
94+
95+
```json
96+
{
97+
"title": "Deserialization Failed",
98+
"detail": "Data error",
99+
"violations": [
100+
{
101+
"propertyPath": "title",
102+
"message": "This value should be of type string",
103+
"currentType": "int"
104+
}
105+
]
106+
}
107+
```
108+
- Syntax error:
109+
```json
110+
{
111+
"title": "Deserialization Failed",
112+
"detail": "Syntax error",
113+
"violations": []
114+
}
115+
```
116+
89117
### Configuration
90-
* In case you want to serve a specific input data format for all your DTO inputs with skip validation:
118+
91119
```yaml
92120
# config/packages/request_input.yaml
93121
request_input:
94122
enabled: true # default value true
95123
formats: ['json'] # default value ['json', 'xml', 'form']
96124
skip_validation: true # default value false
97125
```
98-
- With above configuration RequestInputBundle will convert JSON request data only and skip validation process.
99-
- You can also use a format even if disabled globally by using attribute input and specify the format explicitly.
126+
127+
You can also override the format using attribute input and specify the format explicitly.
100128
101129
## License
102130

0 commit comments

Comments
 (0)