Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsonschema2md
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fork
jsonschema2md
Commits
dab709a8
Commit
dab709a8
authored
7 years ago
by
Lars Trieloff
Browse files
Options
Downloads
Patches
Plain Diff
[trivial] don't break when references cannot be resolved
parent
3d07a4bd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/markdownWriter.js
+7
-2
7 additions, 2 deletions
lib/markdownWriter.js
with
7 additions
and
2 deletions
lib/markdownWriter.js
+
7
−
2
View file @
dab709a8
...
@@ -83,7 +83,12 @@ function stringifyExamples(examples) {
...
@@ -83,7 +83,12 @@ function stringifyExamples(examples) {
function
simpletype
(
prop
)
{
function
simpletype
(
prop
)
{
const
type
=
prop
.
type
;
const
type
=
prop
.
type
;
if
(
prop
.
$ref
!==
undefined
)
{
if
(
prop
.
$ref
!==
undefined
)
{
prop
.
simpletype
=
prop
.
$linkVal
;
if
(
prop
.
$linkVal
!==
undefined
)
{
prop
.
simpletype
=
prop
.
$linkVal
;
}
else
{
console
.
log
(
'
unresolved reference:
'
+
prop
.
$ref
);
prop
.
simpletype
=
'
reference
'
;
}
}
else
if
(
prop
.
enum
!==
undefined
)
{
}
else
if
(
prop
.
enum
!==
undefined
)
{
prop
.
simpletype
=
'
`enum`
'
;
prop
.
simpletype
=
'
`enum`
'
;
if
(
prop
[
'
meta:enum
'
]
===
undefined
)
{
if
(
prop
[
'
meta:enum
'
]
===
undefined
)
{
...
@@ -113,9 +118,9 @@ function simpletype(prop) {
...
@@ -113,9 +118,9 @@ function simpletype(prop) {
if
(
innertype
.
simpletype
===
'
complex
'
)
{
if
(
innertype
.
simpletype
===
'
complex
'
)
{
prop
.
simpletype
=
'
`array`
'
;
prop
.
simpletype
=
'
`array`
'
;
}
else
{
}
else
{
//console.log(prop.title);
prop
.
simpletype
=
innertype
.
simpletype
.
replace
(
/
(
`
)
$/
,
'
[]$1
'
);
prop
.
simpletype
=
innertype
.
simpletype
.
replace
(
/
(
`
)
$/
,
'
[]$1
'
);
}
}
console
.
log
();
}
else
{
}
else
{
prop
.
simpletype
=
'
`array`
'
;
prop
.
simpletype
=
'
`array`
'
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment