Open LukDrews opened 2 years ago
My application uses some custom formats + validators for EAN barcodes. The custom validation function is called when I use it like this:
const apiDoc = { openapi: "3.0.0", ... components: { ... parameters: { productBarcode: { name: "barcode", in: "path", schema: { type: "string", format: "eanBarcode", }, required: true, }, }, }, };
But when I try to use a $ref in the productBarcode schema the validator isn't called:
const apiDoc = { openapi: "3.0.0", ... components: { schemas: { eanBarcode: { type: "string", format: "eanBarcode", }, }, ... parameters: { productBarcode: { name: "barcode", in: "path", schema: { $ref: "#/components/schemas/eanBarcode", }, required: true, }, }, }, };
Is this intentional or a bug?
My application uses some custom formats + validators for EAN barcodes. The custom validation function is called when I use it like this:
But when I try to use a $ref in the productBarcode schema the validator isn't called:
Is this intentional or a bug?