@tsofist/schema-forge 2.4.1 → 2.4.3

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.
@@ -29,7 +29,7 @@ export interface SchemaForgeBaseOptions {
29
29
  * Filter for definitions
30
30
  * Important: dependencies will not be filtered
31
31
  */
32
- definitionsFilter?: (name: string) => boolean;
32
+ readonly definitionsFilter?: (name: string) => boolean;
33
33
  /**
34
34
  * Create shared $ref definitions for all types
35
35
  *
package/lib/validator.js CHANGED
@@ -249,6 +249,7 @@ function createSchemaForgeValidator(engineOptions, useAdditionalFormats = false)
249
249
  function addJSDocKeywords(engine) {
250
250
  const InterfaceNamePattern = '^[A-Z][a-zA-Z0-9]+$';
251
251
  const PropertyNamePattern = '^[a-z][a-zA-Z0-9]+$';
252
+ const NestedPropertyNamePattern = '^[a-z][a-zA-Z0-9.-]+$';
252
253
  const MethodNamePattern = PropertyNamePattern;
253
254
  const MemberNamePattern = `${InterfaceNamePattern.substring(0, InterfaceNamePattern.length - 1)}#${PropertyNamePattern.substring(1)}`;
254
255
  const IXNamePattern = '^ix_[a-z][a-zA-Z0-9_]+$';
@@ -366,8 +367,11 @@ function addJSDocKeywords(engine) {
366
367
  pattern: EntityNamePattern,
367
368
  },
368
369
  indexes: {
369
- type: 'array',
370
- items: DBIndexSchema,
370
+ type: 'object',
371
+ additionalProperties: DBIndexSchema,
372
+ propertyNames: {
373
+ pattern: NestedPropertyNamePattern,
374
+ },
371
375
  },
372
376
  },
373
377
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsofist/schema-forge",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
4
4
  "description": "Generate JSON schema from TypeScript types",
5
5
  "author": "Andrew Berdnikov <tsofistgudmen@gmail.com>",
6
6
  "license": "LGPL-3.0",