From ae49d8ce46c65853765bc8ca7f446caaf464bcd1 Mon Sep 17 00:00:00 2001 From: Carles Arnal Date: Mon, 28 Oct 2024 09:47:11 +0100 Subject: [PATCH] Add manual example for json schema refs --- examples/json-maven-with-references/pom.xml | 142 ++++++++ .../common/jsd/FLIBusinessUnitBaseTypes.json | 59 ++++ .../schemas/common/jsd/FLIItemBaseTypes.json | 68 ++++ .../schemas/common/jsd/FLIMessageHeader.json | 96 ++++++ .../schemas/common/jsd/FLIServiceTypes.json | 308 ++++++++++++++++++ .../schemas/common/jsd/FLIStockTypes.json | 178 ++++++++++ .../schemas/out/jsd/FLIStockAdjustment.json | 100 ++++++ examples/pom.xml | 1 + 8 files changed, 952 insertions(+) create mode 100644 examples/json-maven-with-references/pom.xml create mode 100644 examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIBusinessUnitBaseTypes.json create mode 100644 examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIItemBaseTypes.json create mode 100644 examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIMessageHeader.json create mode 100644 examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIServiceTypes.json create mode 100644 examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIStockTypes.json create mode 100644 examples/json-maven-with-references/src/main/resources/schemas/out/jsd/FLIStockAdjustment.json diff --git a/examples/json-maven-with-references/pom.xml b/examples/json-maven-with-references/pom.xml new file mode 100644 index 0000000000..9048e6bb20 --- /dev/null +++ b/examples/json-maven-with-references/pom.xml @@ -0,0 +1,142 @@ + + + + apicurio-registry-examples + io.apicurio + 2.6.6-SNAPSHOT + + 4.0.0 + + apicurio-registry-examples-json-maven-with-references + jar + + + + + io.apicurio + apicurio-registry-maven-plugin + ${project.version} + + + register-artifact + + register + + process-test-resources + + http://localhost:8080/apis/registry/v2 + + + json-maven-with-references + stockAdjustment + 1.0.0 + JSON + + ${project.basedir}/src/main/resources/schemas/out/jsd/FLIStockAdjustment.json + + RETURN_OR_UPDATE + true + + + ../../common/jsd/FLIServiceTypes.json + json-maven-with-references + FLIServiceTypes + 1.0.0 + JSON + + ${project.basedir}/src/main/resources/schemas/common/jsd/FLIServiceTypes.json + + RETURN_OR_UPDATE + true + + + ../../common/jsd/FLIStockTypes.json + json-maven-with-references + FLIStockTypes + 1.0.0 + JSON + + ${project.basedir}/src/main/resources/schemas/common/jsd/FLIStockTypes.json + + RETURN_OR_UPDATE + true + + + ../../common/jsd/FLIItemBaseTypes.json + json-maven-with-references + FLIItemBaseTypes + 1.0.0 + JSON + + ${project.basedir}/src/main/resources/schemas/common/jsd/FLIItemBaseTypes.json + + RETURN_OR_UPDATE + true + + + ../../common/jsd/FLIBusinessUnitBaseTypes.json + json-maven-with-references + FLIBusinessUnitBaseTypes + 1.0.0 + JSON + + ${project.basedir}/src/main/resources/schemas/common/jsd/FLIBusinessUnitBaseTypes.json + + RETURN_OR_UPDATE + true + + + ../../common/jsd/FLIServiceTypes.json + json-maven-with-references + FLIServiceTypes + 1.0.0 + + + + + + + ../../common/jsd/FLIBusinessUnitBaseTypes.json + json-maven-with-references + FLIBusinessUnitBaseTypes + 1.0.0 + + + ../../common/jsd/FLIServiceTypes.json + json-maven-with-references + FLIServiceTypes + 1.0.0 + + + + + ../../common/jsd/FLIBusinessUnitBaseTypes.json + json-maven-with-references + FLIBusinessUnitBaseTypes + 1.0.0 + + + ../../common/jsd/FLIMessageHeader.json + json-maven-with-references + MsgHeaderType + 1.0.0 + JSON + + ${project.basedir}/src/main/resources/schemas/common/jsd/FLIMessageHeader.json + + RETURN_OR_UPDATE + true + + + + + + + + + + + + diff --git a/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIBusinessUnitBaseTypes.json b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIBusinessUnitBaseTypes.json new file mode 100644 index 0000000000..c06746e7bb --- /dev/null +++ b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIBusinessUnitBaseTypes.json @@ -0,0 +1,59 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "FLIBusinessUnitBaseTypes.json", + "type": "object", + "$defs": { + "buCodeType": { + "type": "string", + "pattern": "(^[0-9A-Z]{3,5})|AP" + }, + "buTypeType": { + "type": "string", + "pattern": "(^[A-Z]{2,3})" + }, + "BusinessUnitReferenceType": { + "type": "object", + "required": [ + "BusinessUnitCode", + "BusinessUnitType" + ], + "properties": { + "BusinessUnitCode": { + "$ref": "#/$defs/buCodeType" + }, + "BusinessUnitType": { + "$ref": "#/$defs/buTypeType" + } + }, + "additionalProperties": false + }, + "BusinessUnitAddressReferenceType": { + "type": "object", + "required": [ + "BusinessUnitCode", + "BusinessUnitType", + "BusinessUnitSequence" + ], + "properties": { + "BusinessUnitCode": { + "$ref": "#/$defs/buCodeType" + }, + "BusinessUnitType": { + "$ref": "#/$defs/buTypeType" + }, + "BusinessUnitSequence": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/positiveInteger4" + } + }, + "additionalProperties": false + } + }, + "anyOf": [ + { + "$ref": "#/$defs/BusinessUnitReferenceType" + }, + { + "$ref": "#/$defs/BusinessUnitAddressReferenceType" + } + ] +} diff --git a/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIItemBaseTypes.json b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIItemBaseTypes.json new file mode 100644 index 0000000000..fe1d9ceb33 --- /dev/null +++ b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIItemBaseTypes.json @@ -0,0 +1,68 @@ + +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "FLIItemBaseTypes.json", + "$defs": { + "ItemReferenceType": { + "type": "object", + "properties": { + "ItemNumber": { + "type": "string", + "minLength": 1, + "maxLength": 15 + }, + "ItemType": { + "type": "string", + "enum": [ + "ADS", + "ART", + "CCI", + "HM", + "OAD", + "SGR", + "SPR" + ] + } + }, + "required": [ + "ItemNumber", + "ItemType" + ], + "additionalProperties": false + }, + "ItemSKUType": { + "type": "string", + "minLength": 1, + "maxLength": 20 + }, + "DWPReferenceType": { + "type": "object", + "properties": { + "ItemReference": { + "$ref": "#/$defs/ItemReferenceType" + }, + "ItemSupplierReference": { + "$ref": "../../common/jsd/FLIBusinessUnitBaseTypes.json#/$defs/BusinessUnitReferenceType" + }, + "DWPNumber": { "type": "integer" }, + "DWPEdition": { "type": "integer" }, + "DWPFromPackagingDate": { + "type": "string", + "format": "date" + } + }, + "required": [ + "ItemReference", + "ItemSupplierReference", + "DWPNumber", + "DWPEdition", + "DWPFromPackagingDate" + ], + "additionalProperties": false + } + }, + "anyOf": [ + { "$ref": "#/$defs/ItemReferenceType" }, + { "$ref": "#/$defs/DWPReferenceType" } + ] +} \ No newline at end of file diff --git a/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIMessageHeader.json b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIMessageHeader.json new file mode 100644 index 0000000000..b5bafc391a --- /dev/null +++ b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIMessageHeader.json @@ -0,0 +1,96 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "FLIMessageHeader.json", + "$defs": { + "MsgHeaderType": { + "type": "object", + "properties": { + "MsgName": { + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "MsgVersNo": { + "type": "string", + "minLength": 1, + "maxLength": 10 + }, + "MsgDateTime": { + "type": "string", + "format": "date-time", + "pattern": "^(.{20})([0-9]{3})[+-]((2[0-3]|[01][0-9])[:]([0-5][0-9]))$" + }, + "MsgReference": { + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "SendingSystem": { + "type": "string", + "minLength": 1, + "maxLength": 20 + }, + "SendingUnit": { + "type": "object", + "properties": { + "BUCode": { + "type": "string", + "minLength": 3, + "maxLength": 5 + }, + "BUType": { + "type": "string", + "minLength": 2, + "maxLength": 3 + } + }, + "required": [ + "BUCode", + "BUType" + ], + "additionalProperties": false + }, + "LogicalRoutingIdentifier": { + "type": "object", + "properties": { + "SourceCode": { + "type": "string", + "minLength": 1 + }, + "SourceType": { + "type": "string", + "minLength": 1 + }, + "SourceLookupType": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "SourceCode", + "SourceType" + ], + "additionalProperties": false + } + }, + "additionalProperties": false, + "required": [ + "MsgName", + "MsgVersNo", + "MsgDateTime", + "MsgReference", + "SendingSystem" + ] + } + }, + "type": "object", + "properties": { + "MsgHeader": { + "$ref": "#/$defs/MsgHeaderType" + } + }, + "required": [ + "MsgHeader" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIServiceTypes.json b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIServiceTypes.json new file mode 100644 index 0000000000..34a7c26754 --- /dev/null +++ b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIServiceTypes.json @@ -0,0 +1,308 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "FLIServiceTypes.json", + "$defs": { + "fliDate": { + "type": "string", + "format": "date" + }, + "fliDateTime": { + "type": "string", + "format": "date-time", + "pattern": "^(.{20})([0-9]{3})[+-]((2[0-3]|[01][0-9])[:]([0-5][0-9]))$" + }, + "positiveInteger": { + "type": "integer", + "minimum": 0 + }, + "positiveInteger4": { + "type": "integer", + "minimum": 0, + "maximum": 9999 + }, + "positiveIntegerMax100": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "integer2": { + "type": "integer", + "minimum": -99, + "maximum": 99 + }, + "integer3": { + "type": "integer", + "minimum": -999, + "maximum": 999 + }, + "integer4": { + "type": "integer", + "minimum": -9999, + "maximum": 9999 + }, + "integer6": { + "type": "integer", + "minimum": -999999, + "maximum": 999999 + }, + "integer11": { + "type": "integer", + "minimum": -99999999999, + "maximum": 99999999999 + }, + "decimal7-3": { + "type": "number", + "minimum": -9999.999, + "maximum": 9999.999, + "multipleOf": 0.001 + }, + "decimal9-2": { + "type": "number", + "minimum": -9999999.99, + "maximum": 9999999.99, + "multipleOf": 0.01 + }, + "decimal9-5": { + "type": "number", + "minimum": -9999.99999, + "maximum": 9999.99999, + "multipleOf": 0.00001 + }, + "decimal11-2": { + "type": "number", + "minimum": -999999999.99, + "maximum": 999999999.99, + "multipleOf": 0.01 + }, + "decimal15-5": { + "type": "number", + "minimum": -9999999999.99999, + "maximum": 9999999999.99999, + "multipleOf": 0.00001 + }, + "string1": { + "type": "string", + "maxLength": 1 + }, + "string2": { + "type": "string", + "maxLength": 2 + }, + "string4": { + "type": "string", + "maxLength": 4 + }, + "string8": { + "type": "string", + "maxLength": 8 + }, + "string10": { + "type": "string", + "maxLength": 10 + }, + "string24": { + "type": "string", + "maxLength": 24 + }, + "string35": { + "type": "string", + "maxLength": 35 + }, + "string36": { + "type": "string", + "maxLength": 36 + }, + "string40": { + "type": "string", + "maxLength": 40 + }, + "string50": { + "type": "string", + "maxLength": 50 + }, + "string70": { + "type": "string", + "maxLength": 70 + }, + "string100": { + "type": "string", + "maxLength": 100 + }, + "string160": { + "type": "string", + "maxLength": 160 + }, + "string500": { + "type": "string", + "maxLength": 500 + }, + "nonEmptyString4000": { + "type": "string", + "maxLength": 4000, + "minLength": 1 + }, + "nonEmptyString1000": { + "type": "string", + "maxLength": 1000, + "minLength": 1 + }, + "nonEmptyString500": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "nonEmptyString200": { + "type": "string", + "maxLength": 200, + "minLength": 1 + }, + "nonEmptyString160": { + "type": "string", + "maxLength": 160, + "minLength": 1 + }, + "nonEmptyString150": { + "type": "string", + "maxLength": 150, + "minLength": 1 + }, + "nonEmptyString100": { + "type": "string", + "maxLength": 100, + "minLength": 1 + }, + "nonEmptyString80": { + "type": "string", + "maxLength": 80, + "minLength": 1 + }, + "nonEmptyString70": { + "type": "string", + "maxLength": 70, + "minLength": 1 + }, + "nonEmptyString50": { + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "nonEmptyString40": { + "type": "string", + "maxLength": 40, + "minLength": 1 + }, + "nonEmptyString36": { + "type": "string", + "maxLength": 36, + "minLength": 1 + }, + "nonEmptyString35": { + "type": "string", + "maxLength": 35, + "minLength": 1 + }, + "nonEmptyString30": { + "type": "string", + "maxLength": 30, + "minLength": 1 + }, + "nonEmptyString25": { + "type": "string", + "maxLength": 25, + "minLength": 1 + }, + "nonEmptyString24": { + "type": "string", + "maxLength": 24, + "minLength": 1 + }, + "nonEmptyString20": { + "type": "string", + "maxLength": 20, + "minLength": 1 + }, + "nonEmptyString18": { + "type": "string", + "maxLength": 18, + "minLength": 1 + }, + "nonEmptyString15": { + "type": "string", + "maxLength": 15, + "minLength": 1 + }, + "nonEmptyString10": { + "type": "string", + "maxLength": 10, + "minLength": 1 + }, + "nonEmptyString8": { + "type": "string", + "maxLength": 8, + "minLength": 1 + }, + "nonEmptyString5": { + "type": "string", + "maxLength": 5, + "minLength": 1 + }, + "nonEmptyString4": { + "type": "string", + "maxLength": 4, + "minLength": 1 + }, + "nonEmptyString3": { + "type": "string", + "maxLength": 3, + "minLength": 1 + }, + "nonEmptyString2": { + "type": "string", + "maxLength": 2, + "minLength": 1 + }, + "nonEmptyString1": { + "type": "string", + "maxLength": 1, + "minLength": 1 + }, + "nonEmptyString": { + "type": "string", + "minLength": 1 + }, + "CountryCodeType": { + "type": "string", + "pattern": "(^[A-Z]{2}$)" + }, + "ServiceResponseType": { + "type": "object", + "properties": { + "ServiceName": { + "$ref": "#/$defs/nonEmptyString100" + }, + "MessageReference": { + "$ref": "#/$defs/nonEmptyString36" + }, + "ReturnCode": { + "$ref": "#/$defs/nonEmptyString4" + }, + "ErrorMessage": { + "$ref": "#/$defs/nonEmptyString100" + }, + "ErrorDetails": { + "$ref": "#/$defs/nonEmptyString500" + } + }, + "required": [ + "ServiceName", + "MessageReference", + "ReturnCode" + ], + "additionalProperties": false + } + }, + "type": "object", + "anyOf": [ + { "$ref": "#/$defs/ServiceResponseType" } + ] +} \ No newline at end of file diff --git a/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIStockTypes.json b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIStockTypes.json new file mode 100644 index 0000000000..2a96918183 --- /dev/null +++ b/examples/json-maven-with-references/src/main/resources/schemas/common/jsd/FLIStockTypes.json @@ -0,0 +1,178 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "FLIStockTypes.json", + "type": "object", + "$defs": { + "LUStock": { + "description": "This object models the stock object.", + "type": "object", + "properties": { + "ItemReference": { + "$ref": "../../common/jsd/FLIItemBaseTypes.json#/$defs/ItemReferenceType" + }, + "SupplierReference": { + "$ref": "../../common/jsd/FLIBusinessUnitBaseTypes.json#/$defs/BusinessUnitReferenceType" + }, + "ItemDWPReference": { + "$ref": "../../common/jsd/FLIItemBaseTypes.json#/$defs/DWPReferenceType" + }, + "RegistrationDateTime": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/fliDateTime" + }, + "ProductionDate": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/fliDate" + }, + "StockLocationId": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/nonEmptyString30" + }, + "Quantity": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/decimal11-2" + }, + "UOMCodeQuantity": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/nonEmptyString10" + }, + "InboundConsignmentLineReference": { + "$ref": "#/$defs/ConsignmentLineReference" + }, + "CountryOfOrigin": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/string2" + }, + "TradeStatus": { + "$ref": "#/$defs/TradeStatus" + }, + "OrderReference": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/nonEmptyString24" + }, + "OrderType": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/nonEmptyString10" + }, + "BondedFlag": { + "type": "boolean" + }, + "LUStockStatus": { + "type": "array", + "items": { + "$ref": "#/$defs/LUStockStatus" + } + } + }, + "required": [ + "ItemReference", + "SupplierReference", + "ItemDWPReference", + "RegistrationDateTime", + "ProductionDate", + "StockLocationId", + "Quantity", + "UOMCodeQuantity", + "CountryOfOrigin", + "TradeStatus", + "BondedFlag" + ], + "additionalProperties": false + }, + "ConsignmentLineReference": { + "type": "object", + "properties": { + "ConsignmentId": { + "$ref": "#/$defs/ConsignmentId" + }, + "ConsignmentLineNumber": { + "$ref": "#/$defs/ConsignmentLineNumber" + } + }, + "required": [ + "ConsignmentId", + "ConsignmentLineNumber" + ], + "additionalProperties": false + }, + "TradeStatus": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "StockStatusSubCode": { + "type": "integer", + "minimum": 0, + "maximum": 99 + }, + "LUStockStatus": { + "type": "object", + "properties": { + "StockStatus": { + "type": "string" + }, + "StockStatusSubCode": + { + "$ref": "#/$defs/StockStatusSubCode" + } + }, + "required": [ + "StockStatus" + ], + "additionalProperties": false + }, + "ConsignmentId": { + "type": "object", + "properties": { + "CreatorReference": { + "$ref": "../../common/jsd/FLIBusinessUnitBaseTypes.json#/$defs/BusinessUnitReferenceType" + }, + "ConsignmentNumber": { + "type": "string", + "maxLength": 12, + "minLength": 1 + } + }, + "required": [ + "CreatorReference", + "ConsignmentNumber" + ], + "additionalProperties": false + }, + "ConsignmentLineNumber": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/positiveInteger" + }, + "orderSource": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/nonEmptyString10" + }, + "executableOrderId": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/nonEmptyString40" + }, + "executableOrderLineId": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/integer4" + }, + "OutBoundReferences": { + "type": "object", + "properties": { + "OutboundConsignmentLineReference": { + "$ref": "#/$defs/ConsignmentLineReference" + }, + "OrderSource": { + "$ref": "#/$defs/orderSource" + }, + "ExecutableOrderLineReference": { + "type": "object", + "properties": { + "ExecutableOrderId": { + "$ref": "#/$defs/executableOrderId" + }, + "ExecutableOrderLineId": { + "$ref": "#/$defs/executableOrderLineId" + } + }, + "required": [ + "ExecutableOrderId", + "ExecutableOrderLineId" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } +} diff --git a/examples/json-maven-with-references/src/main/resources/schemas/out/jsd/FLIStockAdjustment.json b/examples/json-maven-with-references/src/main/resources/schemas/out/jsd/FLIStockAdjustment.json new file mode 100644 index 0000000000..0090233520 --- /dev/null +++ b/examples/json-maven-with-references/src/main/resources/schemas/out/jsd/FLIStockAdjustment.json @@ -0,0 +1,100 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "FLIStockAdjustment.json", + "title": "Stock adjustment schema for GIS", + "description": "Schema for the validation of stock adjustment messages.", + "$defs": { + "LUStockAdjustment": { + "type": "object", + "properties": { + "LogId": { + "type": "integer" + }, + "TransactionType": { + "type": "string", + "maxLength": 3 + }, + "ReportDateTime": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/fliDateTime" + }, + "TransactionDateTime": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/fliDateTime" + }, + "AdjustmentQuantity": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/decimal11-2" + }, + "UOMCodeQuantity": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/nonEmptyString10" + }, + "ChangeNote": { + "$ref": "../../common/jsd/FLIServiceTypes.json#/$defs/nonEmptyString35" + }, + "OutBoundReferences": { + "$ref": "../../common/jsd/FLIStockTypes.json#/$defs/OutBoundReferences" + }, + "RuleIdentifier": { + "type": "integer" + }, + "SubCode": { + "$ref": "../../common/jsd/FLIStockTypes.json#/$defs/StockStatusSubCode" + } + }, + "required": [ + "LogId", + "TransactionType", + "ReportDateTime", + "TransactionDateTime", + "AdjustmentQuantity", + "UOMCodeQuantity" + ], + "additionalProperties": false + }, + "StockAdjustment": { + "type": "object", + "properties": { + "LogisticUnitReference": { + "$ref": "../../common/jsd/FLIBusinessUnitBaseTypes.json#/$defs/BusinessUnitReferenceType" + }, + "LUStock": { + "$ref": "../../common/jsd/FLIStockTypes.json#/$defs/LUStock" + }, + "LUStockAdjustment": { + "$ref": "#/$defs/LUStockAdjustment" + } + }, + "required": [ + "LogisticUnitReference", + "LUStock", + "LUStockAdjustment" + ], + "additionalProperties": false + } + }, + "type": "object", + "properties": { + "MsgHeader": { + "$ref": "../../common/jsd/FLIMessageHeader.json#/$defs/MsgHeaderType" + }, + "MsgBody": { + "type": "object", + "properties": { + "StockAdjustments": { + "type": "array", + "items": { + "$ref": "#/$defs/StockAdjustment" + }, + "minItems": 1 + } + }, + "required": [ + "StockAdjustments" + ], + "additionalProperties": false + } + }, + "required": [ + "MsgHeader", + "MsgBody" + ], + "additionalProperties": false +} diff --git a/examples/pom.xml b/examples/pom.xml index ffa8f1b55b..24f9b4998c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -54,6 +54,7 @@ simple-validation serdes-with-references avro-maven-with-references + json-maven-with-references avro-maven-with-references-auto json-maven-with-references-auto protobuf-validation