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

@seriousme/openapi-schema-validator

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seriousme/openapi-schema-validator - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

test/realworld/reportFromJson.js

5

CHANGELOG.md

@@ -6,2 +6,7 @@ # Changelog

## [v2.1.4] 13-11-2023
### Changed
- fix: recursive refs work during validation as well
- fix: update index.d.ts to include single string errors on validate
## [v2.1.3] 12-11-2023

@@ -8,0 +13,0 @@ ### Changed

2

index.d.ts

@@ -10,3 +10,3 @@ import { ErrorObject, Options } from "ajv";

valid: boolean;
errors?: ErrorObject[];
errors?: ErrorObject[] | string;
}>;

@@ -13,0 +13,0 @@ addSpecRef(schema: object | string, uri: string): void;

{
"name": "@seriousme/openapi-schema-validator",
"version": "2.1.3",
"version": "2.1.4",
"description": "Validate OpenApi specifications against their JSON schema",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -24,3 +24,5 @@ function escapeJsonPointer(str) {

const err = new Error(
`Can't resolve ${uri}, only internal refs are supported.`,
`Can't resolve ${uri}${
prefix ? ", only internal refs are supported." : ""
}`,
);

@@ -77,2 +79,6 @@

if (replace === false) {
treeObj = structuredClone(tree);
}
const pointers = {};

@@ -150,6 +156,3 @@ for (const word of pointerWords) {

const fullRef = decodedRef[0] !== "#" ? decodedRef : `${id}${decodedRef}`;
const uri = resolveUri(fullRef, anchors);
if (replace) {
applyRef(path, uri);
}
applyRef(path, resolveUri(fullRef, anchors));
}

@@ -162,5 +165,3 @@

}
if (replace) {
applyRef(path, dynamicAnchors[ref]);
}
applyRef(path, dynamicAnchors[ref]);
}

@@ -167,0 +168,0 @@

