Closed DJFliX closed 3 years ago
@DJFliX thank you for reporting this. It will be fixed in the next update to our spec files.
With the new update, the type
field is now defaulted to klarna
:
"type" : {
"default" : "klarna",
"description" : "**klarna**",
"enum" : [
"klarna",
"klarnapayments",
"klarnapayments_account",
"klarnapayments_b2b",
"klarna_paynow",
"klarna_account",
"klarna_b2b"
],
"type" : "string"
}
This should solve the problem, so I am closing this ticket.
Describe the bug When generating code for CheckoutService-v64.json I run in to an issue on code compilation:
KlarnaDetails contains a property called
type
that has adefault
value ofopeninvoice
. The list of allowed values isklarna
,klarnapayments
,klarnapayments_account
,klarnapayments_b2b
,klarna_paynow
,klarna_account
,klarna_b2b
.Because the default value is not a member of the enum, code generation wil fail for languages with strict types.
To Reproduce Generate code for a typed language (in our case Scala) based on CheckoutService-v64.json. Compiling that code should fail. Alternately look into the generated spec and verify that the
default
value is a member of the enum.Expected behavior The default value of this
type
is a member of the enum.