Skip to content

Commit

Permalink
fix: OAS3 integration tests and fixes SO-103 (#253)
Browse files Browse the repository at this point in the history
* chore: ignore lib directory

* refactor: change name, oas2

* test: enlarge the oas2 base file

* refactor: add json schema types for better typings

* fix: cast back to ajv so we can use it safely around

* refactor: avoid dangling non const

* chore: use node 10

* test: add bunch of tests

* test: add to do when we'll fix this problem

* test: use more precise paths

* test: add basic and failing tests

* feat: return and transform the default response if defined

* test: change test meaning

* chore: lint after the tests

* fix: try to find first the default response and then modify it

* fix: dot overwrite the original object

* test: add request specific status code test

* test: add test for unexistend status code

* test: add no parameter provided test

* fix: find a suitable response when not found

* test: update test to return default content-type

* test: dry fixture document

* refactor: correct texts

* test: remove oas2 leftover test

* test: put oas2/3 documents on pair

* test: repeat tests for oas2 and 3

* chore: file rename

* test: remove oas3 file test

* test: add oas3 specific

* test: remove xml content types

* test: reorder and fixup

* test: use native promise

* test: remove redundant test

* feat: do not create singleton grahite and loaders

* chore: env in config file

* chore: typecheck only on regular builds

* refactor: export class definition, not factories

* test: check loader type

* chore: dry test configuration

* test: oas specific

* test: externalise oas specific tests

* tests: check the body

* test: check resources are the same when loading same file in two instances

* test default response in oas2 too

* v3.0.0-pre.2
  • Loading branch information
XVincentX committed Apr 18, 2019
1 parent d05674a commit 930d29e
Show file tree
Hide file tree
Showing 23 changed files with 1,099 additions and 204 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
./cc-test-reporter after-build --coverage-input-type lcov --exit-code $?
- run:
name: Run build
command: yarn build
command: yarn typecheck
publish:
docker:
- image: circleci/node:10
Expand Down
28 changes: 23 additions & 5 deletions examples/petstore.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"http"
],
"paths": {
"/pet": {
"/pets": {
"post": {
"tags": [
"pet"
Expand Down Expand Up @@ -130,7 +130,7 @@
]
}
},
"/pet/findByStatus": {
"/pets/findByStatus": {
"get": {
"tags": [
"pet"
Expand Down Expand Up @@ -185,7 +185,7 @@
]
}
},
"/pet/findByTags": {
"/pets/findByTags": {
"get": {
"tags": [
"pet"
Expand Down Expand Up @@ -235,7 +235,7 @@
"deprecated": true
}
},
"/pet/{petId}": {
"/pets/{petId}": {
"get": {
"tags": [
"pet"
Expand Down Expand Up @@ -275,6 +275,24 @@
"schema": {
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "default response",
"schema": {
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
},
"security": [
Expand Down Expand Up @@ -380,7 +398,7 @@
]
}
},
"/pet/{petId}/uploadImage": {
"/pets/{petId}/uploadImage": {
"post": {
"tags": [
"pet"
Expand Down

0 comments on commit 930d29e

Please sign in to comment.