Replies: 1 comment 1 reply
-
Issue created at oas-tools/oas-tools#356. @cll023 To make a code block and insert yaml/javascript or whatever language you want just enclose your code with ```. Like this: ```yaml (set to the preferred language, e.g: python, javascript)
your:
yamlFile:
- here
``` Hope it helps :) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The following is my testing OAS API spec:
The following is main program:
With the above configuration, if I issue POST v1/test with the following JSON body:
{
"version": "string",
"id": "1234567"
}
I got 404 with the following response body:
{
"error": "RequestValidationError: Request body does not match the schema specified in the OAS Document:\n- Validation failed at #/properties/owner/required > must have required property 'id'"
}
oas Tool3 failed to recognize that "owner" is an optional filed. And after the following code
if (oasRequest.requestBody) {
const contentType = Object.keys(oasRequest.requestBody.content)[0];
body = schema.parseBody(body, oasRequest.requestBody.content[contentType].schema);
}
It sets owner as {}. Thus it fails the schema validation.
This is a blocking issue that prevent me from upgrading oas tool 3.
Could someone take a look at this issue? Thank you!
Sorry I don't know how to preserve the format of the YAML file when posting, but hope it still gets the idea crossed.
Beta Was this translation helpful? Give feedback.
All reactions