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

Commit e2fc472

Browse files
committed
Merge pull request #37 from apiaryio/daniel/mson-refract
Switch from MSON-AST to Data Struct Refract
2 parents c236fee + 8e600b1 commit e2fc472

File tree

2 files changed

+62
-81
lines changed

2 files changed

+62
-81
lines changed

Parse Result.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ This document describes API Blueprint Serialized Parse Result Media Types – th
55

66
## Version
77

8-
+ **Version**: 2.1
8+
+ **Version**: 2.2
99
+ **Created**: 2014-06-09
10-
+ **Updated**: 2014-11-27
11-
+ **AST Serialization Media Types**: 3.0
10+
+ **Updated**: 2015-09-07
11+
+ **AST Serialization Media Types**: 4.0
1212

1313
---
1414

@@ -62,33 +62,31 @@ Description of a warning from the parser.
6262

6363
## Media Types
6464

65-
The base media type for API Blueprint Parsing result is `application/vnd.apiblueprint.parseresult`. A Parse Result with raw Markdown descriptions in API Blueprint AST has the `.raw` suffix whereas version with Markdown descriptions rendered into HTML has the `.html`.
66-
67-
The base media type serialization format is specified in the `+<serialization format>` appendix.
65+
The media type for API Blueprint Parsing result is `application/vnd.apiblueprint.parseresult`. The media type serialization format is specified in the `+<serialization format>` appendix.
6866

6967
### Serialization formats
7068

7169
Two supported, feature-equal serialization formats are JSON and YAML:
7270

73-
+ `application/vnd.apiblueprint.parseresult.raw+json` and `application/vnd.apiblueprint.parseresult.html+json`
74-
+ `application/vnd.apiblueprint.parseresult.raw+yaml` and `application/vnd.apiblueprint.parseresult.html+yaml`
71+
+ `application/vnd.apiblueprint.parseresult+json`
72+
+ `application/vnd.apiblueprint.parseresult+yaml`
7573

7674
Parser Result Media Types inherit from the respective [AST Serialization Type](README.md):
7775

