Skip to content

Commit

Permalink
Fixed documentation for tags & fixed docs for user sso
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Aug 24, 2015
1 parent e4ea182 commit cb0caf7
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 13 deletions.
6 changes: 3 additions & 3 deletions api/app/Models/Tag.php
Expand Up @@ -27,9 +27,9 @@ class Tag extends BaseModel
protected $fillable = ['tag_id','tag'];

protected static $validationRules = [
'tag_id' => 'uuid',
'tag' => 'required|string|alphaDashSpace|max:20'
];
'tag_id' => 'required|uuid',
'tag' => 'required|string|alphaDashSpace|max:20'
];

/**
* @param mixed $id
Expand Down
22 changes: 22 additions & 0 deletions api/resources/views/documentation/sections/article.blade.apib
Expand Up @@ -140,12 +140,14 @@ Note that this route returns paginated results as defined in the `Content-Range`
+ Parameters
+ articleId (required, uuid, `{!! $faker->uuid !!}`) ... Unique `id` or `uri` of the article to perform action with.
+ metaName (required, string, `twitter`) ... Meta data name

### DELETE article's meta data single record [DELETE]
#### Restrictions
* Allowed - [admin, self]

+ Response 204


## Article Tags [/articles/{articleId}/tags]
+ Parameters
+ articleId (required, uuid, `{!! $faker->uuid !!}`) ... Unique `id` or `uri` of the article to perform action with.
Expand All @@ -164,3 +166,23 @@ Note that this route returns paginated results as defined in the `Content-Range`
->json()
!!}

### Add tags to article [PUT]

+ Request
+ Body

{!!
$factory->get(\App\Models\Tag::class)
->hide(['_self'])
->json()
!!}

+ Response 201 (application/json)
+ Body

{!!
$factory->get(\App\Models\Tag::class)
->showOnly(['_self'])
->json()
!!}

2 changes: 1 addition & 1 deletion api/resources/views/documentation/sections/auth.blade.apib
Expand Up @@ -107,7 +107,7 @@ to the application with the authentication details to this route.
Location: http://spira.io?jwtAuthToken={!! $factory->make(\App\Models\AuthToken::class)->token !!}


## Vanilla SSO [/auth/sso/vanilla]
## Vanilla SSO [/auth/sso/vanilla{?client_id,timestamp,signature,callback}]

When a user visits vanilla forum, Vanilla pings this route to retrieve information
about the current user. This route is to be used by Vanilla alone.
Expand Down
32 changes: 24 additions & 8 deletions api/resources/views/documentation/sections/tag.blade.apib
Expand Up @@ -4,9 +4,7 @@ Tags are generic mechanism of tagging particular article and find articles havin
## Tag Entity [/tags]

### Create tag entity [POST]

#### Restrictions
* Allowed - [admin]
It is recommended to use the PUT method with `entityId` in route, as the same action is used for updating the entity

+ Request
+ Body
Expand All @@ -17,7 +15,7 @@ Tags are generic mechanism of tagging particular article and find articles havin
->json()
!!}

+ Request
+ Response 201 (application/json)
+ Body

{!!
Expand All @@ -26,8 +24,6 @@ Tags are generic mechanism of tagging particular article and find articles havin
->json()
!!}

+ Response 201

## Exiting Tag Entity Actions [/tags/{tagId}]

+ Parameters
Expand All @@ -36,14 +32,34 @@ Tags are generic mechanism of tagging particular article and find articles havin

### Retrieve a tag [GET]

#### Restrictions
* Allowed - [admin]
+ Response 200 (application/json)

+ Body

{!! $factory->json(\App\Models\Tag::class) !!}

### Create tag entity [PUT]

#### Restrictions

+ Request
+ Body

{!!
$factory->get(\App\Models\Tag::class)
->hide(['_self'])
->json()
!!}

+ Response 201 (application/json)
+ Body

{!!
$factory->get(\App\Models\Tag::class)
->showOnly(['_self'])
->json()
!!}

### Update the tag [PATCH]

#### Restrictions
Expand Down
3 changes: 2 additions & 1 deletion api/resources/views/documentation/sections/user.blade.apib
Expand Up @@ -155,4 +155,5 @@ email is sent to the user with a reset token.

Authorization: Bearer {!! $factory->make(\App\Models\AuthToken::class)->token !!}

+ Response 202
+ Response 202

0 comments on commit cb0caf7

Please sign in to comment.