openapi3-ts
Advanced tools
Comparing version 2.0.1 to 2.0.2
# Changelog: openapi3-ts | ||
## Version 2.0.2 | ||
2022.02.17 | ||
- Updated libs | ||
## Version 2.0.1 | ||
@@ -4,0 +10,0 @@ |
@@ -7,3 +7,3 @@ import * as oa from '../model'; | ||
getSpec(): oa.OpenAPIObject; | ||
getSpecAsJson(replacer?: (key: string, value: any) => any, space?: string | number): string; | ||
getSpecAsJson(replacer?: (key: string, value: unknown) => unknown, space?: string | number): string; | ||
getSpecAsYaml(): string; | ||
@@ -10,0 +10,0 @@ private static isValidOpenApiVersion; |
@@ -25,9 +25,9 @@ "use strict"; | ||
function isReferenceObject(obj) { | ||
return obj.hasOwnProperty('$ref'); | ||
return Object.prototype.hasOwnProperty.call(obj, '$ref'); | ||
} | ||
exports.isReferenceObject = isReferenceObject; | ||
function isSchemaObject(schema) { | ||
return !schema.hasOwnProperty('$ref'); | ||
return !Object.prototype.hasOwnProperty.call(schema, '$ref'); | ||
} | ||
exports.isSchemaObject = isSchemaObject; | ||
//# sourceMappingURL=OpenApi.js.map |
@@ -15,3 +15,3 @@ import * as oa from './OpenApi'; | ||
description?: string; | ||
constructor(defaultValue: any, enums?: any, description?: string); | ||
constructor(defaultValue: string | boolean | number, enums?: string[] | boolean[] | number[], description?: string); | ||
} |
@@ -5,3 +5,3 @@ "use strict"; | ||
static isValidExtension(extensionName) { | ||
return /^x\-/.test(extensionName); | ||
return /^x-/.test(extensionName); | ||
} | ||
@@ -26,3 +26,3 @@ getExtension(extensionName) { | ||
for (const propName in this) { | ||
if (this.hasOwnProperty(propName)) { | ||
if (Object.prototype.hasOwnProperty.call(this, propName)) { | ||
if (SpecificationExtension.isValidExtension(propName)) { | ||
@@ -29,0 +29,0 @@ res.push(propName); |
{ | ||
"name": "openapi3-ts", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "TS Model & utils for OpenAPI 3.x specification.", | ||
@@ -15,8 +15,8 @@ "main": "dist/index.js", | ||
"build:w": "tsc -p tsconfig.json -w", | ||
"lint": "eslint src/**/*.ts --quiet", | ||
"lint:fix": "eslint src/**/*.ts --quiet --fix", | ||
"lint": "eslint src/**/*.ts", | ||
"lint:fix": "eslint src/**/*.ts --fix", | ||
"prepare": "npm run build", | ||
"test:tdd": "mocha --recursive --reporter min --require ts-node/register --require source-map-support/register \"src/**/*.spec.ts\" --watch", | ||
"test": "mocha --recursive --require ts-node/register --require source-map-support/register \"src/**/*.spec.ts\"", | ||
"test:ci": "mocha --recursive --require ts-node/register --require source-map-support/register --reporter mocha-teamcity-reporter \"src/**/*.spec.ts\"", | ||
"test:tdd": "mocha --recursive --reporter min -r ts-node/register -r source-map-support/register \"src/**/*.spec.ts\" --watch", | ||
"test": "set TS_NODE_COMPILER_OPTIONS={\"module\": \"commonjs\" } && mocha --recursive -r ts-node/register -r source-map-support/register \"src/**/*.spec.ts\"", | ||
"test:ci": "mocha --recursive -r ts-node/register -r source-map-support/register --reporter mocha-teamcity-reporter \"src/**/*.spec.ts\"", | ||
"cover:ci": "nyc --reporter teamcity --reporter html --reporter json --reporter text npm run test:ci", | ||
@@ -57,23 +57,22 @@ "cover": "nyc npm test" | ||
"dependencies": { | ||
"yaml": "^1.10.0" | ||
"yaml": "^1.10.2" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.2.14", | ||
"@types/mocha": "~8.2.0", | ||
"@types/node": "^14.14.17", | ||
"@typescript-eslint/eslint-plugin": "^4.11.1", | ||
"@typescript-eslint/parser": "^4.11.1", | ||
"chai": "^4.2.0", | ||
"coveralls": "^3.1.0", | ||
"eslint": "^7.16.0", | ||
"eslint-config-prettier": "^7.1.0", | ||
"eslint-plugin-prettier": "^3.3.0", | ||
"mocha": "~8.2.1", | ||
"mocha-teamcity-reporter": "^3.0.0", | ||
"@types/mocha": "9.1.0", | ||
"@types/node": "16.6.2", | ||
"@typescript-eslint/eslint-plugin": "^5.12.0", | ||
"@typescript-eslint/parser": "^5.12.0", | ||
"chai": "^4.3.6", | ||
"coveralls": "^3.1.1", | ||
"eslint": "^8.9.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"mocha": "~9.2.0", | ||
"mocha-teamcity-reporter": "^4.2.0", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.2.1", | ||
"prettier": "^2.5.1", | ||
"rimraf": "^3.0.2", | ||
"ts-node": "^9.1.1", | ||
"ts-node": "^10.5.0", | ||
"typescript": "3.6.5" | ||
} | ||
} |
@@ -41,2 +41,2 @@ # OpenApi3-TS | ||
(c) 2017-2020. [Pedro J. Molina](http://pjmolina.com) at Metadev S.L. [https://metadev.pro](https://metadev.pro) & contributors. | ||
(c) 2017-2022. [Pedro J. Molina](http://pjmolina.com) at Metadev S.L. [https://metadev.pro](https://metadev.pro) & contributors. |
@@ -0,3 +1,3 @@ | ||
import * as yaml from 'yaml'; | ||
import * as oa from '../model'; | ||
import * as yaml from 'yaml'; | ||
@@ -41,3 +41,3 @@ // Internal DSL for building an OpenAPI 3.0.x contract | ||
} | ||
getSpecAsJson(replacer?: (key: string, value: any) => any, space?: string | number): string { | ||
getSpecAsJson(replacer?: (key: string, value: unknown) => unknown, space?: string | number): string { | ||
return JSON.stringify(this.rootDoc, replacer, space); | ||
@@ -44,0 +44,0 @@ } |
@@ -0,6 +1,6 @@ | ||
import { expect } from 'chai'; | ||
import 'mocha'; | ||
import { expect } from 'chai'; | ||
import { OpenApiBuilder, Server, ServerVariable } from '.'; | ||
describe('Top barrel', () => { | ||
@@ -16,5 +16,5 @@ it('OpenApiBuilder is exported', () => { | ||
it('ServerVariable is exported', () => { | ||
const sut = new ServerVariable('a', 'b', 'c'); | ||
const sut = new ServerVariable('a', ['b'], 'c'); | ||
expect(sut).not.null; | ||
}); | ||
}); |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
// Typed interfaces for OpenAPI 3.0.0-RC | ||
@@ -264,3 +265,3 @@ // see https://github.com/OAI/OpenAPI-Specification/blob/3.0.0-rc0/versions/3.0.md | ||
export function isReferenceObject(obj: any): obj is ReferenceObject { | ||
return obj.hasOwnProperty('$ref'); | ||
return Object.prototype.hasOwnProperty.call(obj, '$ref'); | ||
} | ||
@@ -329,3 +330,3 @@ | ||
export function isSchemaObject(schema: SchemaObject | ReferenceObject): schema is SchemaObject { | ||
return !schema.hasOwnProperty('$ref'); | ||
return !Object.prototype.hasOwnProperty.call(schema, '$ref'); | ||
} | ||
@@ -332,0 +333,0 @@ |
@@ -0,5 +1,4 @@ | ||
import { expect } from 'chai'; | ||
import 'mocha'; | ||
import { expect } from 'chai'; | ||
import { Server, ServerVariable } from './Server'; | ||
import * as oa from '../model'; | ||
@@ -6,0 +5,0 @@ describe('Server', () => { |
@@ -25,3 +25,3 @@ import * as oa from './OpenApi'; | ||
constructor(defaultValue: any, enums?: any, description?: string) { | ||
constructor(defaultValue: string | boolean | number, enums?: string[] | boolean[] | number[], description?: string) { | ||
this.default = defaultValue; | ||
@@ -28,0 +28,0 @@ this.enum = enums; |
@@ -0,1 +1,3 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
// Suport for Specification Extensions | ||
@@ -17,3 +19,3 @@ // as described in | ||
static isValidExtension(extensionName: string): boolean { | ||
return /^x\-/.test(extensionName); | ||
return /^x-/.test(extensionName); | ||
} | ||
@@ -43,3 +45,3 @@ | ||
for (const propName in this) { | ||
if (this.hasOwnProperty(propName)) { | ||
if (Object.prototype.hasOwnProperty.call(this, propName)) { | ||
if (SpecificationExtension.isValidExtension(propName)) { | ||
@@ -46,0 +48,0 @@ res.push(propName); |
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"target": "ES6", | ||
"target": "es2020", | ||
"module": "commonjs", | ||
@@ -22,4 +22,4 @@ "emitDecoratorMetadata": true, | ||
"dist", | ||
"node_modules" | ||
"node_modules/**" | ||
] | ||
} |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
74727
16
1782
Updatedyaml@^1.10.2