Releases: westfieldlabs/apivore
Fix Rails 5 action dispatch request arguments deprecation warning
Support for rails 5 in addition to previously supported rails/ruby versions
Rails 5 has dropped support for ruby < 2.2.2
. This patch supports the usage of apivore pre and post ruby 2.2.2
Allow full URL for consistency check master document
Apivore assumes that the master document swagger is at a fixed address of http://<host>/swagger.json
. This is limiting in that the protocol, path, and any authentication cannot be specified. Simply using the full URL addresses some of these issues, thus:
it 'has definitions consistent with the master docs' do
expect(subject).to be_consistent_with_swagger_definitions(
'https://api.westfield.io/swagger/1.json', 'deal'
)
Looking for http
allows the current behaviour as well as fully specified URL.
Update Swagger Spec and OAI changes
Latest version of the OpenAPI Swagger spec which includes the following fix to support empty schemas:
OAI/OpenAPI-Specification@dbb81f8
Readme and licenses updated to point to the Open API Initiative which, as of 2016, now maintains the Swagger 2.0 specification.
Response output for failed examples
For every failed example, the rspec output includes the response body that was received, e.g.
2) API testing scenarios mismatched property type fails
Failure/Error: expect(subject).to validate(:get, "/services/{id}.json", 200, { "id" => 1 })
'/api/services/1.json#/name' of type String did not match one or more of the following types: integer, null
Response body:
{
"id": 1,
"name": "hello world"
}
# ./spec/data/example_specs.rb:17:in `block (3 levels) in <top (required)>'
Ignore vendor specific tags at verb level
Vendor specific tags are now ignored at the verb level. Vendor specific tags are any tag of the form "x-something":
The intention here is to allow the vendor specific tag to apply to verbs in a path.
E.g.
...
paths:
/posts/{id}:
x-product: "Favorites"
get:
...
put:
...
...
Ignore vendor specific tags at verb level
Vendor specific tags are now ignored at the verb level. Vendor specific tags are any tag of the form "x-something":
The intention here is to allow the vendor specific tag to apply to verbs in a path.
E.g.
...
paths:
/posts/{id}:
x-product: "Favorites"
get:
...
put:
...
...
Ignore vendor specific tags under paths
Vendor specific tags are now ignored at the path level. Vendor specific tags are any tag of the form "x-something": <some object>
The intention here is to allow the vendor specific tag to apply to all paths.
E.g.
...
paths:
x-product: "Favorites"
/posts/{id}:
get:
...
put:
...
...
Support path level parameters
Thanks to @jszwedko for the pull request!
Previously apivore expected everything under a given route, e.g. /posts
, to be a HTTP verb, but parameters
is also supported in the Swagger 2.0 spec (to specify parameters that are required by each verb under the path).
E.g.
...
paths:
/posts/{id}:
parameters:
- name: id
in: path
type: integer
required: true
get:
...
put:
...
...
small bug fix
incorrect slash bug fix in error output