openapi-police
Advanced tools
Comparing version 1.0.11 to 1.1.0
@@ -1,4 +0,4 @@ | ||
import { SchemaObject, SchemaObjectOptions } from "./schema-object"; | ||
import { SchemaObjectOptions, StaticSchemaObject } from "./schema-object"; | ||
import { OpenAPIV3 } from "./types"; | ||
export declare class ParameterObject extends SchemaObject { | ||
export declare class ParameterObject extends StaticSchemaObject { | ||
protected parameter: OpenAPIV3.ParameterObject; | ||
@@ -5,0 +5,0 @@ constructor(parameter: OpenAPIV3.ParameterObject); |
@@ -59,3 +59,3 @@ "use strict"; | ||
} | ||
class ParameterObject extends schema_object_1.SchemaObject { | ||
class ParameterObject extends schema_object_1.StaticSchemaObject { | ||
constructor(parameter) { | ||
@@ -62,0 +62,0 @@ super(parameter.schema || true); |
@@ -8,6 +8,4 @@ import { Schema, ValidationOptions } from 'jsonpolice'; | ||
} | ||
export declare class SchemaObject extends Schema { | ||
protected _spec: Promise<OpenAPIV3.SchemaObject>; | ||
constructor(schema: OpenAPIV3.SchemaObject); | ||
spec(): Promise<OpenAPIV3.SchemaObject>; | ||
export declare abstract class SchemaObject extends Schema { | ||
abstract spec(): Promise<OpenAPIV3.SchemaObject>; | ||
protected readonly validators: Set<string>; | ||
@@ -22,1 +20,6 @@ protected coerceToType(data: string, type: string): any; | ||
} | ||
export declare class StaticSchemaObject extends SchemaObject { | ||
protected _spec: OpenAPIV3.SchemaObject; | ||
constructor(schema: OpenAPIV3.SchemaObject); | ||
spec(): Promise<OpenAPIV3.SchemaObject>; | ||
} |
@@ -8,10 +8,2 @@ "use strict"; | ||
class SchemaObject extends jsonpolice_1.Schema { | ||
constructor(schema) { | ||
super(); | ||
//getMeta(schema); // throws if schema is not annotated; // TODO should I stay or should I go | ||
this._spec = Promise.resolve(schema); | ||
} | ||
spec() { | ||
return this._spec; | ||
} | ||
get validators() { | ||
@@ -162,2 +154,12 @@ if (!this._validators) { | ||
exports.SchemaObject = SchemaObject; | ||
class StaticSchemaObject extends SchemaObject { | ||
constructor(schema) { | ||
super(); | ||
this._spec = schema; | ||
} | ||
spec() { | ||
return Promise.resolve(this._spec); | ||
} | ||
} | ||
exports.StaticSchemaObject = StaticSchemaObject; | ||
//# sourceMappingURL=schema-object.js.map |
{ | ||
"name": "openapi-police", | ||
"version": "1.0.11", | ||
"version": "1.1.0", | ||
"description": "OpenAPI v3 validators and utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30184
784