Closed jobykoshy closed 3 years ago
Hello, @jobykoshy. Thank you for the issue. I'm trying to replicate your error, but I don't think I have enough information. Could you simplify the examples so that they only contain the pertinent data. For example, this looks like it comes from the tradeLegs
property so we probably don't need any of the other properties. Also, you did not include the schemas for InterestRateInstrument
and ForeignExchangeInstrument
that I'll also need to see to help troubleshoot this.
"tradeLegs": {
"type": "array",
"description": "The definition of trade financials by leg.",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/InterestRateInstrument"
},
{
"$ref": "#/components/schemas/ForeignExchangeInstrument"
}
],
"discriminator": {
"propertyName": "instrumentType",
"mapping": {
"InterestRateInstrument": "#/components/schemas/InterestRateInstrument",
"ForeignExchangeInstrument": "#/components/schemas/ForeignExchangeInstrument"
}
}
}
}
"InterestRateInstrument": {
"type": "object",
"title": "InterestRateInstrument",
"description": "The financial description of fixed or floating Interest Rate instrument.",
"properties": {
"instrumentType": {
"type": "string",
"enum": [
"InterestRateInstrument"
]
},
"instrumentId": {
"type": "string",
"example": "1233344",
"description": "Identifier of trade financial instrument",
"maxLength": 50
},
"currency": {
"type": "string",
"example": "EUR",
"description": "Trade currency in format of ISO 4217.",
"pattern": "[A-Z]{3,3}"
},
"crossCurrency": {
"type": "string",
"example": "USD",
"description": "Cross/non-deliverable currency in format of ISO 4217.",
"pattern": "[A-Z]{3,3}"
}
}
},
"ForeignExchangeInstrument": {
"type": "object",
"title": "ForeignExchangeInstrument",
"description": "The financial description of foreign exchange instrument.",
"properties": {
"instrumentType": {
"type": "string",
"enum": [
"ForeignExchangeInstrument"
]
},
"instrumentId": {
"type": "string",
"example": "1233366",
"description": "Identifier of trade financial instrument.",
"maxLength": 50
},
"currency1": {
"type": "string",
"example": "EUR",
"description": "Base (main) currency in format of ISO 4217.",
"pattern": "[A-Z]{3,3}"
},
"currency2": {
"type": "string",
"example": "EUR",
"description": "Money currency in format of ISO 4217.",
"pattern": "[A-Z]{3,3}"
},
"splitCurrency": {
"type": "string",
"example": "EUR",
"description": "Split currency in format of ISO 4217.",
"pattern": "[A-Z]{3,3}"
}
}
}
Please see the updated sample. Hope this would help you to replicate the error.
I am unable to replicate the error using enforcer version 1.13.3. Have you tried updating?
Closing due to inactivity.
Getting issues in OAS3 document from openapi-enforcer @ 1.11.2
The OAS3 schema is ,
Validating Response is,
after updating with mapping
it shows
TypeError: Cannot read property 'staticData' of undefined"