Skip to content

Commit

Permalink
Merge 0e912f2 into 24859f6
Browse files Browse the repository at this point in the history
  • Loading branch information
npauzenga committed Jan 31, 2016
2 parents 24859f6 + 0e912f2 commit 2efc455
Show file tree
Hide file tree
Showing 18 changed files with 2,221 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ gem "interactor"
gem "figaro"
gem "knock"
gem "active_model_serializers"
gem "committee"

group :developemnt, :test do
gem "pry-byebug"
Expand All @@ -24,7 +25,6 @@ group :developemnt, :test do
gem "factory_girl_rails", "~> 4.0"
gem "rspec_api_documentation"
gem "prmd"
gem "committee"
end

group :development do
Expand Down
7 changes: 7 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,12 @@ class Application < Rails::Application
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
config.autoload_paths += Dir["#{config.root}/lib/**/"]

# Middleware for validating JSON schema on request and response
schema_file = "#{Rails.root}/schema/api.json"
if File.exists?(schema_file)
config.middleware.use Committee::Middleware::RequestValidation, schema: JSON.parse(File.read(schema_file)), strict: true
config.middleware.use Committee::Middleware::ResponseValidation, schema: JSON.parse(File.read(schema_file))
end
end
end
164 changes: 164 additions & 0 deletions doc/api/gamenights/delete_game_nights:id.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<!DOCTYPE html>
<html>
<head>
<title>GameNights API</title>
<meta charset="utf-8">
<style>

body {
font-family: Helvetica,Arial,sans-serif;
font-size: 13px;
font-weight: normal;
line-height: 18px;
color: #404040;
}

.container {
width: 940px;
margin-left: auto;
margin-right: auto;
zoom: 1;
}

pre {
background-color: #f5f5f5;
display: block;
padding: 8.5px;
margin: 0 0 18px;
line-height: 18px;
font-size: 12px;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}

td.required .name:after {
float: right;
content: "required";
font-weight: normal;
color: #F08080;
}

a{
color: #0069d6;
text-decoration: none;
line-height: inherit;
font-weight: inherit;
}

h1, h2, h3, h4, h5, h6 {
font-weight: bold;
color: #404040;
}

h1 {
margin-bottom: 18px;
font-size: 30px;
line-height: 36px;
}
h2 {
font-size: 24px;
line-height: 36px;
}
h3{
font-size: 18px;
line-height: 36px;
}
h4 {
font-size: 16px;
line-height: 36px;
}

table{
width: 100%;
margin-bottom: 18px;
padding: 0;
border-collapse: separate;
font-size: 13px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border-spacing: 0;
border: 1px solid #ddd;
}

table th {
padding-top: 9px;
font-weight: bold;
vertical-align: middle;
border-bottom: 1px solid #ddd;
}
table th+th, table td+td {
border-left: 1px solid #ddd;
}
table th, table td {
padding: 10px 10px 9px;
line-height: 18px;
text-align: left;
}

</style>
</head>
<body>
<div class="container">
<h1>GameNights API</h1>

<div class="article">
<h2>DELETE /game_nights/:id</h2>
<h3>DELETE /game_nights/:id</h3>

<h3>Parameters</h3>
<table class="parameters table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="required">
<span class="name">id</span>
</td>
<td>
<span class="description"> The id of the game_night.
</span>
</td>
</tr>
</tbody>
</table>


<h3>Request</h3>

<h4>Headers</h4>
<pre class="request headers">Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NTQzMzgwNTYsImF1ZCI6bnVsbCwic3ViIjo2MDk0fQ.trzZwND1HgI8cHja5o0F3Hvd9nicaUQxzGNfgoGI8c8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: </pre>

<h4>Route</h4>
<pre class="request route highlight">DELETE /game_nights/1766</pre>




<h3>Response</h3>
<h4>Headers</h4>
<pre class="response headers">X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-cache
X-Request-Id: 3c664d8c-0436-4ee4-bcb2-1aed4c678dbe
X-Runtime: 0.006597</pre>
<h4>Status</h4>
<pre class="response status">204 No Content</pre>
</div>
</div>
</body>
</html>
181 changes: 181 additions & 0 deletions doc/api/gamenights/get_game_nights.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<!DOCTYPE html>
<html>
<head>
<title>GameNights API</title>
<meta charset="utf-8">
<style>

