Socket
Socket
Sign inDemoInstall

@api-components/api-type-document

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@api-components/api-type-document - npm Package Compare versions

Comparing version 4.2.28 to 4.2.29

6

package.json
{
"name": "@api-components/api-type-document",
"description": "A documentation table for type (resource) properties. Works with AMF data model",
"version": "4.2.28",
"version": "4.2.29",
"license": "Apache-2.0",

@@ -31,3 +31,3 @@ "main": "index.js",

"@anypoint-web-components/anypoint-button": "^1.2.3",
"@api-components/amf-helper-mixin": "^4.5.6",
"@api-components/amf-helper-mixin": "^4.5.24",
"@api-components/api-annotation-document": "^4.1.0",

@@ -103,2 +103,2 @@ "@api-components/api-resource-example-document": "^4.3.3",

}
}
}

@@ -563,4 +563,22 @@ import { LitElement, html } from 'lit-element';

}
const key = this._getAmfKey(this.ns.w3.shacl.property);
return this._filterReadOnlyProperties(this._ensureArray(item[key]));
const propertyKey = this._getAmfKey(this.ns.w3.shacl.property);
const itemProperties = this._ensureArray(item[propertyKey])
const additionalPropertiesKey = this._getAmfKey(this.ns.w3.shacl.additionalPropertiesSchema);
// If the item doesn't have additional properties, filter the read-only properties and return
if (!item[additionalPropertiesKey]) {
return this._filterReadOnlyProperties(itemProperties)
}
const additionalPropertiesSchema = this._ensureArray(item[additionalPropertiesKey])
// If the item does have additional properties, ensure they are in an array
const additionalProperties = this._ensureArray(additionalPropertiesSchema[0][propertyKey])
// Combine the item's properties and additional properties
const combinedProperties = [...itemProperties, ...additionalProperties]
// Filter the read-only properties and return
return this._filterReadOnlyProperties(combinedProperties);
}

@@ -706,3 +724,3 @@

*/
_arrayTemplate() {
_arrayTemplate() {
const items = this._computeArrayProperties(this._resolvedType) || [];

@@ -747,5 +765,5 @@ const documents = items.map(

${documents}
</div>`
</div>`
: html`${documents}`
}
}

@@ -764,3 +782,3 @@ ${this._arrayPropertiesTemplate()}

const key = this._getAmfKey(this.ns.aml.vocabularies.shapes.anyOf);
const type = this._computeProperty(this._resolvedType, key,selected);
const type = this._computeProperty(this._resolvedType, key, selected);
const typeName = 'union'

@@ -862,6 +880,6 @@ const label = 'Any of'

(item) => html` ${item.label
? html`<p class="inheritance-label">
? html`<p class="inheritance-label">
Properties inherited from <b>${item.label}</b>.
</p>`
: html`<p class="inheritance-label">Properties defined inline.</p>`}
: html`<p class="inheritance-label">Properties defined inline.</p>`}
<api-type-document

@@ -895,8 +913,8 @@ class="and-document"

${this.shouldRenderMediaSelector
? html`<div class="media-type-selector">
? html`<div class="media-type-selector">
<span>Media type:</span>
${mediaTypes.map((item, index) => {
const selected = this.selectedMediaType === index;
const pressed = selected ? 'true' : 'false';
return html`<anypoint-button
const selected = this.selectedMediaType === index;
const pressed = selected ? 'true' : 'false';
return html`<anypoint-button
part="content-action-button"

@@ -912,5 +930,5 @@ class="media-toggle"

>`;
})}
})}
</div>`
: ''}
: ''}

@@ -917,0 +935,0 @@ <api-resource-example-document

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc