openapi-to-postman
openapi-to-postman copied to clipboard
Inconsistent example/body text being produced for json schema
Issue
I am getting what I can best describe as inconsistent ipsum text in the body (example) of many example entries. I have selected request/example ParametersResolution to schema, so I expect all variables will be described in the form "
Eg:
"body": "{\n \"Status\": \"Duis laboris tempor\",\n \"Results\": [\n {\n \"Match\": \"<string>\",\n \"Record\": {\n \"SubjectType\": \"in cupidatat ea\",\n \"SubjectId\": \"<string>\"\n }\n },\n {\n \"Match\": \"<string>\",\n \"Record\": {\n \"SubjectType\": \"dolore commodo exercitat\",\n \"SubjectId\": \"<string>\"\n }\n }\n ]\n}",
Example Provided:
example contains 2 files, the openapi source and the postman output. It was generated with the following cli command:
openapi2postmanv2 -s dist/openapi.json -o dist/postman.json -p -O requestParametersResolution=schema,exampleParametersResolution=schema
I think I'm seeing this same issue in documentation generated from an imported OpenAPI schema.
I have example
properties on individual fields, which sometimes display in the generated documentation, and sometimes do not.
In these screenshots, only the email
field is populated using my specified example
key.
I do not have any request examples
specified for this endpoint.


having the same issue as @rpcesar "ipsum" text is replaced everywhere in the body of the request
Same here...
@rpcesar Thanks for reporting the issue. It seems the issue is due to module not correctly understanding schemas with only enum
mentioned (i.e. without "type": "string"
mentioned in them). We'll start working on a fix for this and let you know once fixed in the upcoming weeks.
As for the issue reported by deleted user ghost
, It should be working as expected. I've verified the same and below is request body that gets generated.
@a-dawg @homemdasneves It'd also help us in getting more issues fixed if not the same as this if you could share a sample spec where you have this issue as it could happen due to multiple reason. i.e. If the mentioned example is not valid according to corresponding schema then we generate value overriding the example.