Skip to content

Commit

Permalink
Merge pull request #380 from apiaryio/pksunkara/snowcrash
Browse files Browse the repository at this point in the history
Updated snowcrash
  • Loading branch information
kylef committed Aug 25, 2016
2 parents 35f0835 + 69cbbc2 commit 60f195e
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 309 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,17 @@
annotation was not being overridden.
[#366](https://github.com/apiaryio/drafter/issues/366)

* Always give an error when unable to find named type.
[snowcrash#354](https://github.com/apiaryio/snowcrash/issues/354)

* Ensure that escaped values in MSON are not treated as markdown
[#365](https://github.com/apiaryio/drafter/issues/365)

### Enhancements

* Warn when primitive values in MSON doesn't follow the given type format
[#334](https://github.com/apiaryio/drafter/issues/334)

## 3.1.0-pre.0

### Enhancements
Expand Down
10 changes: 0 additions & 10 deletions test/fixtures/mson/mixin-nonexistent.ast.json
Expand Up @@ -11,16 +11,6 @@
]
},
"warnings": [
{
"code": 8,
"message": "unable to find the symbol `XXX` in the list of named types",
"location": [
{
"index": 282,
"length": 12
}
]
},
{
"code": 3,
"message": "mixin type may not include a type of a primitive sub-type",
Expand Down
13 changes: 1 addition & 12 deletions test/fixtures/mson/regression-269.ast.json
Expand Up @@ -10,16 +10,5 @@
}
]
},
"warnings": [
{
"code": 8,
"message": "unable to find the symbol `X` in the list of named types",
"location": [
{
"index": 19,
"length": 10
}
]
}
]
"warnings": []
}
5 changes: 1 addition & 4 deletions test/fixtures/mson/resource-unresolved-reference.apib
@@ -1,9 +1,6 @@
# Polls [/]

FIXME: what should be result of expansion for nonexistent structure?
possible solutions
- use "extend" w/ Ref Element
- use empty object with `meta.ref : "Person"`
Error should be result of expansion for nonexistent structure

## Get a Poll [GET]

Expand Down
143 changes: 7 additions & 136 deletions test/fixtures/mson/resource-unresolved-reference.ast.json
@@ -1,151 +1,22 @@
{
"_version": "2.2",
"ast": {
"_version": "4.0",
"metadata": [],
"name": "",
"description": "",
"element": "category",
"resourceGroups": [
{
"name": "",
"description": "",
"resources": [
{
"element": "resource",
"name": "Polls",
"description": "FIXME: what should be result of expansion for nonexistent structure?\npossible solutions\n\n - use \"extend\" w/ Ref Element\n\n - use empty object with `meta.ref : \"Person\"`\n\n",
"uriTemplate": "/",
"model": {},
"parameters": [],
"actions": [
{
"name": "Get a Poll",
"description": "",
"method": "GET",
"parameters": [],
"attributes": {
"relation": "",
"uriTemplate": ""
},
"content": [
{
"element": "dataStructure",
"content": [
{
"element": "extend",
"content": [
{
"element": "object",
"content": [
{
"element": "member",
"content": {
"key": {
"element": "string",
"content": "id"
},
"value": {
"element": "string"
}
}
}
]
}
]
}
]
}
],
"examples": []
}
],
"content": []
}
]
}
],
"content": [
"error": {
"code": 4,
"message": "base type 'Person' is not defined in the document",
"location": [
{
"element": "category",
"content": [
{
"element": "resource",
"name": "Polls",
"description": "FIXME: what should be result of expansion for nonexistent structure?\npossible solutions\n\n - use \"extend\" w/ Ref Element\n\n - use empty object with `meta.ref : \"Person\"`\n\n",
"uriTemplate": "/",
"model": {},
"parameters": [],
"actions": [
{
"name": "Get a Poll",
"description": "",
"method": "GET",
"parameters": [],
"attributes": {
"relation": "",
"uriTemplate": ""
},
"content": [
{
"element": "dataStructure",
"content": [
{
"element": "extend",
"content": [
{
"element": "object",
"content": [
{
"element": "member",
"content": {
"key": {
"element": "string",
"content": "id"
},
"value": {
"element": "string"
}
}
}
]
}
]
}
]
}
],
"examples": []
}
],
"content": []
}
]
"index": 99,
"length": 20
}
]
},
"error": {
"code": 0,
"message": "",
"location": []
},
"warnings": [
{
"code": 8,
"message": "unable to find the symbol `Person` in the list of named types",
"location": [
{
"index": 205,
"length": 20
}
]
},
{
"code": 6,
"message": "action is missing a response",
"location": [
{
"index": 182,
"index": 76,
"length": 21
}
]
Expand Down
10 changes: 0 additions & 10 deletions test/fixtures/parse-result/error-warning.ast.json
Expand Up @@ -20,16 +20,6 @@
"length": 13
}
]
},
{
"code": 8,
"message": "unable to find the symbol `B` in the list of named types",
"location": [
{
"index": 55,
"length": 9
}
]
}
]
}
10 changes: 0 additions & 10 deletions test/fixtures/parse-result/error-warning.ast.sourcemap.json
Expand Up @@ -20,16 +20,6 @@
"length": 13
}
]
},
{
"code": 8,
"message": "unable to find the symbol `B` in the list of named types",
"location": [
{
"index": 55,
"length": 9
}
]
}
]
}
23 changes: 0 additions & 23 deletions test/fixtures/parse-result/error-warning.json
Expand Up @@ -46,29 +46,6 @@
]
},
"content": "no parameters specified, expected a nested list of parameters, one parameter per list item"
},
{
"element": "annotation",
"meta": {
"classes": [
"warning"
]
},
"attributes": {
"code": 8,
"sourceMap": [
{
"element": "sourceMap",
"content": [
[
55,
9
]
]
}
]
},
"content": "unable to find the symbol `B` in the list of named types"
}
]
}
23 changes: 0 additions & 23 deletions test/fixtures/parse-result/error-warning.sourcemap.json
Expand Up @@ -46,29 +46,6 @@
]
},
"content": "no parameters specified, expected a nested list of parameters, one parameter per list item"
},
{
"element": "annotation",
"meta": {
"classes": [
"warning"
]
},
"attributes": {
"code": 8,
"sourceMap": [
{
"element": "sourceMap",
"content": [
[
55,
9
]
]
}
]
},
"content": "unable to find the symbol `B` in the list of named types"
}
]
}

0 comments on commit 60f195e

Please sign in to comment.