Skip to content

Commit

Permalink
fixes appc#187 add an init command
Browse files Browse the repository at this point in the history
  • Loading branch information
casualjim committed Dec 30, 2015
1 parent 7da8251 commit 8b7d2fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ func (p Paths) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
var pths map[string]PathItem

pths := make(map[string]PathItem)
for k, v := range p.Paths {
if strings.HasPrefix(k, "/") {
if pths == nil {
pths = make(map[string]PathItem)
}
pths[k] = v
}
}
Expand Down
4 changes: 2 additions & 2 deletions swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ type swaggerProps struct {
Info *Info `json:"info,omitempty"`
Host string `json:"host,omitempty"`
BasePath string `json:"basePath,omitempty"` // must start with a leading "/"
Paths *Paths `json:"paths,omitempty"` // required
Definitions Definitions `json:"definitions,omitempty"`
Paths *Paths `json:"paths"` // required
Definitions Definitions `json:"definitions"`
Parameters map[string]Parameter `json:"parameters,omitempty"`
Responses map[string]Response `json:"responses,omitempty"`
SecurityDefinitions SecurityDefinitions `json:"securityDefinitions,omitempty"`
Expand Down

0 comments on commit 8b7d2fe

Please sign in to comment.