78-
+ [`application/vnd.apiblueprint.ast.*+json`](#json-serialization)
79-
+ `application/vnd.apiblueprint.ast.*+yaml`
76+
+ [`application/vnd.apiblueprint.ast+json`](#json-serialization)
77+
+ `application/vnd.apiblueprint.ast+yaml`
8078
+ [`application/vnd.apiblueprint.sourcemap+json`](#json-serialization)
8179
+ `application/vnd.apiblueprint.sourcemap+yaml`
8280

8381
### JSON Serialization
8482

85-
`application/vnd.apiblueprint.parseresult.*+json; version=2.1`
83+
`application/vnd.apiblueprint.parseresult+json; version=2.2`
8684

8785
```json
8886
{
89-
"_version": "2.1",
87+
"_version": "2.2",
9088
"ast": {
91-
"_version": "3.0",
89+
"_version": "4.0",
9290

9391
...
9492
},

README.md

Lines changed: 51 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Converting API Blueprint to AST and its serialization is the task of API Bluepri
1414
If you are looking for a way to describe your Web API without using JSON or YAML see [API Blueprint](https://github.com/apiaryio/api-blueprint).
1515

1616
## Version
17-
+ **Version**: 3.0
17+
+ **Version**: 4.0
1818
+ **Created**: 2013-08-30
19-
+ **Updated**: 2015-01-29
19+
+ **Updated**: 2015-09-07
2020

2121
## Future Development
2222
As of version 3.0 the API Blueprint AST is in the *interim* transition period
@@ -204,23 +204,17 @@ A reference object which is used whenever there is a reference to a [Resource Mo
204204
#### Properties
205205
+ `id` (string) - The identifier (name) of the reference
206206

207-
### Data Structure ([Named Type][])
208-
Definition of an [MSON][] data structure.
209-
210-
#### Properties
211-
- `element`: `dataStructure` (fixed, required)
212-
213207
## Media Types
214-
The `application/vnd.apiblueprint.ast` is the base media type for API Blueprint AST. An API Blueprint AST with raw Markdown descriptions has the `.raw` suffix whereas version with Markdown descriptions rendered into HTML has the `.html` suffix. The base media type serialization format is specified in the `+<serialization format>` appendix.
208+
The `application/vnd.apiblueprint.ast` is the media type for API Blueprint AST. The media type serialization format is specified in the `+<serialization format>` appendix.
215209

216210
### Serialization formats
217211
Two supported, feature-equal serialization formats are JSON and YAML:
218212

219-
+ `application/vnd.apiblueprint.ast.raw+json` and `application/vnd.apiblueprint.ast.html+json`
220-
+ `application/vnd.apiblueprint.ast.raw+yaml` and `application/vnd.apiblueprint.ast.html+yaml`
213+
+ `application/vnd.apiblueprint.ast.json`
214+
+ `application/vnd.apiblueprint.ast.yaml`
221215

222216
### Example: JSON Serialization
223-
`application/vnd.apiblueprint.ast.raw+json; version=3.0`
217+
`application/vnd.apiblueprint.ast.json; version=4.0`
224218

225219
```json
226220
{
@@ -262,13 +256,13 @@ Two supported, feature-equal serialization formats are JSON and YAML:
262256
"content": [
263257
{
264258
"element": "dataStructure",
265-
"name": null,
266-
"base": {
267-
"typeSpecification": {
268-
"name": "<sub-type>"
269-
}
270-
},
271-
"sections": []
259+
"content":{
260+
"element": "object",
261+
"meta": {
262+
"ref": "<sub-type>"
263+
},
264+
"content": []
265+
}
272266
},
273267
{
274268
"element": "asset",
@@ -338,13 +332,13 @@ Two supported, feature-equal serialization formats are JSON and YAML:
338332
"content": [
339333
{
340334
"element": "dataStructure",
341-
"name": null,
342-
"base": {
343-
"typeSpecification": {
344-
"name": "<sub-type>"
345-
}
346-
},
347-
"sections": []
335+
"content": {
336+
"element": "object",
337+
"meta": {
338+
"ref": "<sub-type>"
339+
},
340+
"content": []
341+
}
348342
},
349343
{
350344
"element": "asset",
@@ -376,13 +370,13 @@ Two supported, feature-equal serialization formats are JSON and YAML:
376370
"content": [
377371
{
378372
"element": "dataStructure",
379-
"name": null,
380-
"base": {
381-
"typeSpecification": {
382-
"name": "<sub-type>"
383-
}
384-
},
385-
"sections": []
373+
"content": {
374+
"element": "object",
375+
"meta": {
376+
"ref": "<sub-type>"
377+
},
378+
"content": []
379+
}
386380
},
387381
{
388382
"element": "asset",
@@ -406,13 +400,13 @@ Two supported, feature-equal serialization formats are JSON and YAML:
406400
"content": [
407401
{
408402
"element": "dataStructure",
409-
"name": null,
410-
"base": {
411-
"typeSpecification": {
412-
"name": "<sub-type>"
413-
}
414-
},
415-
"sections": []
403+
"content": {
404+
"element": "object",
405+
"meta": {
406+
"ref": "<sub-type>"
407+
},
408+
"content": []
409+
}
416410
}
417411
]
418412
},
@@ -463,16 +457,14 @@ Two supported, feature-equal serialization formats are JSON and YAML:
463457
"content": [
464458
{
465459
"element": "dataStructure",
466-
"name": {
467-
"literal": "<resource name>",
468-
"variable": false
469-
},
470-
"base": {
471-
"typeSpecification": {
472-
"name": "<sub-type>"
473-
}
474-
},
475-
"sections": []
460+
"content": {
461+
"element": "object",
462+
"meta": {
463+
"id": "<resource-name>",
464+
"ref": "<sub-type>"
465+
},
466+
"content": []
467+
}
476468
}
477469
]
478470
}
@@ -483,16 +475,14 @@ Two supported, feature-equal serialization formats are JSON and YAML:
483475
"content": [
484476
{
485477
"element": "dataStructure",
486-
"name": {
487-
"literal": "<data structure name>",
488-
"variable": false
489-
},
490-
"base": {
491-
"typeSpecification": {
492-
"name": "<sub-type>"
493-
}
494-
},
495-
"sections": []
478+
"content": {
479+
"element": "object",
480+
"meta": {
481+
"id": "<data-structure-name>",
482+
"ref": "<sub-type>"
483+
},
484+
"content": []
485+
}
496486
}
497487
]
498488
}
@@ -512,13 +502,6 @@ MIT License. See the [LICENSE](LICENSE) file.
512502
[Parsing media types]: Parse%20Result.md
513503

514504
[MSON]: https://github.com/apiaryio/mson
515-
[MSON AST]: https://github.com/apiaryio/mson-ast
516-
[MSON Named Type]: https://github.com/apiaryio/mson/blob/master/MSON%20Specification.md#22-named-types
517-
518-
[Named Type]: https://github.com/apiaryio/mson-ast#named-type
519-
[Type Name]: https://github.com/apiaryio/mson-ast#type-name
520-
[Type Definition]: https://github.com/apiaryio/mson-ast#type-definition
521-
[Type Section]: https://github.com/apiaryio/mson-ast#type-section
522505

523506
[API Blueprint asset]: https://github.com/apiaryio/api-blueprint/blob/master/Glossary%20of%20Terms.md#asset
524507

@@ -537,7 +520,7 @@ MIT License. See the [LICENSE](LICENSE) file.
537520
[Parameter]: #parameter-object
538521
[Transaction Example]: #transaction-example-object
539522
[Attributes]: #attributes-data-structure
540-
[Data Structure]: #data-structure-object
523+
[Data Structure]: https://github.com/refractproject/refract-spec/blob/master/namespaces/api-description-namespace.md#data-structure-element
541524
[Data Structures]: #data-structures-object
542525

543526
[Source Map Definition]: Source%20Map.md

0 commit comments

Comments
 (0)