Skip to content

Commit 00f10e0

Browse files
committed
add some extra structures
1 parent 8012f57 commit 00f10e0

20 files changed

+1230
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
secrets.yml
22
coverage.out
3+
.idea

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22

33
[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/spec3/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/spec3?status.svg)](http://godoc.org/github.com/go-openapi/spec3)
44

5-
The object model for OpenAPI specification v3 documents
5+
The object model for OpenAPI specification v3 documents.
6+
7+
It aims to fix some mistakes that were made in the spec for v2. Top-level maps are now sorted by default so you can rely on their ordering.
8+

contact.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package spec3
2+
3+
//easyjson:json
4+
type Contact struct {
5+
VendorExtensible
6+
7+
Name string
8+
URL string
9+
Email string
10+
}

contact_easyjson.go

Lines changed: 126 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package spec3
2+
3+
//go:generate easyjson -all -omit_empty -lower_camel_case contact.go
4+
//go:generate easyjson -all -omit_empty -lower_camel_case license.go
5+
//go:generate easyjson -all -omit_empty -lower_camel_case info.go
6+
//go:generate easyjson -all -omit_empty -lower_camel_case server.go
7+
//go:generate easyjson -all -omit_empty -lower_camel_case external_documentation.go
8+
//go:generate easyjson -all -omit_empty -lower_camel_case tag.go

extensions.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ func (e Extensions) GetInt64(key string) (int64, bool) {
9595
// GetStringSlice gets a string value from the extensions
9696
func (e Extensions) GetStringSlice(key string) ([]string, bool) {
9797
if v, ok := e.GetOK(key); ok {
98+
strv, ok := v.([]string) // get out quick
99+
if ok {
100+
return strv, ok
101+
}
102+
103+
// do the thing
98104
arr, ok := v.([]interface{})
99105
if !ok {
100106
return nil, false

external_documentation.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package spec3
2+
3+
//easyjson:json
4+
type ExternalDocumentation struct {
5+
VendorExtensible
6+
7+
Description string
8+
URL string
9+
}

external_documentation_easyjson.go

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

info.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package spec3
2+
3+
//easyjson:json
4+
type Info struct {
5+
VendorExtensible
6+
7+
Title string
8+
Description string
9+
TermsOfService string
10+
Contact *Contact
11+
License *License
12+
Version string
13+
}

0 commit comments

Comments
 (0)