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

Commit

Permalink
Added readme for the resolved assets in the AST
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Feb 16, 2015
1 parent 4972c55 commit 0ed3de9
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,40 @@ EOF
$ drafter blueprint.apib
```

## Resolved Named Types

Named Types (and anonymous named types) are expanded in-place in the AST. The three rules for when MSON AST is expanded are:

* If a named type is a sub-type of another named type
* If a named types includes a mixin
* If a value member or property member is referencing a named type

## Resolved Assets

The resolved assets for a *payload body example* and *payload body schema* are added to the array in the `content` key of the **Payload Object** with their element name set to `resolvedAsset` and `role` in `attributes` set as `bodyExample` and `bodySchema` respectively.

```json
{
// This is the payload object
"content": [
{
"element": "resolvedAsset",
"attributes": {
"role": "bodyExample"
},
"content": "{\"id\":\"250FF\",\"percent_off\":25,\"redeem_by\":null}"
},
{
"element": "resolvedAsset",
"attributes": {
"role": "bodySchema"
},
"content": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"percent_off\":{\"type\":\"number\"},\"redeem_by\":{\"type\":\"number\",\"description\":\"Date after which the coupon can no longer be redeemed\"}},\"$schema\":\"http://json-schema.org/draft-04/schema#\"}"
}
]
}
```

## Test
In order to run CI tests you need to have access to both Drafter and Boutique repositories and you need to give CircleCI some extended permissions over all your repositories to enable testing on their machines.

Expand Down

0 comments on commit 0ed3de9

Please sign in to comment.