Skip to content

Complicate JSON schema causes the MissingRefError #417

@samchon

Description

@samchon

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.2.0

Plugin version

No response

Node.js version

16.13.2

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

Windows 11

Description

When extremely complicated JSON schema comes, the MissingRefError be occurs.

MissingRefError: can't resolve reference components#/schemas/IShoppingSaleUnit.IInvert from id IShoppingSale.IInvert
    at Object.code (D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\vocabularies\core\ref.js:21:19)
    at keywordCode (D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\compile\validate\index.js:454:13)
    at D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\compile\validate\index.js:185:25
    at CodeGen.code (D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\compile\codegen\index.js:439:13)
    at CodeGen.block (D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\compile\codegen\index.js:568:18)
    at schemaKeywords (D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\compile\validate\index.js:185:13)
    at typeAndKeywords (D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\compile\validate\index.js:128:5)
    at subSchemaObjCode (D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\compile\validate\index.js:115:5)
    at subschemaCode (D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\compile\validate\index.js:91:13)
    at KeywordCxt.subschema (D:\github\contributions\bug-reports\node_modules\?[4majv?[24m\dist\compile\validate\index.js:428:9) {
  missingRef: ?[32m'components#/schemas/IShoppingSaleUnit.IInvert'?[39m,
  missingSchema: ?[32m'components'?[39m
}

Steps to Reproduce

To demonstrate the error, I especially prepared a extermely complicated JSON schema.

const faster = require("fast-json-stringify");

const stringify = faster
(
    {
        "$ref": "components#/schemas/IShoppingOrderDiscountable"
    },
    {
        schema: { components: { schemas: {
            "IShoppingOrderDiscountable": {
                "$id": "IShoppingOrderDiscountable",
                "type": "object",
                "properties": {
                    "coin": {
                        "type": "number",
                        "nullable": false
                    },
                    "combinations": {
                        "type": "array",
                        "items": {
                            "$ref": "components#/schemas/IShoppingCouponCombination"
                        },
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "coin",
                    "combinations"
                ]
            },
            "IShoppingCouponCombination": {
                "$id": "IShoppingCouponCombination",
                "type": "object",
                "properties": {
                    "coupons": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "components#/schemas/IShoppingChannelCoupon.IInvert"
                                },
                                {
                                    "$ref": "components#/schemas/IShoppingCompanyCoupon.IInvert"
                                },
                                {
                                    "$ref": "components#/schemas/IShoppingSectionCoupon.IInvert"
                                },
                                {
                                    "$ref": "components#/schemas/IShoppingSellerCoupon.IInvert"
                                },
                                {
                                    "$ref": "components#/schemas/IShoppingSaleSnapshotCoupon.IInvert"
                                }
                            ]
                        },
                        "nullable": false
                    },
                    "amount": {
                        "type": "number",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "coupons",
                    "amount"
                ]
            },
            "IShoppingChannelCoupon.IInvert": {
                "$id": "IShoppingChannelCoupon.IInvert",
                "type": "object",
                "properties": {
                    "channel": {
                        "$ref": "components#/schemas/IShoppingChannel"
                    },
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "type": {
                        "type": "string",
                        "nullable": false
                    },
                    "discount": {
                        "$ref": "components#/schemas/IShoppingCoupon.IDiscount"
                    },
                    "restriction": {
                        "$ref": "components#/schemas/IShoppingCoupon.IRestriction"
                    },
                    "inventory": {
                        "$ref": "components#/schemas/IShoppingCoupon.IInventory"
                    },
                    "opened_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "closed_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "channel",
                    "id",
                    "name",
                    "type",
                    "discount",
                    "restriction",
                    "inventory",
                    "opened_at",
                    "closed_at",
                    "created_at"
                ]
            },
            "IShoppingChannel": {
                "$id": "IShoppingChannel",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "code": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "exclusive": {
                        "type": "boolean",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "code",
                    "name",
                    "exclusive"
                ]
            },
            "IShoppingCoupon.IDiscount": {
                "$id": "IShoppingCoupon.IDiscount",
                "type": "object",
                "properties": {
                    "unit": {
                        "type": "string",
                        "nullable": false
                    },
                    "value": {
                        "type": "number",
                        "nullable": false
                    },
                    "threshold": {
                        "type": "number",
                        "nullable": true
                    },
                    "limit": {
                        "type": "number",
                        "nullable": true
                    }
                },
                "nullable": false,
                "required": [
                    "unit",
                    "value",
                    "threshold",
                    "limit"
                ]
            },
            "IShoppingCoupon.IRestriction": {
                "$id": "IShoppingCoupon.IRestriction",
                "type": "object",
                "properties": {
                    "access": {
                        "type": "string",
                        "nullable": false
                    },
                    "exclusive": {
                        "type": "boolean",
                        "nullable": false
                    },
                    "expired_in": {
                        "type": "number",
                        "nullable": true
                    },
                    "expired_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "volume": {
                        "type": "number",
                        "nullable": true
                    },
                    "volume_per_citizen": {
                        "type": "number",
                        "nullable": true
                    }
                },
                "nullable": false,
                "required": [
                    "access",
                    "exclusive",
                    "expired_in",
                    "expired_at",
                    "volume",
                    "volume_per_citizen"
                ]
            },
            "IShoppingCoupon.IInventory": {
                "$id": "IShoppingCoupon.IInventory",
                "type": "object",
                "properties": {
                    "volume": {
                        "type": "number",
                        "nullable": true
                    },
                    "volume_per_citizen": {
                        "type": "number",
                        "nullable": true
                    }
                },
                "nullable": false,
                "required": [
                    "volume",
                    "volume_per_citizen"
                ]
            },
            "IShoppingCompanyCoupon.IInvert": {
                "$id": "IShoppingCompanyCoupon.IInvert",
                "type": "object",
                "properties": {
                    "company": {
                        "$ref": "components#/schemas/IShoppingCompany.IInvert"
                    },
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "type": {
                        "type": "string",
                        "nullable": false
                    },
                    "discount": {
                        "$ref": "components#/schemas/IShoppingCoupon.IDiscount"
                    },
                    "restriction": {
                        "$ref": "components#/schemas/IShoppingCoupon.IRestriction"
                    },
                    "inventory": {
                        "$ref": "components#/schemas/IShoppingCoupon.IInventory"
                    },
                    "opened_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "closed_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "company",
                    "id",
                    "name",
                    "type",
                    "discount",
                    "restriction",
                    "inventory",
                    "opened_at",
                    "closed_at",
                    "created_at"
                ]
            },
            "IShoppingCompany.IInvert": {
                "$id": "IShoppingCompany.IInvert",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "logo": {
                        "$ref": "components#/schemas/IShoppingCompanyLogo.IStore.Nullable"
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "country": {
                        "type": "string",
                        "nullable": false
                    },
                    "homepage": {
                        "type": "string",
                        "nullable": true
                    },
                    "signature": {
                        "type": "string",
                        "nullable": false
                    },
                    "introduction": {
                        "type": "string",
                        "nullable": false
                    },
                    "established_at": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "logo",
                    "name",
                    "country",
                    "homepage",
                    "signature",
                    "introduction",
                    "established_at"
                ]
            },
            "IShoppingCompanyLogo.IStore.Nullable": {
                "$id": "IShoppingCompanyLogo.IStore.Nullable",
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "nullable": false
                    },
                    "description": {
                        "type": "string",
                        "nullable": false
                    },
                    "image": {
                        "$ref": "components#/schemas/IAttachmentFile.IStore"
                    }
                },
                "nullable": true,
                "required": [
                    "title",
                    "description",
                    "image"
                ]
            },
            "IAttachmentFile.IStore": {
                "$id": "IAttachmentFile.IStore",
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "extension": {
                        "type": "string",
                        "nullable": true
                    },
                    "url": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "name",
                    "extension",
                    "url"
                ]
            },
            "IShoppingSectionCoupon.IInvert": {
                "$id": "IShoppingSectionCoupon.IInvert",
                "type": "object",
                "properties": {
                    "section": {
                        "$ref": "components#/schemas/IShoppingSection.IInvert"
                    },
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "type": {
                        "type": "string",
                        "nullable": false
                    },
                    "discount": {
                        "$ref": "components#/schemas/IShoppingCoupon.IDiscount"
                    },
                    "restriction": {
                        "$ref": "components#/schemas/IShoppingCoupon.IRestriction"
                    },
                    "inventory": {
                        "$ref": "components#/schemas/IShoppingCoupon.IInventory"
                    },
                    "opened_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "closed_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "section",
                    "id",
                    "name",
                    "type",
                    "discount",
                    "restriction",
                    "inventory",
                    "opened_at",
                    "closed_at",
                    "created_at"
                ]
            },
            "IShoppingSection.IInvert": {
                "$id": "IShoppingSection.IInvert",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "code": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "code",
                    "name"
                ]
            },
            "IShoppingSellerCoupon.IInvert": {
                "$id": "IShoppingSellerCoupon.IInvert",
                "type": "object",
                "properties": {
                    "seller": {
                        "$ref": "components#/schemas/IShoppingSeller.IInvert"
                    },
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "type": {
                        "type": "string",
                        "nullable": false
                    },
                    "discount": {
                        "$ref": "components#/schemas/IShoppingCoupon.IDiscount"
                    },
                    "restriction": {
                        "$ref": "components#/schemas/IShoppingCoupon.IRestriction"
                    },
                    "inventory": {
                        "$ref": "components#/schemas/IShoppingCoupon.IInventory"
                    },
                    "opened_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "closed_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "seller",
                    "id",
                    "name",
                    "type",
                    "discount",
                    "restriction",
                    "inventory",
                    "opened_at",
                    "closed_at",
                    "created_at"
                ]
            },
            "IShoppingSeller.IInvert": {
                "$id": "IShoppingSeller.IInvert",
                "type": "object",
                "properties": {
                    "company": {
                        "$ref": "components#/schemas/IShoppingCompany.IInvert"
                    },
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "citizen": {
                        "$ref": "components#/schemas/ICitizen"
                    },
                    "email": {
                        "type": "string",
                        "nullable": false
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "company",
                    "id",
                    "citizen",
                    "email",
                    "created_at"
                ]
            },
            "ICitizen": {
                "$id": "ICitizen",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "mobile": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "name",
                    "mobile"
                ]
            },
            "IShoppingSaleSnapshotCoupon.IInvert": {
                "$id": "IShoppingSaleSnapshotCoupon.IInvert",
                "type": "object",
                "properties": {
                    "sale": {
                        "$ref": "components#/schemas/IShoppingSale.IInvert"
                    },
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "type": {
                        "type": "string",
                        "nullable": false
                    },
                    "discount": {
                        "$ref": "components#/schemas/IShoppingCoupon.IDiscount"
                    },
                    "restriction": {
                        "$ref": "components#/schemas/IShoppingCoupon.IRestriction"
                    },
                    "inventory": {
                        "$ref": "components#/schemas/IShoppingCoupon.IInventory"
                    },
                    "opened_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "closed_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "sale",
                    "id",
                    "name",
                    "type",
                    "discount",
                    "restriction",
                    "inventory",
                    "opened_at",
                    "closed_at",
                    "created_at"
                ]
            },
            "IShoppingSale.IInvert": {
                "$id": "IShoppingSale.IInvert",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "snapshot_id": {
                        "type": "string",
                        "nullable": false
                    },
                    "section": {
                        "$ref": "components#/schemas/IShoppingSection.IInvert"
                    },
                    "seller": {
                        "$ref": "components#/schemas/IShoppingSeller.IInvert"
                    },
                    "title": {
                        "type": "string",
                        "nullable": false
                    },
                    "latest": {
                        "type": "boolean",
                        "nullable": false
                    },
                    "units": {
                        "type": "array",
                        "items": {
                            "$ref": "components#/schemas/IShoppingSaleUnit.IInvert"
                        },
                        "nullable": false
                    },
                    "representative_image": {
                        "$ref": "components#/schemas/IAttachmentFile.IStore.Nullable"
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": false
                    },
                    "updated_at": {
                        "type": "string",
                        "nullable": false
                    },
                    "opened_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "closed_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "paused_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "suspended_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "favored_at": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "snapshot_id",
                    "section",
                    "seller",
                    "title",
                    "latest",
                    "units",
                    "representative_image",
                    "created_at",
                    "updated_at",
                    "opened_at",
                    "closed_at",
                    "paused_at",
                    "suspended_at",
                    "favored_at"
                ]
            },
            "IShoppingSaleUnit.IInvert": {
                "$id": "IShoppingSaleUnit.IInvert",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "product": {
                        "$ref": "components#/schemas/IProduct-lt-string-gt-"
                    },
                    "brand": {
                        "$ref": "components#/schemas/IBrand.ISummary"
                    },
                    "stocks": {
                        "type": "array",
                        "items": {
                            "$ref": "components#/schemas/IShoppingSaleUnitStock.IInvert"
                        },
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "state": {
                        "type": "string",
                        "nullable": false
                    },
                    "primary": {
                        "type": "boolean",
                        "nullable": false
                    },
                    "required": {
                        "type": "boolean",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "product",
                    "brand",
                    "stocks",
                    "name",
                    "state",
                    "primary",
                    "required"
                ]
            },
            "IProduct-lt-string-gt-": {
                "$id": "IProduct-lt-string-gt-",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "type": {
                        "type": "string",
                        "nullable": false
                    },
                    "manufacturer": {
                        "$ref": "components#/schemas/IManufacturer.ISummary"
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "tangible": {
                        "type": "boolean",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "type",
                    "manufacturer",
                    "name",
                    "tangible"
                ]
            },
            "IManufacturer.ISummary": {
                "$id": "IManufacturer.ISummary",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "name"
                ]
            },
            "IBrand.ISummary": {
                "$id": "IBrand.ISummary",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "name"
                ]
            },
            "IShoppingSaleUnitStock.IInvert": {
                "$id": "IShoppingSaleUnitStock.IInvert",
                "type": "object",
                "properties": {
                    "image": {
                        "$ref": "components#/schemas/IAttachmentFile.IStore.Nullable"
                    },
                    "elements": {
                        "type": "array",
                        "items": {
                            "$ref": "components#/schemas/IShoppingSaleUnitStockElement.IInvert"
                        },
                        "nullable": false
                    },
                    "item": {
                        "$ref": "components#/schemas/IShoppingCartCommodityItem.IInvert"
                    },
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "disabled": {
                        "type": "boolean",
                        "nullable": false
                    },
                    "price": {
                        "$ref": "components#/schemas/IShoppingPrice"
                    },
                    "inventory": {
                        "$ref": "components#/schemas/IShoppingSaleUnitStock.IInventory"
                    },
                    "variant_id": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "nullable": false,
                "required": [
                    "image",
                    "elements",
                    "item",
                    "id",
                    "name",
                    "disabled",
                    "price",
                    "inventory",
                    "variant_id"
                ]
            },
            "IAttachmentFile.IStore.Nullable": {
                "$id": "IAttachmentFile.IStore.Nullable",
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "extension": {
                        "type": "string",
                        "nullable": true
                    },
                    "url": {
                        "type": "string",
                        "nullable": false
                    }
                },
                "nullable": true,
                "required": [
                    "name",
                    "extension",
                    "url"
                ]
            },
            "IShoppingSaleUnitStockElement.IInvert": {
                "$id": "IShoppingSaleUnitStockElement.IInvert",
                "type": "object",
                "properties": {
                    "option": {
                        "$ref": "components#/schemas/IShoppingSaleUnitOption.IInvert"
                    },
                    "candidate": {
                        "$ref": "components#/schemas/IShoppingSaleUnitOptionCandidate.IInvert.Nullable"
                    },
                    "value": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "nullable": false,
                "required": [
                    "option",
                    "candidate",
                    "value"
                ]
            },
            "IShoppingSaleUnitOption.IInvert": {
                "$id": "IShoppingSaleUnitOption.IInvert",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "type": {
                        "type": "string",
                        "nullable": false
                    },
                    "fee": {
                        "type": "number",
                        "nullable": true
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "name",
                    "type",
                    "fee"
                ]
            },
            "IShoppingSaleUnitOptionCandidate.IInvert.Nullable": {
                "$id": "IShoppingSaleUnitOptionCandidate.IInvert.Nullable",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "name": {
                        "type": "string",
                        "nullable": false
                    },
                    "fee": {
                        "type": "number",
                        "nullable": true
                    }
                },
                "nullable": true,
                "required": [
                    "id",
                    "name",
                    "fee"
                ]
            },
            "IShoppingCartCommodityItem.IInvert": {
                "$id": "IShoppingCartCommodityItem.IInvert",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "nullable": false
                    },
                    "quantity": {
                        "type": "number",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "id",
                    "quantity"
                ]
            },
            "IShoppingPrice": {
                "$id": "IShoppingPrice",
                "type": "object",
                "properties": {
                    "tax_ratio": {
                        "type": "number",
                        "nullable": false
                    },
                    "nominal": {
                        "type": "number",
                        "nullable": false
                    },
                    "real": {
                        "type": "number",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "tax_ratio",
                    "nominal",
                    "real"
                ]
            },
            "IShoppingSaleUnitStock.IInventory": {
                "$id": "IShoppingSaleUnitStock.IInventory",
                "type": "object",
                "properties": {
                    "income": {
                        "type": "number",
                        "nullable": false
                    },
                    "reserve": {
                        "type": "number",
                        "nullable": false
                    },
                    "outcome": {
                        "type": "number",
                        "nullable": false
                    }
                },
                "nullable": false,
                "required": [
                    "income",
                    "reserve",
                    "outcome"
                ]
            }
        }
    }}}
);

