Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stoplight/spectral

Package Overview
Dependencies
Maintainers
10
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/spectral - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

functions/schema-path.d.ts

1

functions/index.d.ts

@@ -6,4 +6,5 @@ export declare const functions: {

schema: any;
schemaPath: any;
truthy: any;
xor: any;
};

@@ -8,2 +8,3 @@ "use strict";

schema: require('./schema').schema,
schemaPath: require('./schema-path').schemaPath,
truthy: require('./truthy').truthy,

@@ -10,0 +11,0 @@ xor: require('./xor').xor,

2

package.json
{
"name": "@stoplight/spectral",
"version": "1.1.2",
"version": "1.2.0",
"description": "A flexible object linter with out of the box support for OpenAPI v2 and v3.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -34,3 +34,3 @@ ![Spectral logo](img/spectral-banner.png)

### Creating a custom rule:
### Creating a custom rule

@@ -151,3 +151,3 @@ Spectral has a built-in set of functions which you can reference in your rules. This example uses the `RuleFunction.PATTERN` to create a rule that checks that all property values are in snake case.

### Linting an OAS 2 document:
### Linting an OAS 2 document

@@ -154,0 +154,0 @@ Spectral also includes a number of ready made rules and functions for OpenAPI Specification (OAS) 2 and 3 documents. This example uses the OAS 2 rules to lint a document.

@@ -89,3 +89,2 @@ "use strict";

'operation-security-defined': {
enabled: true,
summary: 'Operation `security` values must match a scheme defined in the `securityDefinitions` object.',

@@ -102,4 +101,16 @@ type: types_1.RuleType.VALIDATION,

},
'valid-example': {
summary: 'Examples must be valid against their defined schema.',
type: types_1.RuleType.VALIDATION,
given: '$..[?(@.example)]',
then: {
function: types_1.RuleFunction.SCHEMAPATH,
functionOptions: {
field: 'example',
schemaPath: '$',
},
},
},
});
};
//# sourceMappingURL=index.js.map

@@ -54,3 +54,2 @@ "use strict";

'operation-security-defined': {
enabled: true,
summary: 'Operation `security` values must match a scheme defined in the `components.securitySchemes` object.',

@@ -92,4 +91,16 @@ type: types_1.RuleType.VALIDATION,

},
'valid-example': {
summary: 'Examples must be valid against their defined schema.',
type: types_1.RuleType.VALIDATION,
given: '$..[?(@.example)]',
then: {
function: types_1.RuleFunction.SCHEMAPATH,
functionOptions: {
field: 'example',
schemaPath: '$',
},
},
},
});
};
//# sourceMappingURL=index.js.map

@@ -10,4 +10,5 @@ export declare enum RuleType {

SCHEMA = "schema",
SCHEMAPATH = "schemaPath",
TRUTHY = "truthy",
XOR = "xor"
}

@@ -14,2 +14,3 @@ "use strict";

RuleFunction["SCHEMA"] = "schema";
RuleFunction["SCHEMAPATH"] = "schemaPath";
RuleFunction["TRUTHY"] = "truthy";

@@ -16,0 +17,0 @@ RuleFunction["XOR"] = "xor";

@@ -47,1 +47,6 @@ import { ValidationSeverity, ValidationSeverityLabel } from '@stoplight/types/validations';

export declare type SchemaRule = IRule<RuleFunction.SCHEMA, ISchemaOptions>;
export interface ISchemaPathOptions {
schemaPath: string;
field?: string;
}
export declare type SchemaPathRule = IRule<RuleFunction.SCHEMAPATH, ISchemaPathOptions>;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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