Skip to content

Commit

Permalink
Improve docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpooch committed Jul 1, 2016
1 parent 2015b2c commit 133d91e
Show file tree
Hide file tree
Showing 8 changed files with 259 additions and 17 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

1. Run `npm run serve`.

## About

1. All CSS / style differences are done via inline styles. Don't bother changing the less/css files.



Expand Down
198 changes: 198 additions & 0 deletions dist/specs/tevo-api-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,134 @@ paths:
Radius in miles for geolocated searches (default is 15 miles).
default: 15

##############################################################################
# PERFORMERS
##############################################################################

# SHOW #######################################################################
/performers/{performer_id}:
get:
tags:
- performers
description: >
Get a specific performer (team, artist, etc).
responses:
'200':
description: None
schema:
$ref: '#/definitions/Performer'
parameters:
- name: performer_id
in: path
required: true
type: number
format: int32
description:
The ID of the specific Performer.
- name: include
in: query
required: false
type: boolean
description:
Show opponents (for performers in Sports category).

# INDEX ######################################################################
/performers:
get:
tags:
- performers
description: Obtain a list of Performers that match given conditions.
responses:
'200':
description: None.
schema:
$ref: '#/definitions/Performers'
parameters:
- name: venue_id
in: query
required: false
type: number
format: int32
description: ID of the Performer’s home venue (most performers do not have one).
- name: category_id
in: query
required: false
type: number
format: int32
description: Show only Performers in this category (does not include sub-categories).
- name: category_tree
in: query
required: false
type: boolean
description: >-
When `true` and used in conjunction with `category_id`,
performers in sub-categories of the `category_id` will be included.
- name: only_with_upcoming_events
in: query
required: false
type: boolean
description: Filter to only Performers who have upcoming events
- name: upcoming_events_end_date
in: query
required: false
type: string
format: iso8601
description: >-
Filter to only Performers who have upcoming events earlier than the date (`only_with_upcoming_events` must be true).
- name: first_letter
in: query
required: false
type: string
description: Filter to Performers whose names begin with this letter.
- name: popularity_score
in: query
required: false
type: number
format: float
description: Filter to Performers whose popularity score meets the provided conditionals.
- name: disabled_at
in: query
required: false
type: string
format: iso8601
description: Filter to Performers disabled before or after a certain date.
- name: deleted_at
in: query
required: false
type: string
format: iso8601
description: Filter performers deleted before or after a certain date.
- name: updated_at
in: query
required: false
type: string
format: iso8601
description: Filter performers updated before or after a certain date.
- name: name
in: query
required: false
type: string
description: >-
Exact name of the Performer. Use `performers/search` when searching for a Performer by name.
- name: order_by
in: query
required: false
type: string
description: >-
Pass in the parameter that you want to order by and the sorting order.
E.g. `performers.popularity_score%20DESC`. It is literal SQL and the space should be URL encoded to `%20`.
##############################################################################
# TICKETS
##############################################################################
/tickets:
get:
tags:
- tickets
responses:
'200':
description: aaa

definitions:

##############################################################################
Expand Down Expand Up @@ -260,6 +381,9 @@ definitions:
per_page:
type: integer
description: Items per page of pagination.
total_entries:
type: integer
description: Total number of items.
events:
type: array
description: The actual events.
Expand Down Expand Up @@ -337,6 +461,80 @@ definitions:
description: >-
The time the event occurs. This time is NOT UTC. The time is in
whatever timezone the venue is located in. Disregard the 'Z'.
##############################################################################
# Performer
##############################################################################
Performer:
type: object
properties:
keywords:
type: string
description: A comma separated list of search keywords that yield this performer.
updated_at:
type: string
format: iso8601
description: The time of last update for this performer.
opponents:
type: array
description: >-
An array of `Performers` this team will play in the near future.
Only provided when the `include` param is used.
items:
$ref: '#/definitions/Performer'
upcoming_events:
type: object
description: >-
An object containing the first (closest to now) and last (furthest in the future) event dates for events scheduled at this venue.
venue:
$ref: '#/definitions/Venue'
popularity_score:
type: number
format: float
description: The relative popularity of this performer.
category:
$ref: '#/definitions/Category'
url:
type: string
format: url
description: The API url to access this performer.
venues:
description: Deprecated.
name:
type: string
description: The performer name.
id:
type: number
format: int32
description: The id of this performer.
meta:
type: object
description: >-
An object of performer metadata like imagery and background information.
This information is managed (provided) by each API user for the purposes of fleshing out their own content.
It is largely unused at the moment.
##############################################################################
# Performers
##############################################################################
Performers:
type: object
properties:
current_page:
type: integer
description: Current page of pagination.
per_page:
type: integer
description: Items per page of pagination.
total_entries:
type: integer
description: Total number of items.
performers:
type: array
description: The actual performers.
items:
$ref: '#/definitions/Performer'

