Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

fixes some issues in apib template default, as in showing empty reque… #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions definition/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,16 @@ type Request struct {
Body []Body
Headers []Header
}

// IsEmpty verifies is the request is empty
func (r Request) IsEmpty() bool {
if r.Title != "" || r.Description != "" {
return false
}

if len(r.Body) > 0 || len(r.Headers) > 0 {
return false
}

return true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EOF missing

17 changes: 15 additions & 2 deletions examples/spec/blueprint/realworld.apib
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Returns a specific Post.

+ Response 200 (application/json)

This is a mighty example
Single post Resource

+ Body

Expand Down Expand Up @@ -121,7 +121,20 @@ Returns a specific Post.
"you_starred": false
},
"meta": {
"code": 200,
"code": 200
}
}

+ Response 404 (application/json)

Resource Not found

+ Body

{
"data": {},
"meta": {
"code": 200
}
}

Expand Down
7 changes: 7 additions & 0 deletions try-it-out/css/try-it-out.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ h1 {
text-align: center;
color: #FF0000;
}

pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; }
.string { color: green; }
.number { color: darkorange; }
.boolean { color: blue; }
.null { color: magenta; }
.key { color: red; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EOF missing

Loading