danielgtaylor / danielgtaylor/eidolon

(default) gets converted to null

Open
#12 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
CoffeeScript
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Small reproducible test case:

``` js
const protagonist = require('protagonist');
const eidolon = require('eidolon');

const apib = `
# Data structures

## Foobar (object)
+ foo (enum)
+ bar (default)
+ baz
`;

protagonist.parse(apib, (errors, result) => {
const dataStructure = result.content[0].content[0].content[0].content[0];
const schema = eidolon.schema(dataStructure, {});

console.log(
JSON.stringify(schema, null, 4)
);
});
```

This yields:

``` json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"foo": {
"enum": [
null,
"baz"
]
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.