Closed wok-gocaspi closed 2 years ago
Hi @wok-gocaspi,
I have test to transform the collection and the reusts are different of the one you are pasting in the issue, what I get as result is this:
openapi: 3.0.0
info:
title: example-project
version: 1.0.0
servers:
- url: http://localhost:9090
paths:
/employee/create:
post:
tags:
- default
summary: CreateEmployee
requestBody:
content:
application/json:
schema:
type: object
example:
employees:
- id: '{{emp1id}}'
first_name: '{{emp1prename}}'
last_name: '{{emp1surname}}'
email: '{{emp1email}}'
- id: '{{emp2id}}'
first_name: '{{emp2prename}}'
last_name: '{{emp2surname}}'
email: '{{emp2email}}'
- id: '{{emp3id}}'
first_name: '{{emp3prename}}'
last_name: '{{emp3surname}}'
email: '{{emp3email}}'
responses:
'200':
description: Successful response
content:
application/json: {}
/employee/{emp2id}/get:
get:
tags:
- default
summary: GetEmployee
parameters:
- name: emp2id
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
/employee/get:
get:
tags:
- default
summary: GetPaginatedEmployees
parameters:
- name: page
in: query
schema:
type: integer
example: '1'
- name: limit
in: query
schema:
type: integer
example: '3'
responses:
'200':
description: Successful response
content:
application/json: {}
/employee/{emp1id}/delete:
delete:
tags:
- default
summary: DeleteEmployee
parameters:
- name: emp1id
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
/employee/update:
put:
tags:
- default
summary: UpdateMany
requestBody:
content:
application/json:
schema:
type: object
example:
- id: frfffrf
first_name: Peter
last_name: '123'
- id: '101'
first_name: Tester
last_name: '123'
responses:
'200':
description: Successful response
content:
application/json: {}
If you pass this result into for example the https://editor.swagger.io/ you will see that no error appears, if you compare the result that you paste in the issue and this one there are some differences but the one that is causing the problem I think is that your result is missing the path /employee/create
that is the first path.
Not sure how is your code but you can see a working example of this concrete collection in the branch issue-197 in the file index.spce.js
there is a test 'issue 197' that will generate a result that doesn´t have any error.
Best Regards.
Hello Guys,
maybe i dont know on how to use this tool, but when i convert a postman 2.1 collection to an OpenAPI 3.0 yaml with this tool, every other tool that will take this yaml file as an OpenAPI 3.0 input says its invalid.
My Postman Collection JSON:
My Postman Collection gets converted into this:
When i set the above example as an input for example from the tool widdershins it will throw:
YAMLSemanticError: Nested mappings are not allowed in compact mappings
And when i parse the aboove yaml into the swagger editor it says that at line 36:
I would appreciate if you would look into this and let me now if maybe i did something wrong and how to fix it. Cheers, TheWOK