[NETCONF-1027] OpenAPI: Avoid null values in JSON Created: 11/May/23 Updated: 17/May/23 Resolved: 17/May/23 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-openapi |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0 |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Ivan Hrasko | Assignee: | Yaroslav Lastivka |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The resulted JSON from Restconf openapi endpoints (for example http://localhost:8181/apidoc/openapi3/apis/mounts/1) contain null values for unset fields. This is not necessary and we can have more compact JSON instead. Try to avoid null values (ideally globally) by following: https://www.baeldung.com/jackson-ignore-null-fields. |
| Comments |
| Comment by Ivan Hrasko [ 17/May/23 ] |
|
null values are usually introduced by using Java objects instead of JsonNode(s) thus this change is merged into version 6 only (together with Java objects). |