[FOLIO-1736] SPIKE: When used by clients, JSON schemas with "additionalProperties: false" fail on optional properties Created: 25/Jan/19 Updated: 25/Jan/23 Resolved: 25/Jan/23 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Task | Priority: | P3 |
| Reporter: | Jakub Skoczen | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | platform-backlog | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Issue links: |
|
||||||||||||||||||||||||
| Sprint: | CP: ready for planning | ||||||||||||||||||||||||
| Story Points: | 3 | ||||||||||||||||||||||||
| Development Team: | Core: Platform | ||||||||||||||||||||||||
| Description |
|
Problem: When a new optional property is added to the JSON Schema that describes a server-side entity we assume backwards compatibility (minor version increment). However, if the very same JSON Schema definition file is used by the client the deserialization will fail due to the fact that FOLIO schemas include additionalProperties: false setting. There is a mismatch here that needs to be addressed, some potential approaches include:
We need to decide on the approach and document it on dev.folio.org |
| Comments |
| Comment by Julian Ladisch [ 11/Feb/19 ] |
|
When a module only consumes the data from the changed schema it can ignore the new property and having a minor version increment is fine. In this case the module should disable the additionalProperties: false validation. When a module acts as a decorator that reads the data, makes some changes (like adding referenced records), and outputs them, the schema for the output needs to be extended by the new property. Both input and output validation should be updated to the new schema and should use the additionalProperties: false validation. |