body {
font-family: Helvetica,Arial,sans-serif;
font-size: 13px;
font-weight: normal;
line-height: 18px;
color: #404040;
}

.container {
width: 940px;
margin-left: auto;
margin-right: auto;
zoom: 1;
}

pre {
background-color: #f5f5f5;
display: block;
padding: 8.5px;
margin: 0 0 18px;
line-height: 18px;
font-size: 12px;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}

td.required .name:after {
float: right;
content: "required";
font-weight: normal;
color: #F08080;
}

a{
color: #0069d6;
text-decoration: none;
line-height: inherit;
font-weight: inherit;
}

h1, h2, h3, h4, h5, h6 {
font-weight: bold;
color: #404040;
}

h1 {
margin-bottom: 18px;
font-size: 30px;
line-height: 36px;
}
h2 {
font-size: 24px;
line-height: 36px;
}
h3{
font-size: 18px;
line-height: 36px;
}
h4 {
font-size: 16px;
line-height: 36px;
}

table{
width: 100%;
margin-bottom: 18px;
padding: 0;
border-collapse: separate;
font-size: 13px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border-spacing: 0;
border: 1px solid #ddd;
}

table th {
padding-top: 9px;
font-weight: bold;
vertical-align: middle;
border-bottom: 1px solid #ddd;
}
table th+th, table td+td {
border-left: 1px solid #ddd;
}
table th, table td {
padding: 10px 10px 9px;
line-height: 18px;
text-align: left;
}

</style>
</head>
<body>
<div class="container">
<h1>GameNights API</h1>

<div class="article">
<h2>GET /game_nights/</h2>
<h3>GET /game_nights/</h3>



<h3>Request</h3>

<h4>Headers</h4>
<pre class="request headers">Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NTQzMzgwNTYsImF1ZCI6bnVsbCwic3ViIjo2MDk4fQ.1lwcMTsyoIDPX-0v_MhYAgqoZm9BN2SRydTq15DUE5g
Host: example.org
Cookie: </pre>

<h4>Route</h4>
<pre class="request route highlight">GET /game_nights/</pre>




<h3>Response</h3>
<h4>Headers</h4>
<pre class="response headers">X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
ETag: W/&quot;1c87e84524090ede147f7e73d1d50216&quot;
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: e1ca54de-9aad-48bc-b7ab-5f2a3b4f5267
X-Runtime: 0.003974
Content-Length: 622</pre>
<h4>Status</h4>
<pre class="response status">200 OK</pre>
<h4>Body</h4>
<pre class="response body">{
&quot;data&quot;: [
{
&quot;id&quot;: &quot;1770&quot;,
&quot;type&quot;: &quot;game_nights&quot;,
&quot;attributes&quot;: {
&quot;name&quot;: &quot;[\&quot;tofu\&quot;, \&quot;pickled\&quot;]&quot;,
&quot;time&quot;: &quot;2016-01-31T00:00:00.000Z&quot;,
&quot;location_name&quot;: &quot;[\&quot;locavore\&quot;, \&quot;Thundercats\&quot;]&quot;,
&quot;location_address&quot;: &quot;Jamil Mountains&quot;
}
},
{
&quot;id&quot;: &quot;1771&quot;,
&quot;type&quot;: &quot;game_nights&quot;,
&quot;attributes&quot;: {
&quot;name&quot;: &quot;[\&quot;tofu\&quot;, \&quot;pickled\&quot;]&quot;,
&quot;time&quot;: &quot;2016-02-04T00:00:00.000Z&quot;,
&quot;location_name&quot;: &quot;[\&quot;locavore\&quot;, \&quot;Thundercats\&quot;]&quot;,
&quot;location_address&quot;: &quot;Jamil Mountains&quot;
}
},
{
&quot;id&quot;: &quot;1772&quot;,
&quot;type&quot;: &quot;game_nights&quot;,
&quot;attributes&quot;: {
&quot;name&quot;: &quot;[\&quot;tofu\&quot;, \&quot;pickled\&quot;]&quot;,
&quot;time&quot;: &quot;2016-02-06T00:00:00.000Z&quot;,
&quot;location_name&quot;: &quot;[\&quot;locavore\&quot;, \&quot;Thundercats\&quot;]&quot;,
&quot;location_address&quot;: &quot;Jamil Mountains&quot;
}
}
]
}</pre>
</div>
</div>
</body>
</html>
Loading

0 comments on commit 2efc455

Please sign in to comment.