Right now the json-schema generation puts the fields for the concrete message first and then appends the mixins' fields. In php, the mixins are processed first (as that's the only way to handle field overrides). It would be great if both formats matched. The json-schema would render fields in exactly the same sequence as they were added.
{
"$schema": "http://json-schema.org/schema#",
"id": "https://schemas.gdbots.io/gdbots/pbjx/request/request-failed-response/1-0-0.json",
"type": "object",
"properties": {
"_schema": {
"type": "string",
"pattern": "^pbj:([a-z0-9-]+):([a-z0-9\\.-]+):([a-z0-9-]+)?:([a-z0-9-]+):([0-9]+-[0-9]+-[0-9]+)$",
"id": "pbj:gdbots:pbjx:request:request-failed-response:1-0-0"
},
"request": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/request"
}
],
"pbj": {
"type": "message",
"rule": "single"
}
},
"error_code": {
"type": "integer",
"minimum": 0,
"maximum": 65535,
"pbj": {
"type": "small-int",
"rule": "single"
}
},
"error_name": {
"type": "string",
"pattern": "^[\\w\\/\\.:-]+$",
"pbj": {
"type": "string",
"rule": "single"
}
},
"error_message": {
"type": "string",
"minLength": 0,
"maxLength": 65535,
"pbj": {
"type": "text",
"rule": "single"
}
},
"response_id": {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
"pbj": {
"type": "uuid",
"rule": "single"
}
},
"created_at": {
"type": "string",
"pattern": "^[1-9]{1}[0-9]{12,15}$",
"pbj": {
"type": "microtime",
"rule": "single"
}
},
"ctx_request_ref": {
"type": "object",
"properties": {
"curie": {
"type": "string",
"pattern": "^([a-z0-9-]+):([a-z0-9\\.-]+):([a-z0-9-]+)?:([a-z0-9-]+)$"
},
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9:_-]+$"
},
"type": {
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"pbj": {
"type": "message-ref",
"rule": "single"
}
},
"ctx_correlator_ref": {
"type": "object",
"properties": {
"curie": {
"type": "string",
"pattern": "^([a-z0-9-]+):([a-z0-9\\.-]+):([a-z0-9-]+)?:([a-z0-9-]+)$"
},
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9:_-]+$"
},
"type": {
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"pbj": {
"type": "message-ref",
"rule": "single"
}
}
},
"required": [
"_schema",
"request",
"response_id",
"created_at"
],
"definitions": {
"request": {
"$ref": "https://schemas.gdbots.io/gdbots/pbjx/mixin/request/1-0-0.json"
}
},
"additionalProperties": false
}