Skip to content

Instantly share code, notes, and snippets.

@Ch4ni
Last active April 1, 2024 17:46
Show Gist options
  • Save Ch4ni/986024d43712db52cdb54d4ce04aa91d to your computer and use it in GitHub Desktop.
Save Ch4ni/986024d43712db52cdb54d4ce04aa91d to your computer and use it in GitHub Desktop.
Swagger references in postman docs

Postman Documentation Updates - Swagger is Superceded by OpenAPI Spec 3.x

While looking through the postman website, I noticed that the Integrations page has an entry for APIMatic. This page excerpt mentions Swagger, but not OpenAPI which now supercedes the Swagger specification (the Chrome browser will scroll to the right section. In Firefox search for text "How is the OpenAPI Specification different from Swagger"). The APIMatic documentation lists support for both Swagger and OpenAPI Specifications.

To determine the scope of work required to submit a PR, it seemed like a good idea to check if there were any other places that may be affected.

Methodology

Using ZSH and ag (the silver searcher):

#! /usr/bin/env zsh


# search for the text "swagger" (case insensitive).
# Result format: <file path>:<match line>:[Ss]wagger
swaggerSearchResults=($(ag -i -o --nogroup swagger))

# keep track of the current file seen - results are grouped per file, with the name in each record
currentFile=""

for matchingFile in ${(u)swaggerSearchResults}; do
  match=( ${(@s/:/)matchingFile} )
  
  # keep track of the filename, and create a new markdown header/section if required
  if [[ "${match::1}" != "${currentFile}" ]]; then
    currentFile=${match::1}
    echo -e "\n### ${currentFile}"
    
    # ##TODO## needs to be manually changed after reviewing a file
    echo -e "\n Assessment: ##TODO##"
   fi
  echo -e "\n#### line [${match:1:1}](https://github.com/postmanlabs/postman-docs/blob/develop/${match::1}$([[ ${match::1} == *.md ]] && echo "?plain=1" )#L${match:1:1})"
  # Fetch the matching line with 1 line of context before and after
  echo -e '\n```'
  head -n $((${match:1:1}+1)) ${currentFile} | tail -3
  echo -e '```'
done | tee links-for-matched-files.md

Matched Files

src/components/LeftNav/LeftNavItems.jsx

Assessment: No action required - refers to importing Swagger distinct from the superceding version of OpenAPI.

line 224

          {
            name: 'Swagger API import',
            url: '/docs/getting-started/importing-and-exporting/importing-from-swagger/',

line 225

            name: 'Swagger API import',
            url: '/docs/getting-started/importing-and-exporting/importing-from-swagger/',
          },

src/pages/docs/api-governance/api-definition/openapi2.md

Assessment: No action required - refers to importing Swagger distinct from the superceding version of OpenAPI.

line 111

```json
swagger: '2.0'
#...

line 139

```json
swagger: '2.0'
#...

line 174

```json
swagger: '2.0'
#...

line 194

```json
swagger: '2.0'
#...

line 214

```json
swagger: '2.0'
#...

line 234

```json
swagger: '2.0'
#...

line 252

```json
swagger: '2.0'
#...

line 270

```json
swagger: '2.0'
#...

line 290

```json
swagger: '2.0'
#...

line 315

```json
swagger: '2.0'
#...

line 340

```json
swagger: '2.0'
#...

line 367

```json
swagger: '2.0'
#...

line 393

```json
swagger: '2.0'
#...

line 418

```json
swagger: '2.0'
#...

line 441

```json
swagger: '2.0'
#...

line 460

```json
swagger: '2.0'
#...

line 491

```json
swagger: '2.0'
#...

line 521

```json
swagger: '2.0'
#...

line 549

```json
swagger: '2.0'
#...

line 572

```json
swagger: '2.0'
#...

line 593

```json
swagger: '2.0'
#...

line 614

```json
swagger: '2.0'
paths: {}

line 633

```json
swagger: '2.0'
paths: {}

line 651

```json
swagger: '2.0'
paths:

line 670

```json
swagger: '2.0'
paths:

line 693

```json
swagger: '2.0'
paths: {}

line 710

```json
swagger: '2.0'
paths: {}

line 728

```json
swagger: '2.0'
paths:

line 749

```json
swagger: '2.0'
paths:

line 772

```json
swagger: '2.0'
#...

line 796

```json
swagger: '2.0'
#...

line 825

```json
swagger: '2.0'
info:

line 843

```json
swagger: '2.0'
info:

line 867

```json
swagger: '2.0'
info:

line 887

