Adyen / adyen-openapi

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

FundService 400 status code responses do not map to a model #17

Closed DJFliX closed 3 years ago

DJFliX commented 4 years ago

In specs for AccountService, CheckoutService and probably others as well the Response for status code 400 does not map to a model or even to a string. This makes debugging an integration with these services frustrating.

As a workaround we patch some of the specs to use #/components/schemas/GenericResponse as a model for the 400 status code. In specs that don't contain that model we add the model to the spec or we map it to string.

a-akimov commented 4 years ago

@DJFliX thank you for reporting it, we are working on improving this part of our OpenAPI specs.

a-akimov commented 3 years ago

It is solved in today's update:

            "responses" : {
               "200" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "$ref" : "#/components/schemas/GenericResponse"
                        }
                     }
                  },
                  "description" : "OK - the request has succeeded."
               },
               "400" : {
                  "content" : {
                     "application/json" : {
                        "examples" : {
                           "generic-400" : {
                              "$ref" : "#/components/examples/generic-400"
                           }
                        },
                        "schema" : {
                           "$ref" : "#/components/schemas/ServiceError"
                        }
                     }
                  },
                  "description" : "Bad Request - a problem reading or understanding the request."
               },
               "401" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "$ref" : "#/components/schemas/ServiceError"
                        }
                     }
                  },
                  "description" : "Unauthorized - authentication required."
               },
               "403" : {
                  "content" : {
                     "application/json" : {
                        "examples" : {
                           "generic-403" : {
                              "$ref" : "#/components/examples/generic-403"
                           }
                        },
                        "schema" : {
                           "$ref" : "#/components/schemas/ServiceError"
                        }
                     }
                  },
                  "description" : "Forbidden - insufficient permissions to process the request."
               },
               "422" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "$ref" : "#/components/schemas/ServiceError"
                        }
                     }
                  },
                  "description" : "Unprocessable Entity - a request validation error."
               },
               "500" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "$ref" : "#/components/schemas/ServiceError"
                        }
                     }
                  },
                  "description" : "Internal Server Error - the server could not process the request."
               }
            }