papinet / papiNet-API

papiNet is a global paper, forest products and bioproducts industry e-Business initiative.
http://www.papinet.org/
Apache License 2.0
9 stars 3 forks source link

Requirement for being compliant with the papiNet API Standard #131

Closed larsolofsson closed 1 month ago

larsolofsson commented 4 months ago

papiNet is specifying a standard for API for the forest and paper industries. If items not defined by papiNet are sent using papiNet endpoints, then it is not a papiNet API .Standard anymore.

Should papiNet add the following property to all subschemas? additionalProperties: false

patricekrakow commented 2 months ago

One of the "advantage" of JSON over XML is to be more flexible, allowing unknown/additional properties. It has opened a brand new space of backward compatibility: it might be possible continue to use an "old client" with a "new server" because the client has been programmed to take the properties it needs and to ignore the other ones. Therefore, if the "new server" makes an update of the JSON schema while keeping the "old properties" at the same place within the structure, the "old client" can still use the "new server".

This possible decoupling between the life cycle of "clients" and the "servers" when they change their interfaces (JSON Schemas) in a backward compatible manner can be considered as a game changer between JSON interfaceds and XML interfaces.

Using additionalProperties: false is precisely annihilating this "advantage" of JSON over XML.

patricekrakow commented 1 month ago

After a vote, we decided not to add additionalProperties: false for now. We might re-discuss this topic later.