Adyen / adyen-openapi

OpenAPI specification for the Adyen APIs
MIT License
67 stars 50 forks source link

CheckoutService-v64.json: KlarnaDetails > type contains default value that is not in enum #18

Closed DJFliX closed 3 years ago

DJFliX commented 4 years ago

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 a default value of openinvoice. The list of allowed values is klarna,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.

a-akimov commented 3 years ago

@DJFliX thank you for reporting this. It will be fixed in the next update to our spec files.

a-akimov commented 3 years ago

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.