When I have an API spec in OpenAPI 3.0 in yml format, with the following section defined, the collection validation indicates an error that the body parameters in JSON format should be removed from the collection even though the API Spec and Collection both show that it should be there. The ‘username’ field’s value is showing up with a random value, different value in each request that this issue is showing up in.
The collection was generated from the API Spec without modification before validating through API Designer.
API Spec Snippet:
/resetpassword:
post:
summary: Reset Password
operationId: resetPassword
security:
- authorizer: []
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ResetPasswordRequest"
example:
username: "{{USER_NAME}}"
oldPassword: "{{PASSWORD}}"
newPassword: "{{NEW_PASSWORD}}"
required: true
responses:
200:
description: "200 response"
content:
application/json:
schema:
$ref: "#/components/schemas/ResetPasswordResponse"
example:
status: 200
code: 2003
message: "Password reset successfully."
...
components:
schemas:
ResetPasswordRequest:
title: "Reset Password Request Schema"
required:
- "username"
- "oldPassword"
- "newPassword"
type: "object"
properties:
username:
pattern: "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+$"
type: "string"
oldPassword:
type: "string"
newPassword:
type: "string"
...
Collection Request for ResetPassword Body:
{
"username": "<string>",
"oldPassword": "<string>",
"newPassword": "<string>"
}
Environment with variable defined for:
USER_NAME
with value as email format.
Collection Validation Web Page for ResetPassword:
Thank you for your time and help.