Socket
Socket
Sign inDemoInstall

openapi3-ts

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi3-ts - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

dist/dsl/OpenApiBuilder.d.ts
import * as oa from "../model";
export declare class OpenApiBuilder {
rootDoc: oa.OpenAPIObject;
static create(): OpenApiBuilder;
constructor();
static create(doc?: oa.OpenAPIObject): OpenApiBuilder;
constructor(doc?: oa.OpenAPIObject);
getSpec(): oa.OpenAPIObject;

@@ -7,0 +7,0 @@ getSpecAsJson(replacer?: (key: string, value: any) => any, space?: string | number): string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class OpenApiBuilder {
static create() {
return new OpenApiBuilder();
static create(doc) {
return new OpenApiBuilder(doc);
}
constructor() {
this.rootDoc = {
constructor(doc) {
this.rootDoc = doc || {
openapi: "3.0.0",

@@ -10,0 +10,0 @@ info: {

{
"name": "openapi3-ts",
"version": "1.0.1",
"version": "1.0.2",
"description": "TS Model & utils for OpenAPI 3.0.x specification.",

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

@@ -30,2 +30,26 @@ import "mocha";

});
it("Build with custom object", () => {
const obj: oa.OpenAPIObject = {
openapi: "3.0.0",
info: {
title: "app1",
version: "version2"
},
paths: {},
components: {
schemas: {},
responses: {},
parameters: {},
examples: {},
requestBodies: {},
headers: {},
securitySchemes: {},
links: {},
callbacks: {}
},
tags: [],
servers: []
};
expect(OpenApiBuilder.create(obj).getSpec()).eql(obj);
});
it("addTitle", () => {

@@ -32,0 +56,0 @@ let sut = OpenApiBuilder.create().addTitle("app7").rootDoc;

@@ -9,8 +9,8 @@ import * as oa from "../model";

static create(): OpenApiBuilder {
return new OpenApiBuilder();
static create(doc?: oa.OpenAPIObject): OpenApiBuilder {
return new OpenApiBuilder(doc);
}
constructor() {
this.rootDoc = {
constructor(doc?: oa.OpenAPIObject) {
this.rootDoc = doc || {
openapi: "3.0.0",

@@ -17,0 +17,0 @@ info: {

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