Postman and openAPI specs (#174)

This commit is contained in:
Dominic Wong
2021-06-29 15:50:06 +01:00
committed by GitHub
parent d212fd2f5c
commit 221ff019af
6 changed files with 46 additions and 61 deletions

View File

@@ -9,6 +9,7 @@ import (
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"github.com/Masterminds/semver/v3"
@@ -181,7 +182,13 @@ func schemaToTs(title string, spec *openapi3.SchemaRef) string {
ret := ""
i := 0
for k, v := range props {
var keys []string
for k := range props {
keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
v := props[k]
ret += strings.Repeat(" ", level)
k = strcase.SnakeCase(k)
//v.Value.