```json
swagger: '2.0'
info:

line 905

```json
swagger: '2.0'
info:

line 925

```json
swagger: '2.0'
info:

line 944

```json
swagger: '2.0'
info:

line 953

```json
swagger: '2.0'
info:

line 972

```json
swagger: '2.0'
info:

line 991

```json
swagger: '2.0'
info:

line 1014

```json
swagger: '2.0'
# ...

line 1031

```json
swagger: '2.0'
# ...

line 1050

```json
swagger: '2.0'
# ...

line 1069

```json
swagger: '2.0'
# ...

line 1088

```json
swagger: '2.0'
# ...

line 1111

```json
swagger: '2.0'
# ...

line 1134

```json
swagger: '2.0'
# ...

line 1157

```json
swagger: '2.0'
# ...

line 1180

```json
swagger: '2.0'
# ...

line 1205

```json
swagger: '2.0'
# ...

line 1226

```json
swagger: '2.0'
# ...

line 1247

```json
swagger: '2.0'
# ...

line 1271

```json
swagger: '2.0'
#...

line 1300

```json
swagger: '2.0'
# ...

line 1331

```json
swagger: '2.0'
# ...

line 1350

```json
swagger: '2.0'
#...

line 1376

```json
swagger: '2.0'
# ...

src/pages/docs/api-governance/configurable-rules/spectral.md

Assessment: No Action Required - Describes both Swagger and the superceding OpenApi spec

line 116

