Skip to content

Commit a2d6516

Browse files
authored
Merge pull request #77 from advanced-rest-client/fix/W-13772034/duplicated-info
[W-13772034] Duplicated array info
2 parents ea17cd1 + 8b53e33 commit a2d6516

File tree

10 files changed

+56
-8
lines changed

10 files changed

+56
-8
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#%RAML 1.0 Library
2+
usage:
3+
types:
4+
1-post:
5+
properties:
6+
parent1:
7+
description: 親要素にmaxItemsの指定あり
8+
type: array
9+
maxItems: 2
10+
11+
items:
12+
properties:
13+
child:
14+
type: string
15+
child2:
16+
type: string[]
17+
example:
18+
- A
19+
- B
20+
- C
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#%RAML 1.0 ResourceType
2+
3+
post:
4+
displayName: ANAUIUXS2_DEV-3915の調査
5+
body:
6+
application/json:
7+
type: kaminoLib.1-post

demo/W-13770031/W-13770031.raml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#%RAML 1.0
2+
title: avnz_work
3+
4+
resourceTypes:
5+
kamino1: !include /ResourceTypes/Kamino1.raml
6+
7+
uses:
8+
kaminoLib: /DataTypes/Kamino-library.raml
9+
10+
/kamino/1:
11+
type: kamino1

demo/apis.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"W-11858334/W-11858334.raml": "RAML 1.0",
1818
"W-12137562/W-12137562.raml": "RAML 1.0",
1919
"W-12428173/W-12428173.raml": "RAML 1.0",
20+
"W-13770031/W-13770031.raml": "RAML 1.0",
2021
"APIC-429/APIC-429.yaml": { "type": "OAS 3.0", "mime": "application/yaml" },
2122
"SE-17897/SE-17897.yaml": { "type": "OAS 3.0", "mime": "application/yaml" },
2223
"W-13547158/W-13547158.yaml": { "type": "OAS 3.0", "mime": "application/yaml" },

demo/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class ApiDemo extends ApiDemoPage {
117117
['W-12137562', 'W-12137562'],
118118
['W-12428173', 'W-12428173'],
119119
['W-13547158', 'W-13547158'],
120+
['W-13770031', 'W-13770031'],
120121
].map(
121122
([file, label]) => html` <anypoint-item data-src="${file}-compact.json"
122123
>${label} - compact model</anypoint-item

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@api-components/api-type-document",
33
"description": "A documentation table for type (resource) properties. Works with AMF data model",
4-
"version": "4.2.27",
4+
"version": "4.2.28",
55
"license": "Apache-2.0",
66
"main": "index.js",
77
"module": "index.js",

src/ApiTypeDocument.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ export class ApiTypeDocument extends PropertyDocumentMixin(LitElement) {
174174
*/
175175
noMediaSelector: boolean;
176176

177+
noArrayInfo: boolean;
178+
177179
get shouldRenderMediaSelector(): boolean;
178180

179181
constructor();

src/ApiTypeDocument.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ export class ApiTypeDocument extends PropertyDocumentMixin(LitElement) {
167167
* applicable.
168168
*/
169169
noMediaSelector: { type: Boolean },
170+
171+
noArrayInfo: { type: Boolean },
170172
};
171173
}
172174

@@ -685,13 +687,16 @@ export class ApiTypeDocument extends PropertyDocumentMixin(LitElement) {
685687
}
686688

687689
_arrayPropertiesTemplate() {
688-
const minCount = this._getValue(this._resolvedType, this.ns.w3.shacl.minCount)
689-
const maxCount = this._getValue(this._resolvedType, this.ns.w3.shacl.maxCount)
690+
if (!this.noArrayInfo) {
691+
const minCount = this._getValue(this._resolvedType, this.ns.w3.shacl.minCount)
692+
const maxCount = this._getValue(this._resolvedType, this.ns.w3.shacl.maxCount)
690693

691-
return html`
692-
${minCount !== undefined ? this._arrayPropertyTemplate('Minimum array length:', minCount, 'Minimum amount of items in array') : ''}
693-
${maxCount !== undefined ? this._arrayPropertyTemplate('Maximum array length:', maxCount, 'Maximum amount of items in array') : ''}
694-
`
694+
return html`
695+
${minCount !== undefined ? this._arrayPropertyTemplate('Minimum array length:', minCount, 'Minimum amount of items in array') : ''}
696+
${maxCount !== undefined ? this._arrayPropertyTemplate('Maximum array length:', maxCount, 'Maximum amount of items in array') : ''}
697+
`
698+
}
699+
return html``
695700
}
696701

697702
/**

src/PropertyShapeDocument.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
582582
?compatibility="${this.compatibility}"
583583
?noExamplesActions="${this.noExamplesActions}"
584584
noMainExample
585+
noArrayInfo
585586
.mediaType="${this.mediaType}"
586587
?graph="${this.graph}"
587588
></api-type-document>`;

0 commit comments

Comments
 (0)