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

Commit 823e06d

Browse files
committed
fix(apiaryb): prevent null title for unnamed section
1 parent cfc2921 commit 823e06d

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

packages/fury-adapter-apiary-blueprint-parser/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## Master
4+
5+
### Bug Fixes
6+
7+
- Prevents placing a null title element in a resource group when the section
8+
name is empty.
9+
310
## 3.0.0-beta.9 (2019-07-02)
411

512
### Enhancements

packages/fury-adapter-apiary-blueprint-parser/lib/parser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ class Parser {
8686
const { Copy, Category, Resource } = this.namespace.elements;
8787

8888
const group = new Category();
89-
group.title = section.name;
89+
if (section.name) {
90+
group.title = section.name;
91+
}
9092
group.classes.push('resourceGroup');
9193

9294
if (section.description) {

packages/fury-adapter-apiary-blueprint-parser/test/fixtures/unnamed-section.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
{
2323
"element": "category",
2424
"meta": {
25-
"title": {
26-
"element": "null",
27-
"content": null
28-
},
2925
"classes": {
3026
"element": "array",
3127
"content": [

0 commit comments

Comments
 (0)