Open Reykudo opened 1 year ago
But what to do with the tests, they do not take into account the definitions. For example:
expected:
{
"oneOf": [
{
"properties": {
"tag": {
"enum": [
"ErrorNoUser"
],
"type": "string"
},
"userId": {
"maximum": 9223372036854775807,
"minimum": -9223372036854775808,
"type": "integer"
}
},
"required": [
"userId",
"tag"
],
"type": "object"
},
{
"properties": {
"requiredPermission": {
"type": "string"
},
"tag": {
"enum": [
"ErrorAccessDenied"
],
"type": "string"
}
},
"required": [
"requiredPermission",
"tag"
],
"type": "object"
}
],
"type": "object"
}
but got:
{
"discriminator": {
^
"mapping": {
"ErrorAccessDenied": "#/components/schemas/ErrorAccessDenied",
"ErrorNoUser": "#/components/schemas/ErrorNoUser"
},
"propertyName": "tag"
},
"oneOf": [
{
"$ref": "#/components/schemas/ErrorNoUser"
},
{
"$ref": "#/components/schemas/ErrorAccessDenied"
}
],
"type": "object"
}
Hello! I'm trying to implement support discriminator for sum-types. My way is to call a function that turns inline into a ref, without name clash(by appending
_
at end).