[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:
Relates
relates to FOLIO-1735 Unable to login due to unrecognised s... Closed
relates to MODUSERBL-64 Add staffSlips array to servicepoint.... Closed
relates to MODUSERBL-89 Unrecognized field "customFields" (cl... Closed
relates to MODUSERBL-65 Cannot login when additional properti... Closed
relates to FOLIO-1718 extending guidelines on versioning Blocked
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:

  • change versioning policy so that even optional properties are considered breaking changes
  • keep separate versions of schemas between servers and clients with the client version being more relaxed
  • override "additionalProperties: false" when any given schema is used in the client context

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.

Generated at Thu Feb 08 23:15:32 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.