-
Notifications
You must be signed in to change notification settings - Fork 865
Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the Issue
Postman mock server doesnt properly translate/generate response body when the specification(OAS) is having an example for an array of string/integer(schema) with more than 2 values. please find the complet details in the steps to reproduce.
Steps To Reproduce
- Open the API tab in postman
- Create a new API with schema type "OpenAPI 3.0" in Yaml format
- Define the specification with a schema that consists of a array of string/integer and also define an example for the same with more than two entries in the array as below, Also please find the attached yaml specification
petStore_Yaml.TXT
properties:
petNames:
type: array
items:
type: string
example:
petNames: ['one','two','three']
- Save the specification and goto 'generate collection' -> 'API Mocking'(Create mock server)
- Now goto collection tab -> to to the generated collection --> open the sample response body , it will be translated into an unexpected value as below ,
{
"petNames": [
"incididunt amet anim veniam",
"proident consequat"
]
}
- But if you provide 2 entires for the array in the example as below,
properties:
petNames:
type: array
items:
type: string
example:
petNames: ['one','two']
- Then if you generate a mock server , the reponse bodies are translating as expected ,
{
"petNames": [
"one",
"two"
]
}
It seems to be a bug in the mock server generator in postman which is not converting the array of primitive datatypes with more than two values in the example. Kindly pleae let us know whether this is already a known issue (or) is there any workaround available for the same. Kindly let us know incase of additional details.
Screenshots or Videos
No response
Environment Information
- Operating System: Windows 10 64-bit
- Platform Type: Postman application installed in windows(Native App)
- Postman Version: V8.9.1Additional Context?
No response