This repository has been archived by the owner on Dec 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from joolfe/develop
x-logo extension
- Loading branch information
Showing
10 changed files
with
393 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,6 +129,7 @@ The basic information of the API is obtained from Postman collection as describe | |
| `termsOfService` | String. A URL to the Terms of Service for the API. MUST be in the format of a URL. | | ||
| `contact` | Object. The contact information for the exposed API. See details in [License and Contact configuration](#license-and-contact-configuration) section. | | ||
| `license` | Object. The license information for the exposed API.See details in [License and Contact configuration](#license-and-contact-configuration) section. | | ||
| `xLogo` | Object. Contain the info for the `x-logo` extension defined by [redoc](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md#x-logo) | | ||
|
||
Basically this are the required and relevant parameters defined in OpenAPI spec [info object](http://spec.openapis.org/oas/v3.0.3.html#info-object), an example of the option will be: | ||
|
||
|
@@ -147,6 +148,11 @@ Basically this are the required and relevant parameters defined in OpenAPI spec | |
name: 'My Support', | ||
url: 'http://www.api.com/support', | ||
email: '[email protected]' | ||
}, | ||
xLogo: { | ||
url: 'https://github.com/joolfe/logoBanner.png', | ||
backgroundColor: '#FFFFFF', | ||
altText: 'Example logo' | ||
} | ||
} | ||
} | ||
|
@@ -355,9 +361,9 @@ const result = await postmanToOpenApi(postmanCollection, outputFile, { servers: | |
|
||
This will remove the `servers` field from the yml specification result. | ||
|
||
## License and Contact configuration | ||
## Pass data as postman collection variables | ||
|
||
Inside the [info object](http://spec.openapis.org/oas/v3.0.3.html#info-object) of OpenAPI definition exist two Object fields called `contact` and `license`, this fields are very useful for provide information to developers, but inside a Postman collection not exist any "standard" way to save this information, for this reason we use [Postman collection variables](https://learning.postman.com/docs/sending-requests/variables/) to define this options. | ||
Inside the [info object](http://spec.openapis.org/oas/v3.0.3.html#info-object) of OpenAPI definition exist some Object fields as `contact`, `license` or `xLogo`, this fields are very useful for provide information to developers, but inside a Postman collection not exist any "standard" way to save this information, for this reason we use [Postman collection variables](https://learning.postman.com/docs/sending-requests/variables/) to define this options and maintain this info indie the postman collection. | ||
|
||
Is as easy as define the values in the "Edit Collection" form page inside the tab "Variables", as showed in the next image: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "e223ab3f-2683-4759-9e41-8167a7caaf99", | ||
"name": "Simple Post", | ||
"description": "Just a simple collection for test", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Create new User", | ||
"request": { | ||
"method": "POST", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\n \"example\": \"field\",\n \"other\": {\n \"data1\": \"yes\",\n \"data2\": \"no\"\n }\n}", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
} | ||
} | ||
}, | ||
"url": "https://api.io/users", | ||
"description": "Create a new user into your amazing API" | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Post empty raw", | ||
"request": { | ||
"method": "POST", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
} | ||
} | ||
}, | ||
"url": "https://api.io/raw", | ||
"description": "Create a new user into your amazing API" | ||
}, | ||
"response": [] | ||
} | ||
], | ||
"event": [ | ||
{ | ||
"listen": "prerequest", | ||
"script": { | ||
"type": "text/javascript", | ||
"exec": [ | ||
"" | ||
] | ||
} | ||
}, | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"type": "text/javascript", | ||
"exec": [ | ||
"" | ||
] | ||
} | ||
} | ||
], | ||
"variable": [ | ||
{ | ||
"key": "version", | ||
"value": "2.3.0" | ||
}, | ||
{ | ||
"key": "x-logo.urlVar", | ||
"value": "https://github.com/joolfe/mylogo.png" | ||
}, | ||
{ | ||
"key": "x-logo.backgroundColorVar", | ||
"value": "#000FFF" | ||
}, | ||
{ | ||
"key": "x-logo.altTextVar", | ||
"value": "Othert text for logo" | ||
}, | ||
{ | ||
"key": "x-logo.hrefVar", | ||
"value": "https://github.com/joolfe/here.html" | ||
} | ||
] | ||
} |
Oops, something went wrong.