@api-components/api-type-document 4.2.20 → 4.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@api-components/api-type-document",
3
3
  "description": "A documentation table for type (resource) properties. Works with AMF data model",
4
- "version": "4.2.20",
4
+ "version": "4.2.22",
5
5
  "license": "Apache-2.0",
6
6
  "main": "index.js",
7
7
  "module": "index.js",
@@ -383,6 +383,12 @@ export class ApiTypeDocument extends PropertyDocumentMixin(LitElement) {
383
383
  this._hasType(type, this.ns.aml.vocabularies.shapes.NilShape)
384
384
  ) {
385
385
  isScalar = true;
386
+ if (this._hasProperty(type, this.ns.w3.shacl.xone)) {
387
+ isScalar = false;
388
+ isOneOf = true;
389
+ key = this._getAmfKey(this.ns.w3.shacl.xone);
390
+ this.oneOfTypes = this._computeTypes(type, key);
391
+ }
386
392
  } else if (
387
393
  this._hasType(type, this.ns.aml.vocabularies.shapes.UnionShape)
388
394
  ) {
@@ -416,7 +422,10 @@ export class ApiTypeDocument extends PropertyDocumentMixin(LitElement) {
416
422
  isObject = true;
417
423
  const andKey = this._getAmfKey(this.ns.w3.shacl.and);
418
424
  if (andKey in type) {
419
- isObject = false;
425
+ const propertyKey = this._getAmfKey(this.ns.w3.shacl.property);
426
+ if (!(propertyKey in type)) {
427
+ isObject = false;
428
+ }
420
429
  isAnd = true;
421
430
  this.andTypes = this._computeAndTypes(type[andKey]);
422
431
  }