Skip to content

Commit

Permalink
- swapped back grokify/swaggman in place of andrewcretin/swaggman for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcretin committed Dec 18, 2019
1 parent cd30e22 commit 16d3358
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: go
go_import_path: github.com/andrewcretin/swaggman
go_import_path: github.com/grokify/swaggman
go:
- 1.13.x
- 1.12.x
Expand Down
22 changes: 21 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
branch = "master"

[[constraint]]
name = "github.com/andrewcretin/swaggman"
name = "github.com/grokify/swaggman"
branch = "master"

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ err := conv.MergeConvert("path/to/swagger.json", "path/to/pman.base.json", "path

## Example

An example conversion is included, [`examples/ringcentral/convert.go`](https://github.com/andrewcretin/swaggman/blob/master/examples/ringcentral/convert.go) which creates a Postman 2.0 spec for the [RingCentral REST API](https://developers.ringcentral.com) using a base Postman 2.0 spec and the RingCentral basic Swagger 2.0 spec.
An example conversion is included, [`examples/ringcentral/convert.go`](https://github.com/grokify/swaggman/blob/master/examples/ringcentral/convert.go) which creates a Postman 2.0 spec for the [RingCentral REST API](https://developers.ringcentral.com) using a base Postman 2.0 spec and the RingCentral basic Swagger 2.0 spec.

[A video of importing the resulting Postman collection is available on YouTube](https://youtu.be/5kE4UPXJ-5Q).

Example files include:

* [RingCentral Swagger 2.0 spec](https://github.com/andrewcretin/swaggman/blob/master/examples/ringcentral/ringcentral.swagger2.basic.json)
* [RingCentral Postman 2.0 base](https://github.com/andrewcretin/swaggman/blob/master/examples/ringcentral/ringcentral.postman2.base.json)
* [RingCentral Postman 2.0 spec](https://github.com/andrewcretin/swaggman/blob/master/examples/ringcentral/ringcentral.postman2.basic.json) - Import this into Postman
* [RingCentral Swagger 2.0 spec](https://github.com/grokify/swaggman/blob/master/examples/ringcentral/ringcentral.swagger2.basic.json)
* [RingCentral Postman 2.0 base](https://github.com/grokify/swaggman/blob/master/examples/ringcentral/ringcentral.postman2.base.json)
* [RingCentral Postman 2.0 spec](https://github.com/grokify/swaggman/blob/master/examples/ringcentral/ringcentral.postman2.basic.json) - Import this into Postman

The RingCentral spec uses the following environment variables. The following is the Postman bulk edit format:

Expand All @@ -94,11 +94,11 @@ To set your environment variables, use the Settings Gear icon and then click "Ma
* Medium: [Using Postman, Swagger and the RingCentral API](https://medium.com/ringcentral-developers/using-postman-with-swagger-and-the-ringcentral-api-523712f792a0)
* YouTube: [Getting Started with RingCentral APIs using Postman ](https://youtu.be/5kE4UPXJ-5Q)

[build-status-svg]: https://api.travis-ci.org/andrewcretin/swaggman.svg?branch=master
[build-status-link]: https://travis-ci.org/andrewcretin/swaggman
[goreport-svg]: https://goreportcard.com/badge/github.com/andrewcretin/swaggman
[goreport-link]: https://goreportcard.com/report/github.com/andrewcretin/swaggman
[build-status-svg]: https://api.travis-ci.org/grokify/swaggman.svg?branch=master
[build-status-link]: https://travis-ci.org/grokify/swaggman
[goreport-svg]: https://goreportcard.com/badge/github.com/grokify/swaggman
[goreport-link]: https://goreportcard.com/report/github.com/grokify/swaggman
[docs-godoc-svg]: https://img.shields.io/badge/docs-godoc-blue.svg
[docs-godoc-link]: https://godoc.org/github.com/andrewcretin/swaggman
[docs-godoc-link]: https://godoc.org/github.com/grokify/swaggman
[license-svg]: https://img.shields.io/badge/license-MIT-blue.svg
[license-link]: https://github.com/andrewcretin/swaggman/blob/master/LICENSE.md
[license-link]: https://github.com/grokify/swaggman/blob/master/LICENSE.md
4 changes: 2 additions & 2 deletions apps/openapi2postman/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"log"

"github.com/andrewcretin/swaggman"
"github.com/andrewcretin/swaggman/postman2"
"github.com/grokify/swaggman"
"github.com/grokify/swaggman/postman2"
"github.com/jessevdk/go-flags"
)

Expand Down
6 changes: 3 additions & 3 deletions convert_swagger2_to_postman2.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"sort"
"strings"

"github.com/andrewcretin/swaggman/postman2"
"github.com/andrewcretin/swaggman/postman2/simple"
"github.com/andrewcretin/swaggman/swagger2"
"github.com/grokify/swaggman/postman2"
"github.com/grokify/swaggman/postman2/simple"
"github.com/grokify/swaggman/swagger2"
"github.com/grokify/gotilla/net/httputilmore"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/ringcentral-engage-digital/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"log"

"github.com/andrewcretin/swaggman/openapi3conv"
"github.com/andrewcretin/swaggman/postman2"
"github.com/grokify/swaggman/openapi3conv"
"github.com/grokify/swaggman/postman2"
"github.com/jessevdk/go-flags"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/ringcentral/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"log"

"github.com/andrewcretin/swaggman"
"github.com/andrewcretin/swaggman/postman2"
"github.com/grokify/swaggman"
"github.com/grokify/swaggman/postman2"
"github.com/jessevdk/go-flags"
)

Expand Down
6 changes: 3 additions & 3 deletions openapi3conv/convert_openapi3_to_postman2.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"sort"
"strings"

"github.com/andrewcretin/swaggman/openapi3"
"github.com/andrewcretin/swaggman/postman2"
"github.com/andrewcretin/swaggman/postman2/simple"
"github.com/grokify/swaggman/openapi3"
"github.com/grokify/swaggman/postman2"
"github.com/grokify/swaggman/postman2/simple"
oas3 "github.com/getkin/kin-openapi/openapi3"
)

Expand Down
4 changes: 3 additions & 1 deletion postman2/headers_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package postman2
import (
"strings"

"github.com/andrewcretin/swaggman/openapi3"
"github.com/grokify/swaggman/openapi3"
oas3 "github.com/getkin/kin-openapi/openapi3"
"github.com/grokify/gotilla/net/httputilmore"
"github.com/grokify/gotilla/type/stringsutil"
)

const DefaultMediaTypePreferences string = `multipart/form-data,application/json,application/x-www-form-urlencoded,application/xml,text/plain`

//noinspection ALL
func DefaultMediaTypePreferencesSlice() []string {
return strings.Split(DefaultMediaTypePreferences, ",")
}
Expand All @@ -26,6 +27,7 @@ func AppendPostmanHeaderValueLower(headers []Header, headerName string, options,
return headers, headerValue
}

//noinspection ALL
func AddOperationReqResMediaTypeHeaders(
headers []Header,
operation *oas3.Operation,
Expand Down
3 changes: 2 additions & 1 deletion postman2/simple/postman_collection_v2_simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"io/ioutil"

"github.com/andrewcretin/swaggman/postman2"
"github.com/grokify/swaggman/postman2"
)

type Collection struct {
Expand Down Expand Up @@ -32,6 +32,7 @@ func NewCanonicalCollectionFromBytes(data []byte) (postman2.Collection, error) {
return cPman, nil
}

//noinspection ALL
func ReadCanonicalCollection(filepath string) (postman2.Collection, error) {
bytes, err := ioutil.ReadFile(filepath)
if err != nil {
Expand Down

0 comments on commit 16d3358

Please sign in to comment.