1

I would like to enforce the property names of 'reference data' array (e.g., id, name) to optionally be any of those specified in fieldMapping.referenceFieldName property values (e.g., id, name, billingCycleDescription). How can I define such schema?

{
    "$schema": "../../Reference data schema.json",
    "TableName": "BillingCycle",
    "fieldMapping": [
        {
            "FieldName": "BillingCycleId",
            "referenceFieldName": "id"
        },
        {
            "FieldName": "BillingCycleName",
            "referenceFieldName": "name"
        },
        {
            "FieldName": "BillingCycleDescription",
            "referenceFieldName": "billingCycleDescription"
        }
    ],
    "referenceData": [
        { "id": 104800000, "name": "Daily" },
        { "id": 104800001, "name": "Weekly" },
        { "id": 104800005, "name": "Bi-weekly" },
        { "id": 104800002, "name": "Monthly" },
        { "id": 104800003, "name": "Quarterly" },
        { "id": 104800004, "name": "Yearly" }
    ]
}
Jason Desrosiers
  • 22,479
  • 5
  • 47
  • 53
  • Does this answer your question? [Express that, for a given property value, a property with the same name should exist using json schema?](https://stackoverflow.com/questions/55691332/express-that-for-a-given-property-value-a-property-with-the-same-name-should-e) – Byted Sep 08 '22 at 08:20

0 Answers0