Skip to content

Commit

Permalink
Merge branch 'master' of github.com:metadevpro/openapi3-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pjmolina committed Dec 20, 2023
2 parents 5e385aa + 9ab6d8b commit 4ec7b43
Show file tree
Hide file tree
Showing 7 changed files with 1,309 additions and 1,473 deletions.
2,739 changes: 1,275 additions & 1,464 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"rimraf": "^5.0.5",
"typescript": "~5.3.3",
"vite": "^5.0.10",
"vitest": "^1.1.0",
"vitest": "^0.34.6",
"vitest-teamcity-reporter": "^0.2.1"
}
}
2 changes: 1 addition & 1 deletion src/model/openapi30.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export interface SchemaObject extends ISpecificationExtension {
xml?: XmlObject;
externalDocs?: ExternalDocumentationObject;
example?: any;
examples?: any[];
examples?: ExamplesObject;
deprecated?: boolean;

type?: SchemaObjectType | SchemaObjectType[];
Expand Down
17 changes: 16 additions & 1 deletion src/model/openapi31.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface ContactObject extends ISpecificationExtension {
}
export interface LicenseObject extends ISpecificationExtension {
name: string;
identifier?: string;
url?: string;
}

Expand Down Expand Up @@ -271,7 +272,7 @@ export interface SchemaObject extends ISpecificationExtension {
externalDocs?: ExternalDocumentationObject;
/** @deprecated use examples instead */
example?: any;
examples?: any[];
examples?: ExamplesObject;
deprecated?: boolean;

type?: SchemaObjectType | SchemaObjectType[];
Expand All @@ -293,6 +294,7 @@ export interface SchemaObject extends ISpecificationExtension {
items?: SchemaObject | ReferenceObject;
properties?: { [propertyName: string]: SchemaObject | ReferenceObject };
additionalProperties?: SchemaObject | ReferenceObject | boolean;
propertyNames?: SchemaObject | ReferenceObject;
description?: string;
default?: any;

Expand All @@ -315,6 +317,19 @@ export interface SchemaObject extends ISpecificationExtension {
required?: string[];
enum?: any[];
prefixItems?: (SchemaObject | ReferenceObject)[];
/**
* @desc JSON Schema compliant Content-Type, optional when specified as a key of ContentObject
* @example image/png
*/
contentMediaType?: string;
/**
* @desc Specifies the Content-Encoding for the schema, supports all encodings from RFC4648, and "quoted-printable" from RFC2045
* @override format
* @see https://datatracker.ietf.org/doc/html/rfc4648
* @see https://datatracker.ietf.org/doc/html/rfc2045#section-6.7
* @example base64
*/
contentEncoding?: string;
}

/**
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions test/index.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import assert from 'node:assert';
import { oas31 } from 'openapi3-ts';
import { OpenApiBuilder } from 'openapi3-ts/oas31';

const builder1 = new oas31.OpenApiBuilder();
assert.ok(typeof builder1.rootDoc === 'object');
const builder2 = new OpenApiBuilder();
assert.ok(typeof builder2.rootDoc === 'object');
14 changes: 8 additions & 6 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"scripts": {
"test:cjs": "node index.cjs",
"test:mjs": "node index.mjs",
"test:ts": "ts-node --project fixture/tsconfig.node.json index.ts",
"test:ts-esm": "ts-node --esm --project fixture/tsconfig.node.json index.ts",
"test:ts-node16": "ts-node --project fixture/tsconfig.node16.json index.ts",
"test:ts-esm-node16": "ts-node --esm --project fixture/tsconfig.node16.json index.ts"
"test:ts": "tsx --tsconfig fixture/tsconfig.node.json index.cts",
"test:ts-esm": "tsx --tsconfig fixture/tsconfig.node.json index.mts",
"test:ts-node16": "tsx --tsconfig fixture/tsconfig.node16.json index.cts",
"test:ts-esm-node16": "tsx --tsconfig fixture/tsconfig.node16.json index.mts"
},
"dependencies": {
"openapi3-ts": "file:..",
"ts-node": "^10.9.1"
"openapi3-ts": "file:.."
},
"devDependencies": {
"tsx": "^4.6.2"
}
}

0 comments on commit 4ec7b43

Please sign in to comment.