This document describes the rules that developers of APS packages should follow when they create or use an APS type derived from other APS types.
In this document:
A derived type (a child) must
have at least one implements
property that refers to the parent type inherited by the child.
General rules for the case when one declares an APS type (type-1) that implements another APS type (type-0):
name
attributes do not match
a name of corresponding inherited elements (properties, operations, or relations).It is allowed to add new properties if their names do not match a name of an inherited property:
However, it is not allowed to change data declarations in non-backwards-compatible manner. For example, it is not allowed to change the type attribute:
When redefining an operation, only backwards-compatible changes in signatures are allowed. Actually, you can only add optional parameters. Those parameters should be declared after parameters of the base type.
Example:
/* Base Type */ { "stop": { "path": "/stop", "verb": "PUT", "parameters": { } } }/* Derived Type */ { "stop": { "path": "/stop", "verb": "PUT", "parameters": { "poweroff": { "kind": "query", "type": "boolean", "required": false } } } }
It is allowed to define new relations in derived types, however the name of a new relation should not match any of the relations of the base types.