Performance:
type: object
Venue:
Expand Down
16 changes: 4 additions & 12 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,10 @@ gulp.task('clean', function() {
.on('error', log);
});

/**
* JShint all *.js files
*/
gulp.task('lint', function () {
return gulp.src('./src/main/javascript/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});

/**
* Build a distribution
*/
gulp.task('dist', ['clean', 'lint'], _dist);
gulp.task('dist', ['clean'], _dist);
function _dist() {
return es.merge(
gulp.src([
Expand Down Expand Up @@ -76,7 +67,7 @@ function _dist() {
.pipe(gulp.dest('./dist'))
.pipe(connect.reload());
}
gulp.task('dev-dist', ['lint', 'dev-copy'], _dist);
gulp.task('dev-dist', ['dev-copy'], _dist);

/**
* Processes less files into CSS files
Expand All @@ -88,7 +79,8 @@ function _less() {
'./src/main/less/screen.less',
'./src/main/less/print.less',
'./src/main/less/reset.less',
'./src/main/less/style.less'
'./src/main/less/style.less',
'./src/main/less/tevo.less'
])
.pipe(less())
.on('error', function(err){ log(err); this.emit('end');})
Expand Down
16 changes: 16 additions & 0 deletions src/main/html/css/tevo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
input[type=text] {
padding: 5px 10px;
}
input[type=submit] {
cursor: pointer;
background: #0f6ab4;
padding: 10px 30px !important;
border-radius: 5px;
color: #fff;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.67);
font-size: 1.5em;
border: 1px solid rgba(0, 0, 0, 0.67);
}
input[type=submit]:hover {
background: #519ddb;
}
Binary file removed src/main/html/images/pet_store_api.png
Binary file not shown.
Binary file removed src/main/html/images/wordnik_api.png
Binary file not shown.
27 changes: 22 additions & 5 deletions src/main/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<html>
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<title>Ticket Evolution API - The best ticket API for sports concerts & theater.</title>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/tevo.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
<link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>

Expand Down Expand Up @@ -38,7 +39,7 @@
if (url && url.length > 1) {
url = decodeURIComponent(url[1]);
} else {
url = "/specs/tevo-api-docs.yaml";
url = "specs/tevo-api-docs.yaml";
}

hljs.configure({
Expand Down Expand Up @@ -76,11 +77,14 @@
jsonEditor: false,
defaultModelRendering: 'schema',
showRequestHeaders: false,
operationsSorter: 'alpha'
operationsSorter: 'alpha',
jsonEditor: true
});

window.swaggerUi.load();

window.swaggerUi.api.clientAuthorizations.add('key', new SwaggerClient.ApiKeyAuthorization('X-Token', '58fb1ea1998319e3c0e8d9195b00f2ee', 'header'));

function log() {
if ('console' in window) {
console.log.apply(console, arguments);
Expand All @@ -103,15 +107,28 @@
<!--</div>-->
<!--</div>-->

<div id='header'>
<div id='header' style="background: #42a498; box-shadow: 0px 0px 3px rgba(0, 0, 0, 1.0); border-bottom: 1px solid rgba(0, 0, 0, 0.67);">
<div class="swagger-ui-wrap">
<a id="logo" href="http://api.ticketevolution.com">
<img class="logo__img" alt="Ticket Evolution API Docs" src="images/tevo_logo.png" style="margin-top: -8px;"/>
<span class="logo__title">Ticket Evolution API Docs</span>
<span class="logo__title" style="text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); font-weight: 500;">The Ticket Evolution API</span>
</a>
</div>
</div>


<div class="swagger-ui-wrap">
<div style="margin: 30px 0;">

<p>
<strong>This a simplified rundown of our most popular endpoints.</strong><br/>
For the "advanced mode" docs, please refer to our
<a href="https://ticketevolution.atlassian.net/wiki/display/API/">Legacy API Documentation</a>.
</p>

</div>
</div>

<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</body>
Expand Down
16 changes: 16 additions & 0 deletions src/main/less/tevo.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
input[type=text] {
padding: 5px 10px;
}
input[type=submit] {
cursor: pointer;
background: #0f6ab4;
padding: 10px 30px !important;
border-radius: 5px;
color: #fff;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.67);
font-size: 1.5em;
border: 1px solid rgba(0, 0, 0, 0.67);
&:hover {
background: #519ddb;
}
}

0 comments on commit 133d91e

Please sign in to comment.