Swagger file combination rules

The exact rules that PolicyCenter uses to combine multiple schemas depends on the specific Swagger object and property. Thus, for a full understanding, you need to consult the documentation on each individual object and property. As a general rule, though, the vast majority of properties and objects work as described in the following sections.

Scalar values

A scalar value is a simple string, number or Boolean value. If there is a given set of objects defined in more than one schema, PolicyCenter chooses the first non-null value for the scalar property that it encounters in the schema files. For example, if A, B', and C' all define the description property on the same logical parameter, PolicyCenter uses the value defined in A for the property in A'. However, if A specifies the parameter, but not the description property, PolicyCenter uses the value of the description property from B'. Or, PolicyCenter uses the value from C' if it is the only schema that specifies the value.

Leaf nodes

PolicyCenter sometimes treats the following types of objects as a leaf nodes in the document tree:
  • Contact objects
  • License objects
  • External Documentation objects
  • Security Definition objects
  • Security Requirement objects
  • Schema Security objects

In such cases, PolicyCenter treats the object in the same fashion as a scalar value. This means that PolicyCenter does not try to merge the values but takes the first non-null value it finds.

Complex objects

PolicyCenter merges more complex objects (arrays, for example), across the different files.

Equivalent objects

PolicyCenter uses a fairly intuitive process to determine which objects to consider equivalent and thus to merge together, for example:
  • PolicyCenter merges operations that have identical verbs (GET or POST, for example) on identical paths.
  • PolicyCenter merges parameters on operations if the parameters have the same $ref values, or, if the parameters have the same combination of name and in values, and so on.