@@ -10,2 +10,7 @@ function escapeMarkDown(string) {

function processSingleError(error) {
return `
Validation error: ${error}`;
}
function processErrors(errors) {

@@ -88,3 +93,7 @@ const data = {};

API updated: ${item.updated}
${processErrors(item.result.errors)}
${
typeof item.result.errors === "string"
? processSingleError(item.result.errors)
: processErrors(item.result.errors)
}
`,

@@ -91,0 +100,0 @@ )

{
"testDate": "2023-03-21T17:54:53.939Z",
"totalApiCount": 2508,
"testedAPICount": 8,
"failedAPICount": 8,
"knownFailedCount": 7,
"testDate": "2023-11-12T14:31:20.650Z",
"totalApiCount": 2529,
"testedAPICount": 2529,
"failedAPICount": 30,
"knownFailedCount": 8,
"failedTests": [

@@ -147,2 +147,210 @@ {

{
"name": "appwrite.io:client",
"apiVersion": "0.9.3",
"openApiVersion": "3.0.0",
"yamlUrl": "https://api.apis.guru/v2/specs/appwrite.io/client/0.9.3/openapi.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/appwrite.io/client/0.9.3/openapi.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/appwrite.io/client/0.9.3/openapi.yaml",
"updated": "2021-08-12T15:35:25.275Z",
"result": {
"valid": false,
"errors": "$id : '[object Object]' defined more than once at #/components/schemas/document/properties"
},
"validatorVersion": "3.0",
"specificationType": "openapi",
"specificationVersion": "3.0.0"
},
{
"name": "appwrite.io:server",
"apiVersion": "0.9.3",
"openApiVersion": "3.0.0",
"yamlUrl": "https://api.apis.guru/v2/specs/appwrite.io/server/0.9.3/openapi.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/appwrite.io/server/0.9.3/openapi.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/appwrite.io/server/0.9.3/openapi.yaml",
"updated": "2021-08-12T15:35:06.475Z",
"result": {
"valid": false,
"errors": "$id : '[object Object]' defined more than once at #/components/schemas/document/properties"
},
"validatorVersion": "3.0",
"specificationType": "openapi",
"specificationVersion": "3.0.0"
},
{
"name": "azure.com:network-interfaceEndpoint",
"apiVersion": "2019-02-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-interfaceEndpoint/2019-02-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-interfaceEndpoint/2019-02-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-interfaceEndpoint/2019-02-01/swagger.yaml",
"updated": "2018-11-20T14:36:34.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./networkInterface.json#/definitions/NetworkInterface, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-loadBalancer",
"apiVersion": "2019-08-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-loadBalancer/2019-08-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-loadBalancer/2019-08-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-loadBalancer/2019-08-01/swagger.yaml",
"updated": "2019-02-26T08:40:59.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./networkInterface.json#/definitions/NetworkInterfaceIPConfiguration, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-networkInterface",
"apiVersion": "2018-01-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-networkInterface/2018-01-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-networkInterface/2018-01-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-networkInterface/2018-01-01/swagger.yaml",
"updated": "2018-03-10T09:23:51.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./applicationGateway.json#/definitions/ApplicationGatewayBackendAddressPool, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-networkProfile",
"apiVersion": "2019-08-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-networkProfile/2019-08-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-networkProfile/2019-08-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-networkProfile/2019-08-01/swagger.yaml",
"updated": "2018-11-20T14:36:34.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./virtualNetwork.json#/definitions/Subnet, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-networkSecurityGroup",
"apiVersion": "2019-08-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-networkSecurityGroup/2019-08-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-networkSecurityGroup/2019-08-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-networkSecurityGroup/2019-08-01/swagger.yaml",
"updated": "2018-11-20T14:36:34.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./networkInterface.json#/definitions/NetworkInterface, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-privateEndpoint",
"apiVersion": "2019-08-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-privateEndpoint/2019-08-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-privateEndpoint/2019-08-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-privateEndpoint/2019-08-01/swagger.yaml",
"updated": "2019-07-25T10:27:32.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./networkInterface.json#/definitions/NetworkInterface, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-publicIpAddress",
"apiVersion": "2019-08-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-publicIpAddress/2019-08-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-publicIpAddress/2019-08-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-publicIpAddress/2019-08-01/swagger.yaml",
"updated": "2018-03-10T09:23:51.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./networkInterface.json#/definitions/IPConfiguration, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-routeTable",
"apiVersion": "2019-08-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-routeTable/2019-08-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-routeTable/2019-08-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-routeTable/2019-08-01/swagger.yaml",
"updated": "2018-03-10T09:23:51.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./virtualNetwork.json#/definitions/Subnet, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-serviceEndpointPolicy",
"apiVersion": "2019-08-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-serviceEndpointPolicy/2019-08-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-serviceEndpointPolicy/2019-08-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-serviceEndpointPolicy/2019-08-01/swagger.yaml",
"updated": "2018-11-20T14:36:34.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./virtualNetwork.json#/definitions/Subnet, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-virtualNetwork",
"apiVersion": "2019-08-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-virtualNetwork/2019-08-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-virtualNetwork/2019-08-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-virtualNetwork/2019-08-01/swagger.yaml",
"updated": "2018-11-20T14:36:34.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./networkProfile.json#/definitions/IPConfigurationProfile, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:network-virtualNetworkTap",
"apiVersion": "2019-08-01",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/azure.com/network-virtualNetworkTap/2019-08-01/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/azure.com/network-virtualNetworkTap/2019-08-01/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-virtualNetworkTap/2019-08-01/swagger.yaml",
"updated": "2018-11-20T14:36:34.000Z",
"result": {
"valid": false,
"errors": "Can't resolve ./loadBalancer.json#/definitions/FrontendIPConfiguration, only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "azure.com:servicebus",

@@ -208,5 +416,37 @@ "apiVersion": "2017-04-01",

{
"name": "box.com",
"apiVersion": "2.0.0",
"openApiVersion": "3.0.2",
"yamlUrl": "https://api.apis.guru/v2/specs/box.com/2.0.0/openapi.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/box.com/2.0.0/openapi.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/box.com/2.0.0/openapi.yaml",
"updated": "2023-03-06T07:12:59.965Z",
"result": {
"valid": false,
"errors": "$id : '01234500-12f1-1234-aa12-b1d234cb567e' defined more than once at #/components/schemas/File--Full/allOf/1/properties/metadata/allOf/0/example/enterprise_27335/marketingCollateral"
},
"validatorVersion": "3.0",
"specificationType": "openapi",
"specificationVersion": "3.0.2"
},
{
"name": "cloud-elements.com:ecwid",
"apiVersion": "api-v2",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/cloud-elements.com/ecwid/api-v2/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/cloud-elements.com/ecwid/api-v2/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/cloud-elements.com/ecwid/api-v2/swagger.yaml",
"updated": "2021-06-21T12:16:53.715Z",
"result": {
"valid": false,
"errors": "Can't resolve [object Object], only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "discourse.local",
"apiVersion": "latest",
"openApiVersion": "3.0.3",
"openApiVersion": "3.1.0",
"yamlUrl": "https://api.apis.guru/v2/specs/discourse.local/latest/openapi.yaml",

@@ -235,3 +475,4 @@ "jsonUrl": "https://api.apis.guru/v2/specs/discourse.local/latest/openapi.json",

"specificationType": "openapi",
"specificationVersion": "3.1.0"
"specificationVersion": "3.1.0",
"knownFailed": true
},

@@ -363,2 +604,82 @@ {

{
"name": "github.com:ghes-3.6",
"apiVersion": "1.1.4",
"openApiVersion": "3.0.3",
"yamlUrl": "https://api.apis.guru/v2/specs/github.com/ghes-3.6/1.1.4/openapi.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/github.com/ghes-3.6/1.1.4/openapi.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/github.com/ghes-3.6/1.1.4/openapi.yaml",
"updated": "2023-02-15T18:23:37.750Z",
"result": {
"valid": false,
"errors": "Can't resolve [object Object], only internal refs are supported."
},
"validatorVersion": "3.0",
"specificationType": "openapi",
"specificationVersion": "3.0.3"
},
{
"name": "github.com:ghes-3.7",
"apiVersion": "1.1.4",
"openApiVersion": "3.0.3",
"yamlUrl": "https://api.apis.guru/v2/specs/github.com/ghes-3.7/1.1.4/openapi.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/github.com/ghes-3.7/1.1.4/openapi.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/github.com/ghes-3.7/1.1.4/openapi.yaml",
"updated": "2023-02-15T18:23:37.750Z",
"result": {
"valid": false,
"errors": "Can't resolve [object Object], only internal refs are supported."
},
"validatorVersion": "3.0",
"specificationType": "openapi",
"specificationVersion": "3.0.3"
},
{
"name": "github.com:ghes-3.8",
"apiVersion": "1.1.4",
"openApiVersion": "3.0.3",
"yamlUrl": "https://api.apis.guru/v2/specs/github.com/ghes-3.8/1.1.4/openapi.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/github.com/ghes-3.8/1.1.4/openapi.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/github.com/ghes-3.8/1.1.4/openapi.yaml",
"updated": "2023-02-15T18:23:37.750Z",
"result": {
"valid": false,
"errors": "Can't resolve [object Object], only internal refs are supported."
},
"validatorVersion": "3.0",
"specificationType": "openapi",
"specificationVersion": "3.0.3"
},
{
"name": "googleapis.com:discovery",
"apiVersion": "v1",
"openApiVersion": "3.0.0",
"yamlUrl": "https://api.apis.guru/v2/specs/googleapis.com/discovery/v1/openapi.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/googleapis.com/discovery/v1/openapi.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/googleapis.com/discovery/v1/openapi.yaml",
"updated": "2023-04-21T23:09:23.065Z",
"result": {
"valid": false,
"errors": "Can't resolve [object Object], only internal refs are supported."
},
"validatorVersion": "3.0",
"specificationType": "openapi",
"specificationVersion": "3.0.0"
},
{
"name": "kubernetes.io",
"apiVersion": "unversioned",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/kubernetes.io/unversioned/swagger.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/kubernetes.io/unversioned/swagger.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/kubernetes.io/unversioned/swagger.yaml",
"updated": "2023-03-06T07:12:59.965Z",
"result": {
"valid": false,
"errors": "Can't resolve [object Object], only internal refs are supported."
},
"validatorVersion": "2.0",
"specificationType": "swagger",
"specificationVersion": "2.0"
},
{
"name": "linode.com",

@@ -1226,4 +1547,36 @@ "apiVersion": "4.145.0",

"knownFailed": true
},
{
"name": "spotify.com",
"apiVersion": "1.0.0",
"openApiVersion": "3.0.1",
"yamlUrl": "https://api.apis.guru/v2/specs/spotify.com/1.0.0/openapi.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/spotify.com/1.0.0/openapi.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/spotify.com/1.0.0/openapi.yaml",
"updated": "2023-02-17T17:54:09.755Z",
"result": {
"valid": false,
"errors": "Can't resolve ../policies.yaml, only internal refs are supported."
},
"validatorVersion": "3.0",
"specificationType": "openapi",
"specificationVersion": "3.0.3"
},
{
"name": "statsocial.com",
"apiVersion": "1.0.0",
"openApiVersion": "2.0",
"yamlUrl": "https://api.apis.guru/v2/specs/statsocial.com/1.0.0/openapi.yaml",
"jsonUrl": "https://api.apis.guru/v2/specs/statsocial.com/1.0.0/openapi.json",
"gitHubUrl": "https://github.com/APIs-guru/openapi-directory/blob/main/APIs/statsocial.com/1.0.0/openapi.yaml",
"updated": "2023-02-17T17:36:25.370Z",
"result": {
"valid": false,
"errors": "Can't resolve #/components/schemas/18_24"
},
"validatorVersion": "3.0",
"specificationType": "openapi",
"specificationVersion": "3.0.0"
}
]
}
# Results of real world testing
Report generated at: Tue Mar 21 2023 18:54:53 GMT+0100 (Central European Standard Time)
Report generated at: Sun Nov 12 2023 14:31:20 GMT+0000 (Coordinated Universal Time)
| APIs at [apis.guru](https://apis.guru) | #
|--------|-------|
|Total |2508
|Tested |8
|Failed validation | 8
|Total |2529
|Tested |2529
|Failed validation | 30

@@ -58,2 +58,132 @@

## API: appwrite\.io:client (version: 0.9.3)
openapi: [3.0.0](https://spec.openapis.org/oas/v3.0.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v3.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/appwrite.io/client/0.9.3/openapi.yaml)
API updated: 2021-08-12T15:35:25.275Z
Validation error: $id : '[object Object]' defined more than once at #/components/schemas/document/properties
## API: appwrite\.io:server (version: 0.9.3)
openapi: [3.0.0](https://spec.openapis.org/oas/v3.0.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v3.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/appwrite.io/server/0.9.3/openapi.yaml)
API updated: 2021-08-12T15:35:06.475Z
Validation error: $id : '[object Object]' defined more than once at #/components/schemas/document/properties
## API: azure\.com:network-interfaceEndpoint (version: 2019-02-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-interfaceEndpoint/2019-02-01/swagger.yaml)
API updated: 2018-11-20T14:36:34.000Z
Validation error: Can't resolve ./networkInterface.json#/definitions/NetworkInterface, only internal refs are supported.
## API: azure\.com:network-loadBalancer (version: 2019-08-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-loadBalancer/2019-08-01/swagger.yaml)
API updated: 2019-02-26T08:40:59.000Z
Validation error: Can't resolve ./networkInterface.json#/definitions/NetworkInterfaceIPConfiguration, only internal refs are supported.
## API: azure\.com:network-networkInterface (version: 2018-01-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-networkInterface/2018-01-01/swagger.yaml)
API updated: 2018-03-10T09:23:51.000Z
Validation error: Can't resolve ./applicationGateway.json#/definitions/ApplicationGatewayBackendAddressPool, only internal refs are supported.
## API: azure\.com:network-networkProfile (version: 2019-08-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-networkProfile/2019-08-01/swagger.yaml)
API updated: 2018-11-20T14:36:34.000Z
Validation error: Can't resolve ./virtualNetwork.json#/definitions/Subnet, only internal refs are supported.
## API: azure\.com:network-networkSecurityGroup (version: 2019-08-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-networkSecurityGroup/2019-08-01/swagger.yaml)
API updated: 2018-11-20T14:36:34.000Z
Validation error: Can't resolve ./networkInterface.json#/definitions/NetworkInterface, only internal refs are supported.
## API: azure\.com:network-privateEndpoint (version: 2019-08-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-privateEndpoint/2019-08-01/swagger.yaml)
API updated: 2019-07-25T10:27:32.000Z
Validation error: Can't resolve ./networkInterface.json#/definitions/NetworkInterface, only internal refs are supported.
## API: azure\.com:network-publicIpAddress (version: 2019-08-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-publicIpAddress/2019-08-01/swagger.yaml)
API updated: 2018-03-10T09:23:51.000Z
Validation error: Can't resolve ./networkInterface.json#/definitions/IPConfiguration, only internal refs are supported.
## API: azure\.com:network-routeTable (version: 2019-08-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-routeTable/2019-08-01/swagger.yaml)
API updated: 2018-03-10T09:23:51.000Z
Validation error: Can't resolve ./virtualNetwork.json#/definitions/Subnet, only internal refs are supported.
## API: azure\.com:network-serviceEndpointPolicy (version: 2019-08-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-serviceEndpointPolicy/2019-08-01/swagger.yaml)
API updated: 2018-11-20T14:36:34.000Z
Validation error: Can't resolve ./virtualNetwork.json#/definitions/Subnet, only internal refs are supported.
## API: azure\.com:network-virtualNetwork (version: 2019-08-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-virtualNetwork/2019-08-01/swagger.yaml)
API updated: 2018-11-20T14:36:34.000Z
Validation error: Can't resolve ./networkProfile.json#/definitions/IPConfigurationProfile, only internal refs are supported.
## API: azure\.com:network-virtualNetworkTap (version: 2019-08-01)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/azure.com/network-virtualNetworkTap/2019-08-01/swagger.yaml)
API updated: 2018-11-20T14:36:34.000Z
Validation error: Can't resolve ./loadBalancer.json#/definitions/FrontendIPConfiguration, only internal refs are supported.
## API: azure\.com:servicebus (version: 2017-04-01)

@@ -107,2 +237,22 @@ swagger: [2.0](https://spec.openapis.org/oas/v2.0)

## API: box\.com (version: 2.0.0)
openapi: [3.0.2](https://spec.openapis.org/oas/v3.0.2)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v3.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/box.com/2.0.0/openapi.yaml)
API updated: 2023-03-06T07:12:59.965Z
Validation error: $id : '01234500-12f1-1234-aa12-b1d234cb567e' defined more than once at #/components/schemas/File--Full/allOf/1/properties/metadata/allOf/0/example/enterprise_27335/marketingCollateral
## API: cloud-elements\.com:ecwid (version: api-v2)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/cloud-elements.com/ecwid/api-v2/swagger.yaml)
API updated: 2021-06-21T12:16:53.715Z
Validation error: Can't resolve [object Object], only internal refs are supported.
## API: discourse\.local (version: latest)

@@ -209,2 +359,52 @@ openapi: [3.1.0](https://spec.openapis.org/oas/v3.1.0)

## API: github\.com:ghes-3\.6 (version: 1.1.4)
openapi: [3.0.3](https://spec.openapis.org/oas/v3.0.3)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v3.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/github.com/ghes-3.6/1.1.4/openapi.yaml)
API updated: 2023-02-15T18:23:37.750Z
Validation error: Can't resolve [object Object], only internal refs are supported.
## API: github\.com:ghes-3\.7 (version: 1.1.4)
openapi: [3.0.3](https://spec.openapis.org/oas/v3.0.3)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v3.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/github.com/ghes-3.7/1.1.4/openapi.yaml)
API updated: 2023-02-15T18:23:37.750Z
Validation error: Can't resolve [object Object], only internal refs are supported.
## API: github\.com:ghes-3\.8 (version: 1.1.4)
openapi: [3.0.3](https://spec.openapis.org/oas/v3.0.3)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v3.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/github.com/ghes-3.8/1.1.4/openapi.yaml)
API updated: 2023-02-15T18:23:37.750Z
Validation error: Can't resolve [object Object], only internal refs are supported.
## API: googleapis\.com:discovery (version: v1)
openapi: [3.0.0](https://spec.openapis.org/oas/v3.0.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v3.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/googleapis.com/discovery/v1/openapi.yaml)
API updated: 2023-04-21T23:09:23.065Z
Validation error: Can't resolve [object Object], only internal refs are supported.
## API: kubernetes\.io (version: unversioned)
swagger: [2.0](https://spec.openapis.org/oas/v2.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v2.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/kubernetes.io/unversioned/swagger.yaml)
API updated: 2023-03-06T07:12:59.965Z
Validation error: Can't resolve [object Object], only internal refs are supported.
## API: linode\.com (version: 4.145.0)

@@ -639,2 +839,22 @@ openapi: [3.0.1](https://spec.openapis.org/oas/v3.0.1)

## API: spotify\.com (version: 1.0.0)
openapi: [3.0.3](https://spec.openapis.org/oas/v3.0.3)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v3.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/spotify.com/1.0.0/openapi.yaml)
API updated: 2023-02-17T17:54:09.755Z
Validation error: Can't resolve ../policies.yaml, only internal refs are supported.
## API: statsocial\.com (version: 1.0.0)
openapi: [3.0.0](https://spec.openapis.org/oas/v3.0.0)
[JSON Schema](https://github.com/seriousme/openapi-schema-validator/tree/master/schemas/v3.0/schema.json)
API on Github: [link](https://github.com/APIs-guru/openapi-directory/blob/main/APIs/statsocial.com/1.0.0/openapi.yaml)
API updated: 2023-02-17T17:36:25.370Z
Validation error: Can't resolve #/components/schemas/18_24

@@ -209,11 +209,13 @@ // test the validator against the APIs of https://apis.guru

results.invalid++;
api.result.errors.map((item) => {
const [res, value] = getInstanceValue(spec, item.instancePath);
item.hasInstanceValue = res;
item.instanceValue = value;
item.gitHubUrl = `${api.gitHubUrl}#L${yamlLine(
spec,
item.instancePath,
)}`;
});
if (typeof api.result.errors === "object") {
api.result.errors.map((item) => {
const [res, value] = getInstanceValue(spec, item.instancePath);
item.hasInstanceValue = res;
item.instanceValue = value;
item.gitHubUrl = `${api.gitHubUrl}#L${yamlLine(
spec,
item.instancePath,
)}`;
});
}
if (failedMap.has(name)) {

@@ -220,0 +222,0 @@ const failedApiErrors = JSON.stringify(

@@ -11,2 +11,3 @@ import { strict as assert } from "node:assert/strict";

const invalidRefsSpec = localFile("./validation/invalid-refs.yaml");
const recursiveRefsSpec = localFile("./validation/openapi-recursive.v3.json");

@@ -19,5 +20,11 @@ test("invalid refs in YAML fail validation", async (t) => {

res.errors,
"Can't resolve #/components/schemas/nonExisting1, only internal refs are supported.",
"Can't resolve #/components/schemas/nonExisting1",
"correct error message",
);
});
test("recursive refs pass validation", async (t) => {
const validator = new Validator();
const res = await validator.validate(recursiveRefsSpec);
assert.equal(res.valid, true, "validation succeeds");
});

@@ -29,2 +29,3 @@ import { readFileSync } from "fs";

const petStoreSpec = importJSON(`./v${version}/petstore.json`);
const copyPetStoreSpec = structuredClone(petStoreSpec);
const validator = new Validator();

@@ -40,2 +41,7 @@

);
assert.deepEqual(
petStoreSpec,
copyPetStoreSpec,
"original petstore spec is not modified",
);
});

@@ -42,0 +48,0 @@ }

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