stringify({
    "coin": 0,
    "combinations": [
        {
            "amount": 30000,
            "coupons": [
                {
                    "sale": {
                        "id": "e9ce4515-f715-4b19-a64a-41cdb897e7d2",
                        "snapshot_id": "1036d591-87d0-4bba-a8af-0347208bc5d8",
                        "title": "쫖쌝앓쫊볠 픂뫊턼 괄겞짦핶탷 딠페꿠퀯",
                        "latest": true,
                        "representative_image": {
                            // "id": "6f855fcf-687d-4877-9756-98334e649bf2",
                            "name": "rlxVYouTDRsyAJq",
                            "extension": "qsq",
                            "url": "https://picsum.photos/200/300?random"
                        },
                        "section": {
                            "id": "771d6640-4f49-45d5-9d04-714671dfb253",
                            "code": "general",
                            "name": "일반",
                            // "created_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                            // "deleted_at": null
                        },
                        "seller": {
                            "id": "81765b16-6c3c-4d0e-bbd1-705fce9b9863",
                            "email": "[email protected]",
                            "created_at": "Mon May 23 2022 20:21:11 GMT+0900 (Korean Standard Time)",
                            // "updated_at": "Mon May 23 2022 20:21:11 GMT+0900 (Korean Standard Time)",
                            // "deleted_at": null,
                            "citizen": {
                                "id": "3ba292d5-5d49-471b-ac44-e27a4a9a3030",
                                "mobile": "01068311922",
                                "name": "껏킲쉷",
                                // "created_at": "Mon May 23 2022 20:21:11 GMT+0900 (Korean Standard Time)",
                                // "updated_at": "Mon May 23 2022 20:21:11 GMT+0900 (Korean Standard Time)"
                            },
                            "company": {
                                "id": "3e6c34ef-dcc1-4798-9b9a-47416daf91bd",
                                "name": "쎳껃렖뽄",
                                "country": "퀐쎀꾡칓먼뻿컕",
                                "homepage": "https://www.naver.com",
                                "signature": "췹쪽드낂죁퇍",
                                "introduction": "긨떼닐 텘긞맣뼮휹캁 쑵 츖히칹곹폄솎 쬧밸고똩 쪱섁랄쮭 턂됂랶꼭뇰됨 훖뭼햸좕똤맨 땼띜등 죩굟뤭뗖 쵀쐽쌂왥 왩퇱묶 흸삥떝팛뀪 칸찼뼿 쐥럦텨깽 힡끢 쵩럏쳚뤖묲쭪 셠넆뼡맦 슌줥걯쎔폎덦풵 퍩 돯쏱뭛윏뮴홤 픈뜛 믯싩뺼쒃춼뎼쇸 뢟펊빴 돀 궡뻪끨뎮컎쬈 쉚햤뒻딥퀛 춄쇎쬺봭 썃뻖쥏혐 컯 챛엂뎬셭졿 뷅퍟콾횶촂졄뾼 딾뼫걡쀧퀑쐜 뒯겍쒺텏쨱쌫켼",
                                "established_at": "1900-01-01",
                                // "deleted_at": null,
                                "logo": {
                                    // "id": "987fc318-2c69-4b4c-85db-0362427441b3",
                                    // "sequence": 1,
                                    "title": "밍 꼡 뙻퉒퍭긔썢셦",
                                    "description": "폱튩핪흚츏들뙶 듚죮옱쒇뺆땾뚫 뗦켑땢쪢 쥢벝쾸솔눔퐁 견픢쭧즉꺅류땻 뎺굎 뿫듈쌊죹 잴큮좙낼 묌떈뼽 렷쯂 륷 뼪굁솜힎닅뤇 믓눭뉊뒾냀촟 뿞놽솩 뫀땂튩쉊릊눾 띛 멚롭뀇뒜폥 삪 됨횅퍈뷗 껀룋졦떆뎝좀눴 훔똗컆쑪캵 축뾱벸 평듸존거",
                                    "image": {
                                        // "id": "6b80bcc1-c4d6-4a50-b3b2-cb2b10c11e25",
                                        "name": "RPaZSkPKAm",
                                        "extension": "EKZ",
                                        "url": "https://picsum.photos/200/300?random"
                                    }
                                }
                            }
                        },
                        "units": [],
                        "created_at": "Mon May 23 2022 20:21:12 GMT+0900 (Korean Standard Time)",
                        "updated_at": "Mon May 23 2022 20:21:12 GMT+0900 (Korean Standard Time)",
                        "opened_at": "Mon May 23 2022 20:21:12 GMT+0900 (Korean Standard Time)",
                        "closed_at": "Wed Jul 13 2022 02:26:23 GMT+0900 (Korean Standard Time)",
                        "paused_at": null,
                        "suspended_at": null,
                        "favored_at": null
                    },
                    "id": "65559c8a-ac81-4e50-af6a-8f3aa2b7fd9d",
                    "type": "sale_snapshot",
                    "name": "뤐쎘빦퍜캆렳콞깕땏겈돼쫫",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": false,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 20:21:13 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 20:21:13 GMT+0900 (Korean Standard Time)"
                },
                {
                    "company": {
                        "id": "3e6c34ef-dcc1-4798-9b9a-47416daf91bd",
                        "name": "쎳껃렖뽄",
                        "country": "퀐쎀꾡칓먼뻿컕",
                        "homepage": "https://www.naver.com",
                        "signature": "췹쪽드낂죁퇍",
                        "introduction": "긨떼닐 텘긞맣뼮휹캁 쑵 츖히칹곹폄솎 쬧밸고똩 쪱섁랄쮭 턂됂랶꼭뇰됨 훖뭼햸좕똤맨 땼띜등 죩굟뤭뗖 쵀쐽쌂왥 왩퇱묶 흸삥떝팛뀪 칸찼뼿 쐥럦텨깽 힡끢 쵩럏쳚뤖묲쭪 셠넆뼡맦 슌줥걯쎔폎덦풵 퍩 돯쏱뭛윏뮴홤 픈뜛 믯싩뺼쒃춼뎼쇸 뢟펊빴 돀 궡뻪끨뎮컎쬈 쉚햤뒻딥퀛 춄쇎쬺봭 썃뻖쥏혐 컯 챛엂뎬셭졿 뷅퍟콾횶촂졄뾼 딾뼫걡쀧퀑쐜 뒯겍쒺텏쨱쌫켼",
                        "established_at": "1900-01-01",
                        // "deleted_at": null,
                        "logo": {
                            // "id": "987fc318-2c69-4b4c-85db-0362427441b3",
                            // "sequence": 1,
                            "title": "밍 꼡 뙻퉒퍭긔썢셦",
                            "description": "폱튩핪흚츏들뙶 듚죮옱쒇뺆땾뚫 뗦켑땢쪢 쥢벝쾸솔눔퐁 견픢쭧즉꺅류땻 뎺굎 뿫듈쌊죹 잴큮좙낼 묌떈뼽 렷쯂 륷 뼪굁솜힎닅뤇 믓눭뉊뒾냀촟 뿞놽솩 뫀땂튩쉊릊눾 띛 멚롭뀇뒜폥 삪 됨횅퍈뷗 껀룋졦떆뎝좀눴 훔똗컆쑪캵 축뾱벸 평듸존거",
                            "image": {
                                // "id": "6b80bcc1-c4d6-4a50-b3b2-cb2b10c11e25",
                                "name": "RPaZSkPKAm",
                                "extension": "EKZ",
                                "url": "https://picsum.photos/200/300?random"
                            }
                        }
                    },
                    "id": "8a0c10e5-dd9d-4255-8bd4-6c14c6179f3a",
                    "type": "company",
                    "name": "꺌밪롿핚딂쐸뼻굔뫢띗럹떩",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": false,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 20:21:13 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 20:21:13 GMT+0900 (Korean Standard Time)"
                },
                {
                    "channel": {
                        "id": "bd346b8d-3688-46d9-94a8-cb97c4a4da88",
                        "code": "archisketch.pavilion",
                        "name": "아키스케치 파빌리온",
                        "exclusive": false,
                        // "created_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "updated_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "deleted_at": null
                    },
                    "id": "0b95fba4-ef9c-48d9-8f62-521bce5b636e",
                    "type": "channel",
                    "name": "싿톥츝뼶껸햷씜찒믍뷿놻첓",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": false,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 20:21:13 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 20:21:13 GMT+0900 (Korean Standard Time)"
                },
                {
                    "channel": {
                        "id": "bd346b8d-3688-46d9-94a8-cb97c4a4da88",
                        "code": "archisketch.pavilion",
                        "name": "아키스케치 파빌리온",
                        "exclusive": false,
                        // "created_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "updated_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "deleted_at": null
                    },
                    "id": "9aadfa41-1dd3-44f8-a0a0-4aeb4fbb9990",
                    "type": "channel",
                    "name": "쑙떴쵌쏱됤논썶껛촊꿁봊맦",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": false,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 20:20:04 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 20:20:04 GMT+0900 (Korean Standard Time)"
                },
                {
                    "channel": {
                        "id": "bd346b8d-3688-46d9-94a8-cb97c4a4da88",
                        "code": "archisketch.pavilion",
                        "name": "아키스케치 파빌리온",
                        "exclusive": false,
                        // "created_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "updated_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "deleted_at": null
                    },
                    "id": "41477a28-b951-4167-8ad1-ccb7342a7d0a",
                    "type": "channel",
                    "name": "긦쬱볗샒뷝뼴춧뎑쥼첑싈턝",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": false,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 19:45:55 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 19:45:55 GMT+0900 (Korean Standard Time)"
                },
                {
                    "channel": {
                        "id": "bd346b8d-3688-46d9-94a8-cb97c4a4da88",
                        "code": "archisketch.pavilion",
                        "name": "아키스케치 파빌리온",
                        "exclusive": false,
                        // "created_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "updated_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "deleted_at": null
                    },
                    "id": "b0f3368f-3229-4d22-9ed8-4b9bfe07c854",
                    "type": "channel",
                    "name": "팮탎돕훁돯킐얼펾왊쪱곡넀",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": false,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 19:45:32 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 19:45:32 GMT+0900 (Korean Standard Time)"
                }
            ]
        },
        {
            "amount": 5000,
            "coupons": [
                {
                    "section": {
                        "id": "771d6640-4f49-45d5-9d04-714671dfb253",
                        "code": "general",
                        "name": "일반",
                        // "created_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "deleted_at": null
                    },
                    "id": "a8f09ff9-f07d-43d1-a3f1-e564f22c09c2",
                    "type": "section",
                    "name": "쩬쳣줶퉋쫫슋븆픛덒뤴퀓쉢",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": true,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 20:21:14 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 20:21:14 GMT+0900 (Korean Standard Time)"
                }
            ]
        },
        {
            "amount": 5000,
            "coupons": [
                {
                    "section": {
                        "id": "771d6640-4f49-45d5-9d04-714671dfb253",
                        "code": "general",
                        "name": "일반",
                        // "created_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "deleted_at": null
                    },
                    "id": "96d723f1-08e3-4d6f-ad40-174576a8e948",
                    "type": "section",
                    "name": "쳉윕삧횄뮔될튓쥾곆쨳죊겞",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": true,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 20:20:04 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 20:20:04 GMT+0900 (Korean Standard Time)"
                }
            ]
        },
        {
            "amount": 5000,
            "coupons": [
                {
                    "section": {
                        "id": "771d6640-4f49-45d5-9d04-714671dfb253",
                        "code": "general",
                        "name": "일반",
                        // "created_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "deleted_at": null
                    },
                    "id": "a328ac00-8e68-4033-9e9a-e370bfc2edda",
                    "type": "section",
                    "name": "뻱텅훲곕뿬짵픋홡뽫혠팞뫅",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": true,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 19:45:55 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 19:45:55 GMT+0900 (Korean Standard Time)"
                }
            ]
        },
        {
            "amount": 5000,
            "coupons": [
                {
                    "section": {
                        "id": "771d6640-4f49-45d5-9d04-714671dfb253",
                        "code": "general",
                        "name": "일반",
                        // "created_at": "Mon May 23 2022 19:45:12 GMT+0900 (Korean Standard Time)",
                        // "deleted_at": null
                    },
                    "id": "54e21fb3-653f-4299-9ed9-7c6fe32407ec",
                    "type": "section",
                    "name": "뀬숋빳띙쥱땻윁꾐썡쉱숧쨏",
                    "discount": {
                        "unit": "amount",
                        "value": 5000,
                        "threshold": null,
                        "limit": null
                    },
                    "restriction": {
                        "access": "public",
                        "volume": 10000,
                        "volume_per_citizen": 1,
                        "exclusive": true,
                        "expired_in": 15,
                        "expired_at": null
                    },
                    "inventory": {
                        "volume": 10000,
                        "volume_per_citizen": 1
                    },
                    "opened_at": "Mon May 23 2022 19:45:32 GMT+0900 (Korean Standard Time)",
                    "closed_at": null,
                    "created_at": "Mon May 23 2022 19:45:32 GMT+0900 (Korean Standard Time)"
                }
            ]
        }
    ]
});

Expected Behavior

Hope to be fixed

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