Skip to content

Validation of json instances in XMLSpy 2026 #249

@larsolofsson

Description

@larsolofsson

As far as I understand,
To validate a json instance in XMLSpy we need to create new yaml files for global properties and for the json instance as well as a json file for the instance.', e.g.

  • schema files for global properties: PaginationLinks.schema.yaml, PaperAndBoard.schema.yaml and Pulp.schema.yaml
  • schema file for a json instance, e.g. SupplierOrderById.schema.yaml
  • json file for the instance: e.g. GetSupplierOrderByID-Interaction 2 of scenario_A.json

In the schema for the json instance we have to change all existing $ref:

  • $ref: '#/components/schemas/PaginationLinks' to be changed to $ref: 'PaginationLinks.schema.yaml'
  • $ref: '#/components/schemas/PaperAndBoard' to be changed to $ref: 'PaperAndBoard.schema.yaml'
  • $ref: '#/components/schemas/Pulp' to be changed to $ref: 'Pulp.schema.yaml'

To make it easier to change these $ref: for the validation work, I propose that we use $ref: only to global properties.
It means that we should not have any references to local properties in the schema.

The following type of constructs with references should be change by repeating local properties instead:

     unitReferences:
                                type: array
                                minItems: 1
                                items:
                                  type: object
                                  unevaluatedProperties: false
                                  required:
                                    # transportUnitLevel is not required (as in `units[]`)
                                    - transportUnitType
                                    - transportUnitIdentifier
                                  properties:
                                    transportUnitLevel:
                                      $ref: '#/components/schemas/SupplierOrderById/properties/lineItems/items/properties/deliveryLegs/items/properties/transport/properties/units/items/properties/level'
                                    transportUnitType:
                                      $ref: '#/components/schemas/SupplierOrderById/properties/lineItems/items/properties/deliveryLegs/items/properties/transport/properties/units/items/properties/type'
                                    transportUnitIdentifier:
                                      $ref: '#/components/schemas/SupplierOrderById/properties/lineItems/items/properties/deliveryLegs/items/properties/transport/properties/units/items/properties/identifier'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions