Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
docs: update new feature for parse "form-data"
Browse files Browse the repository at this point in the history
  • Loading branch information
joolfe committed Jul 24, 2021
1 parent b569785 commit 4699d50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Binary file added docs/assets/img/formDataOptions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Transform query, headers and path parameters (description, required...).
* Postman variables as Path parameters.
* Automatic infer types from query and headers parameters.
* Support Json and Text body formats.
* Support postman "raw" body for `Json` and `Text` formats and also postman body "form-data".
* Postman Authorization parse or by configuration (Basic and Bearer).
* Contact and License from variables or by configuration.
* Provide meta-information as a markdown table.
Expand Down Expand Up @@ -320,7 +320,7 @@ The default value is `true`, so headers are by default added to the response def

## Basic conversion

This library support the transformation from Postman collection to all the basic HTTP method as GET, POST, PUT... and also parse the body request of type raw `Json` or `Text` type. [Query parameters](#parameters-parsing) are also supported.
This library support the transformation from Postman collection to all the basic HTTP method as GET, POST, PUT... parse the body request of type "raw" (`Json` and `Text`) and "form-data" (see ["form-data" body](#form-data-body) section for more info about this mode). [Query parameters](#parameters-parsing) are also supported.

Have a look to the [PostmantoOpenAPI collection](https://github.com/joolfe/postman-to-openapi/blob/master/test/resources/input/v21/PostmantoOpenAPI.json) file for an example of how to use this feature.

Expand Down Expand Up @@ -439,6 +439,14 @@ Take into account that this feature has priority over the [Response status code

If there are more than one example at request level the used headers will be the ones that appear in the last example in the postman collection.

## "form-data" Body

Library `postman-to-openapi` is able to parse the Postman collection body request of type "form-data", as Postman only support the parameter types `Text` and `File` (as you can see in next image) this are the only supported types for the Library.

![form-data options](assets/img/formDataOptions.png)

A "form-data" request body will be describe as a `multipart/form-data` content with schema of type `object`. For `Text` parameter `postman-to-openapi` will parse just as a `type: string` parameter and for type `File` following OpenAPI specs is parsed as `type: string, format: binary`

</div></div>
<div class="tilted-section"><div markdown="1">

Expand Down

0 comments on commit 4699d50

Please sign in to comment.