Skip to content

Commit

Permalink
Render schema default values to tables
Browse files Browse the repository at this point in the history
Addresses: #472 (comment)
  • Loading branch information
nils-work committed Jan 15, 2025
1 parent 34c1c99 commit 70ae40a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions swagger-gen/widdershins-cdr/templates/openapi3/main.dot
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
<h3 id="{{= data.title_prefix }}_{{= s.toLowerCase() }}_properties">Properties</h3>
{{?}}

{{? block.rows.length}}|Name|Type|Required|Description|
|---|---|---|---|{{?}}
{{~ block.rows :p}}|{{=p.displayName}}|{{? p.cdrType}}{{=p.cdrType}}{{??}}{{=p.safeType}}{{?}}|{{=p.required_text}}|{{=p.description||'none'}}|
{{? block.rows.length}}|Name|Type|Required|Default|Description|
|---|---|---|---|---|{{?}}
{{~ block.rows :p}}|{{=p.displayName}}|{{? p.cdrType}}{{=p.cdrType}}{{??}}{{=p.safeType}}{{?}}|{{=p.required_text}}|{{= (p.schema.default !== undefined ? '`' + p.schema.default + '`' : '') }}|{{=p.description||'none'}}|
{{~}}
{{~}}
{{? (blocks[0].rows.length === 0) && (blocks.length === 1) }}
Expand Down
6 changes: 3 additions & 3 deletions swagger-gen/widdershins-cdr/templates/openapi3/parameters.def
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h3 id="{{= data.cds_uniqueAnchorPrefix }}_parameters">Parameters</h3>

|Name|In|Type|Required|Description|
|---|---|---|---|---|
{{~ data.parameters :p}}|{{=p.name}}|{{=p.in}}|{{? p.cdrType}}{{=p.cdrType}}{{??}}{{=p.safeType}}{{?}}|{{? p.required}}mandatory{{??}}{{? p.cdrConditional}}conditional{{??}}optional{{?}}{{?}}|{{=p.shortDesc || 'none'}}|
|Name|In|Type|Required|Default|Description|
|---|---|---|---|---|---|
{{~ data.parameters :p}}|{{=p.name}}|{{=p.in}}|{{? p.cdrType}}{{=p.cdrType}}{{??}}{{=p.safeType}}{{?}}|{{? p.required}}mandatory{{??}}{{? p.cdrConditional}}conditional{{??}}optional{{?}}{{?}}|{{= (p.schema.default !== undefined ? '`' + p.schema.default + '`' : '') }}|{{=p.shortDesc || 'none'}}|
{{~}}

{{? data.longDescs }}
Expand Down

0 comments on commit 70ae40a

Please sign in to comment.