OpenAPI generated code by openapi-generator-cli

325 Views Asked by At

So I've generated some code with the petstore.yaml from the official OpenAPI website using openapi-generator-cli. But when I test it with postman it show error code 400 and the error message body as below:

{
    "message": "request should have required property 'headers'",
    "errors": [
        {
            "path": ".headers",
            "message": "should have required property 'headers'",
            "errorCode": "required.openapi.validation"
        }
    ]
}

Please, help me! I'm stuck!

I have tried writing my .yaml file, but it's still the same. But one thing to remember is I haven't tried to change any code in the generated files. I'm still new to this so any help is appreciated.

0

There are 0 best solutions below