Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit b25cc78

Browse files
authored
Merge pull request #486 from apiaryio/kylef/oas-header
Return unsupported warnings in header object instead of invalid
2 parents d9c1e42 + 48ce11d commit b25cc78

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

packages/openapi3-parser/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Fury OAS3 Parser Changelog
22

3+
## Master
4+
5+
### Bug Fixes
6+
7+
- Prior versions of the adapter reported the following 'Header Object' keys as
8+
invalid: `style`, `explode`, `allowReserved`, `schema`, `content`, `example`,
9+
and `examples`. These will now return an unsupported warning instead.
10+
311
## 0.13.0 (2020-06-12)
412

513
The package has been updated for compatibility with `@apielements/core`.

packages/openapi3-parser/lib/parser/oas/parseHeaderObject.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const parseObject = require('../parseObject');
1010
const name = 'Header Object';
1111
const unsupportedKeys = [
1212
'description', 'required', 'deprecated', 'allowEmptyValue',
13+
'style', 'explode', 'allowReserved', 'schema', 'content', 'example',
14+
'examples',
1315
];
1416
const isUnsupportedKey = R.anyPass(R.map(hasKey, unsupportedKeys));
1517

packages/openapi3-parser/test/integration/fixtures/petstore.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@
10351035
]
10361036
}
10371037
},
1038-
"content": "'Header Object' contains invalid key 'schema'"
1038+
"content": "'Header Object' contains unsupported key 'schema'"
10391039
},
10401040
{
10411041
"element": "annotation",

packages/openapi3-parser/test/integration/fixtures/petstore.sourcemap.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,7 @@
19851985
]
19861986
}
19871987
},
1988-
"content": "'Header Object' contains invalid key 'schema'"
1988+
"content": "'Header Object' contains unsupported key 'schema'"
19891989
},
19901990
{
19911991
"element": "annotation",

0 commit comments

Comments
 (0)