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

Commit 7f032c6

Browse files
authored
Handle parameters without value during serialize (#359)
Handle parameters without value during serialize
2 parents c70d55c + f3ec331 commit 7f032c6

File tree

4 files changed

+62
-1
lines changed

4 files changed

+62
-1
lines changed

packages/fury-adapter-apib-serializer/CHANGELOG.md

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

3+
## Master
4+
5+
### Bug Fixes
6+
7+
- Prevents an exception from being thrown when serializing href variables which
8+
do not include a value.
9+
[#357](https://github.com/apiaryio/api-elements.js/issues/357)
10+
311
## 0.12.1 (2019-07-12)
412

513
### Bug Fixes

packages/fury-adapter-apib-serializer/template.nunjucks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ FORMAT: 1A
5050

5151
{% for item in hrefVariables.content %}
5252
{% set typeAttributes = item.attributes.get('typeAttributes') %}
53-
+ {{ item.key.toValue() }}{% if item.value.toValue() %}: {{ item.value.toValue() }}{% endif %}{% if typeAttributes %} ({{ typeAttributes.toValue() }}){% endif %}{% if item.description and item.description.toValue() %} - {{ item.description.toValue() }}{% endif %}{% endfor %}
53+
+ {{ item.key.toValue() }}{% if item.value and item.value.toValue() %}: {{ item.value.toValue() }}{% endif %}{% if typeAttributes %} ({{ typeAttributes.toValue() }}){% endif %}{% if item.description and item.description.toValue() %} - {{ item.description.toValue() }}{% endif %}{% endfor %}
5454

5555
{% endmacro %}
5656

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FORMAT: 1A
2+
3+
# API Documentation
4+
5+
### /{?example}
6+
7+
+ Parameters
8+
9+
+ example
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"element": "parseResult",
3+
"content": [
4+
{
5+
"element": "category",
6+
"meta": {
7+
"classes": {
8+
"element": "array",
9+
"content": [
10+
{
11+
"element": "string",
12+
"content": "api"
13+
}
14+
]
15+
}
16+
},
17+
"content": [
18+
{
19+
"element": "resource",
20+
"attributes": {
21+
"href": {
22+
"element": "string",
23+
"content": "/{?example}"
24+
},
25+
"hrefVariables": {
26+
"element": "hrefVariables",
27+
"content": [
28+
{
29+
"element": "member",
30+
"content": {
31+
"key": {
32+
"element": "string",
33+
"content": "example"
34+
}
35+
}
36+
}
37+
]
38+
}
39+
}
40+
}
41+
]
42+
}
43+
]
44+
}

0 commit comments

Comments
 (0)