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

@ts-rest/open-api

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-rest/open-api - npm Package Compare versions

Comparing version 3.9.0 to 3.10.0

64

index.js

@@ -62,13 +62,24 @@ import { isAppRoute, isZodObject } from '@ts-rest/core';

const responseSchema = getJsonSchemaFromZod(path.route.responses[keyAsNumber]);
return Object.assign(Object.assign({}, acc), { [keyAsNumber]: Object.assign({ description: `${keyAsNumber}` }, (responseSchema
? {
content: {
'application/json': {
schema: responseSchema,
return {
...acc,
[keyAsNumber]: {
description: `${keyAsNumber}`,
...(responseSchema
? {
content: {
'application/json': {
schema: responseSchema,
},
},
},
}
: {})) });
}
: {}),
},
};
}, {});
const newPath = Object.assign(Object.assign(Object.assign({ description: path.route.description, summary: path.route.summary, deprecated: path.route.deprecated, tags: path.paths, parameters: [
const newPath = {
description: path.route.description,
summary: path.route.summary,
deprecated: path.route.deprecated,
tags: path.paths,
parameters: [
...(paramsFromPath

@@ -90,20 +101,31 @@ ? paramsFromPath.map((param) => ({

: []),
] }, (options.setOperationId ? { operationId: path.id } : {})), (bodySchema
? {
requestBody: {
description: 'Body',
content: {
'application/json': {
schema: bodySchema,
],
...(options.setOperationId ? { operationId: path.id } : {}),
...(bodySchema
? {
requestBody: {
description: 'Body',
content: {
'application/json': {
schema: bodySchema,
},
},
},
},
}
: {})), { responses });
acc[path.path] = Object.assign(Object.assign({}, acc[path.path]), { [mapMethod[path.route.method]]: newPath });
}
: {}),
responses,
};
acc[path.path] = {
...acc[path.path],
[mapMethod[path.route.method]]: newPath,
};
return acc;
}, {});
return Object.assign({ openapi: '3.0.0', paths: pathObject }, apiDoc);
return {
openapi: '3.0.0',
paths: pathObject,
...apiDoc,
};
};
export { generateOpenApi };
{
"name": "@ts-rest/open-api",
"version": "3.9.0",
"version": "3.10.0",
"peerDependenciesMeta": {

@@ -17,3 +17,3 @@ "zod": {

"zod-to-json-schema": "^3.x.x",
"@ts-rest/core": "3.9.0"
"@ts-rest/core": "3.10.0"
},

@@ -20,0 +20,0 @@ "module": "./index.js",

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