`resolved` | <p>Determines whether your OpenAPI document is a resolved or unresolved document when Spectral executes your rule. This affects whether Spectral resolves `$ref` properties when executing your rule.</p> <p>A `$ref` property is a reference in the form of a URI that references other components, which can be in your OpenAPI document. In a resolved document, references are replaced with the components each URI points to. In an unresolved document, references aren't replaced. The possible values are `true` (default) and `false`. These values can be used as follows:</p> <ul><li>`true` - The OpenAPI document is a resolved document when Spectral executes your rule. Each reference (`$ref`) is replaced with the component each URI points to, meaning you can't target `$ref` properties.</li><li>`false` - The OpenAPI document is an unresolved document when Spectral executes your rule. Each reference (`$ref`) isn't replaced. This enables you to target the `$ref` property to check its presence and the URI value as a string.</li></ul>
`formats` | <p>The list of document formats to which the rule will be applied. The accepted values are:</p> <ul><li>`oas2` - Targets OpenAPI (Swagger) documents</li><li>`oas3` - Targets OpenAPI 3.x documents (3.0 and 3.1)</li><li>`oas3_0` - Targets OpenAPI 3.0 documents</li><li>`oas3_1` - Targets OpenAPI 3.1 documents</li></ul><br> By default, a rule will target all versions 2 and 3.x (the default value is `[oas2,oas3]`).
`given` | <p>**Required**. This can be a list with at least one element or a single element. Each value is a [JSON Path Plus expression](#json-path-and-json-path-plus) that may return zero, one, or more elements.</p> <p>If `given` paths don't find any value, the `then` controls won't execute.

src/pages/docs/designing-and-developing-your-api/deploying-an-api/deploying-an-api-aws.md

Assessment: No Action Required - page filename uses the name 'swagger' but the text correctly references the AWS API Gateway OpenApi vendor extensions page.

line 205

<img alt="Deploying an API" src="https://assets.postman.com/postman-docs/v10/deploy-api-definition-on-aws-v10-0-15.jpg" width="516px"/>

> [API Gateway extensions to Open API](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html) (vendor extensions) are preserved when pushing and deploying a definition from Postman. Postman merges any extensions present in the API Gateway into the definition before pushing the merged definition to the API Gateway.

src/pages/docs/designing-and-developing-your-api/importing-an-api.md

Assessment: No Action Required - Describes both Swagger and the superceding OpenApi spec

line 193

* [OpenAPI 3.0 and 3.1](https://github.com/postmanlabs/openapi-to-postman)
* Swagger [1.2](https://github.com/postmanlabs/swagger1-to-postman) and [2.0](https://github.com/postmanlabs/swagger2-postman2-lambda)
* Protobuf 2 and 3

line 193

* [OpenAPI 3.0 and 3.1](https://github.com/postmanlabs/openapi-to-postman)
* Swagger [1.2](https://github.com/postmanlabs/swagger1-to-postman) and [2.0](https://github.com/postmanlabs/swagger2-postman2-lambda)
* Protobuf 2 and 3

src/pages/docs/developer/collection-conversion.md

Assessment: No Action Required - Describes both Swagger and the superceding OpenApi spec

line 19


You can convert from a variety of API formats into Postman Collections. If you have API requests defined as OpenAPI, Swagger, RAML, or GraphQL schema formats, you can convert these to Postman Collections. You can import Postman Collections into the app or use them with other Postman utilities including [Newman](/docs/collections/using-newman-cli/command-line-integration-with-newman/), Postman's command-line collection runner.

line 33

* [OpenAPI 3.0 to Postman](https://github.com/postmanlabs/openapi-to-postman)
* [Swagger 2.0 to Postman](https://github.com/postmanlabs/swagger2-postman2)
* [RAML 1.0 to Postman](https://github.com/postmanlabs/raml1-to-postman)

line 33

* [OpenAPI 3.0 to Postman](https://github.com/postmanlabs/openapi-to-postman)
* [Swagger 2.0 to Postman](https://github.com/postmanlabs/swagger2-postman2)
* [RAML 1.0 to Postman](https://github.com/postmanlabs/raml1-to-postman)

src/pages/docs/developer/resources-intro.md

Assessment: No Action Required - Describes both Swagger and the superceding OpenApi spec

line 36

    * Postman uses the code generators SDK to create client snippets from your requests.
* [Postman Collection converters](/docs/developer/collection-conversion/)
    * The converters allow you to transform OpenAPI, Swagger, RAML, and GraphQL specs to Postman Collection format.

src/pages/docs/getting-started/importing-and-exporting/importing-and-exporting-overview.md

Assessment: No Action Required - Describes both Swagger and the superceding OpenApi spec

line 39


* You can [import a cURL command](/docs/getting-started/importing-and-exporting/importing-curl-commands/#import-a-curl-command-into-postman) as a new Postman request or [convert a Postman request to a cURL command](/docs/getting-started/importing-and-exporting/importing-curl-commands/#convert-a-postman-request-to-curl). You can also [import Swagger APIs](/docs/getting-started/importing-and-exporting/importing-from-swagger/) or [import OpenAPI definitions](/docs/integrations/available-integrations/working-with-openAPI/).

line 39


* You can [import a cURL command](/docs/getting-started/importing-and-exporting/importing-curl-commands/#import-a-curl-command-into-postman) as a new Postman request or [convert a Postman request to a cURL command](/docs/getting-started/importing-and-exporting/importing-curl-commands/#convert-a-postman-request-to-curl). You can also [import Swagger APIs](/docs/getting-started/importing-and-exporting/importing-from-swagger/) or [import OpenAPI definitions](/docs/integrations/available-integrations/working-with-openAPI/).

src/pages/docs/getting-started/importing-and-exporting/importing-from-swagger.md

Assessment: No Action Required - Describes outputs of the Swagger toolset (and describes the distinction)

line 2

---
title: "Import Swagger APIs"
updated: 2023-10-18

line 25


Postman can import APIs created with the Swagger toolset and any API that follows a [supported version of the OpenAPI specification](/docs/designing-and-developing-your-api/importing-an-api/#supported-api-definitions-formats).

line 27


The terms _Swagger_ and _OpenAPI_ can be confusing because the OpenAPI specification was previously named Swagger, and people sometimes use the terms interchangeably. To clarify, in this document, _Swagger API_ refers to an API created with the Swagger toolset.

line 29


## Import a Swagger API

src/pages/docs/integrations/available-integrations/apimatic.md

Assessment: NEEDS ATTENTION - describes Swagger. Apimatic supports Swagger and OpenAPI.

https://docs.apimatic.io/api-transformer/overview-transformer/

line 6


Postman's APIMatic integration converts a Postman Collection into an API description format such as Swagger, RAML, or API Blueprint, and then periodically backs up the resulting file on GitHub.

src/pages/docs/reports/content-activity-reports.md

Assessment: No Action Required - Describes both Swagger and the superceding OpenApi spec

line 96

* **Total APIs in team workspaces** - The number of APIs in team workspaces.
* **Schemas by type** - The number of APIs in team workspaces by schema type (like OpenAPI, GraphQL, and Swagger). If an API has multiple versions with different schema types, then the same API will be counted in the column for each relevant schema type.
* **APIs updated over time** - The number of APIs in team workspaces that have been updated in the last 30 days.

line 141

* **Total APIs on Private API Network** - The number of APIs that are published to the Private API Network.
* **Schemas by type** - The number of APIs in the Private API Network by schema type (like OpenAPI, GraphQL, and Swagger).
* **API mock coverage** - The number of APIs in the Private API Network your team has added mocks to.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment