Skip to content

Commit

Permalink
prepare 0.29.0 release (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeFnord authored May 22, 2018
1 parent 9b41652 commit c00c5b4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 52 deletions.
14 changes: 5 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,29 @@ after_success:
- bundle exec danger

rvm:
- 2.5.0
- 2.4.3

- 2.5.1
- 2.4.4
env:
- MODEL_PARSER=grape-swagger-entity
- MODEL_PARSER=grape-swagger-representable
- GRAPE_VERSION=0.17.0
- GRAPE_VERSION=0.18.0
- GRAPE_VERSION=0.19.2
- GRAPE_VERSION=1.0.1
- GRAPE_VERSION=1.0.3
- GRAPE_VERSION=HEAD

matrix:
fast_finish: true

include:
- rvm: 2.3.6
- rvm: 2.3.7
env:
- rvm: ruby-head
env:
- rvm: jruby-head
env:
- rvm: rbx-3
env:

allow_failures:
- rvm: 2.3.6
- rvm: 2.3.7
- rvm: ruby-head
- rvm: jruby-head
- rvm: rbx-3
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

#### Features

* Your contribution here.

#### Fixes

* Your contribution here.

### 0.29.0 (May 22, 2018)

#### Features

* [#667](https://github.com/ruby-grape/grape-swagger/pull/667): Make route summary optional - [@obduk](https://github.com/obduk).
* [#670](https://github.com/ruby-grape/grape-swagger/pull/670): Add support for deprecated field - [@ioanatia](https://github.com/ioanatia).
* [#675](https://github.com/ruby-grape/grape-swagger/pull/675): Add response examples - [@gamartin](https://github.com/gamartin).

* Your contribution here.

#### Fixes

* [#664](https://github.com/ruby-grape/grape-swagger/pull/662): Removed all references to obsolete `hide_format` parameter - [@jonmchan](https://github.com/jonmchan).
Expand Down
49 changes: 9 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ add_swagger_documentation \
```


### tags: <a name="tags" />
#### tags: <a name="tags" />
A list of tags to document. By default tags are automatically generated
for endpoints based on route names.

Expand Down Expand Up @@ -372,26 +372,6 @@ add_swagger_documentation \

A hash merged into the `info` key of the JSON documentation.

<!-- #### *authorizations*:
This value is added to the `authorizations` key in the JSON documentation. -->

<!-- #### *api_documentation*:
Customize the Swagger API documentation route, typically contains a `desc` field. The default description is "Swagger compatible API description".
```ruby
add_swagger_documentation \
api_documentation: { desc: 'Reticulated splines API swagger-compatible documentation.' }
```
#### *specific_api_documentation*:
Customize the Swagger API specific documentation route, typically contains a `desc` field. The default description is "Swagger compatible API description for specific API".
```ruby
add_swagger_documentation \
specific_api_documentation: { desc: 'Reticulated splines API swagger-compatible endpoint documentation.' }
``` -->



## Routes Configuration <a name="routes" />
Expand All @@ -403,6 +383,7 @@ add_swagger_documentation \
* [Overriding the route summary](#summary)
* [Overriding the tags](#tags)
* [Deprecating routes](#deprecating-routes)
* [Overriding the name of the body parameter](#body-param)
* [Defining an endpoint as an array](#array)
* [Using an options hash](#options)
* [Overriding parameter type](#overriding-param-type)
Expand All @@ -416,11 +397,10 @@ add_swagger_documentation \
* [Changing default status codes](#change-status)
* [File response](#file-response)
* [Extensions](#extensions)


* [Response examples documentation](#response-examples)

#### Swagger Header Parameters <a name="headers" />
<a name="headers" />

Swagger also supports the documentation of parameters passed in the header. Since grape's ```params[]``` doesn't return header parameters we can specify header parameters seperately in a block after the description.

```ruby
Expand All @@ -439,7 +419,6 @@ desc "Return super-secret information", {
```



#### Hiding an Endpoint <a name="hiding" />

You can hide an endpoint by adding ```hidden: true``` in the description of the endpoint:
Expand Down Expand Up @@ -469,7 +448,6 @@ desc 'Conditionally hide this endpoint', hidden: lambda { ENV['EXPERIMENTAL'] !=
```



#### Overriding Auto-Generated Nicknames <a name="overriding-auto-generated-nicknames" />

You can specify a swagger nickname to use instead of the auto generated name by adding `:nickname 'string'``` in the description of the endpoint.
Expand All @@ -479,7 +457,6 @@ desc 'Get a full list of pets', nickname: 'getAllPets'
```



#### Specify endpoint details <a name="details" />

To specify further details for an endpoint, use the `detail` option within a block passed to `desc`:
Expand All @@ -492,7 +469,6 @@ get '/kittens' do
```



#### Overriding the route summary <a name="summary" />

To override the summary, add `summary: '[string]'` after the description.
Expand All @@ -508,7 +484,6 @@ end
```



#### Overriding the tags <a name="tags" />

Tags are used for logical grouping of operations by resources or any other qualifier. To override the
Expand Down Expand Up @@ -537,7 +512,8 @@ namespace 'order' do
end
```

#### Overriding the name of the body parameter

#### Overriding the name of the body parameter <a name="body-param" />

By default, body parameters have a generated name based on the operation. For
deeply nested resources, this name can get very long. To override the name of
Expand All @@ -552,6 +528,7 @@ namespace 'order' do
end
```


#### Defining an endpoint as an array <a name="array" />

You can define an endpoint as an array by adding `is_array` in the description:
Expand All @@ -561,7 +538,6 @@ desc 'Get a full list of pets', is_array: true
```



#### Using an options hash <a name="options" />

The Grape DSL supports either an options hash or a restricted block to pass settings. Passing the `nickname`, `hidden` and `is_array` options together with response codes is only possible when passing an options hash.
Expand All @@ -582,7 +558,6 @@ get '/kittens' do
```



#### Overriding parameter type <a name="overriding-param-type" />

You can override paramType, using the documentation hash. See [parameter object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameter-object) for available types.
Expand All @@ -597,7 +572,6 @@ end
```



#### Overriding data type of the parameter <a name="overriding-type-of-param" />

You can override type, using the documentation hash.
Expand All @@ -622,7 +596,6 @@ end
```



#### Multiple types <a name="multiple-types" />

By default when you set multiple types, the first type is selected as swagger type
Expand All @@ -646,7 +619,6 @@ end
```



#### Array of data type <a name="array-type" />

Array types are also supported.
Expand All @@ -673,7 +645,6 @@ end
```



#### Collection format of arrays <a name="collection-format" />

You can set the collection format of an array, using the documentation hash.
Expand Down Expand Up @@ -708,7 +679,6 @@ end
```



#### Hiding parameters <a name="hiding-parameters" />

Exclude single optional parameter from the documentation
Expand All @@ -724,7 +694,6 @@ end
```



#### Setting a Swagger default value <a name="default-value" />

Grape allows for an additional documentation hash to be passed to a parameter.
Expand Down Expand Up @@ -795,7 +764,6 @@ end
```



#### Response documentation <a name="response" />

You can also document the HTTP status codes with a description and a specified model, as ref in the schema to the definitions, that your API returns with one of the following syntax.
Expand Down Expand Up @@ -1190,8 +1158,8 @@ end
```


## Securing the Swagger UI <a name="oauth" />

## Securing the Swagger UI <a name="oauth" />

The Swagger UI on Grape could be secured from unauthorized access using any middleware, which provides certain methods:

Expand Down Expand Up @@ -1260,6 +1228,7 @@ The lambda is checking whether the user is authenticated (if not, the token_owne
role - only admins can see this endpoint.



## Examples <a="example" />

Go into example directory and run it: `$ bundle exec rackup`
Expand Down
2 changes: 1 addition & 1 deletion lib/grape-swagger/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module GrapeSwagger
VERSION = '0.28.0'
VERSION = '0.29.0'
end

0 comments on commit c00c5b4

Please sign in to comment.