Socket
Socket
Sign inDemoInstall

@nestjs/swagger

Package Overview
Dependencies
Maintainers
3
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs/swagger - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

9

dist/explorers/api-consumes.explorer.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
const defaultConsumes = 'application/json';
exports.exploreGlobalApiConsumesMetadata = metatype => {
const consumes = Reflect.getMetadata(constants_1.DECORATORS.API_CONSUMES, metatype);
return consumes
? { consumes }
: {
consumes: [defaultConsumes]
};
return consumes ? { consumes } : undefined;
};
exports.exploreApiConsumesMetadata = (instance, prototype, method) => {
return (Reflect.getMetadata(constants_1.DECORATORS.API_CONSUMES, method) || [defaultConsumes]);
return Reflect.getMetadata(constants_1.DECORATORS.API_CONSUMES, method);
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
const defaultProduces = 'application/json';
exports.exploreGlobalApiProducesMetadata = metatype => {
const produces = Reflect.getMetadata(constants_1.DECORATORS.API_PRODUCES, metatype);
return produces
? { produces }
: {
produces: [defaultProduces]
};
return produces ? { produces } : undefined;
};
exports.exploreApiProducesMetadata = (instance, prototype, method) => {
return (Reflect.getMetadata(constants_1.DECORATORS.API_PRODUCES, method) || [defaultProduces]);
return Reflect.getMetadata(constants_1.DECORATORS.API_PRODUCES, method);
};

@@ -14,2 +14,3 @@ import { Controller } from '@nestjs/common/interfaces';

private mergeMetadata(globalMetadata, methodMetadata);
private assignDefaultMimeType(metadata, key);
}

@@ -60,2 +60,4 @@ "use strict";

const mergedMethodMetadata = this.mergeMetadata(globalMetadata, lodash_1.omitBy(methodMetadata, lodash_1.isEmpty));
this.assignDefaultMimeType(mergedMethodMetadata, 'produces');
this.assignDefaultMimeType(mergedMethodMetadata, 'consumes');
return Object.assign({ responses: {} }, globalMetadata, mergedMethodMetadata);

@@ -116,3 +118,10 @@ });

}
assignDefaultMimeType(metadata, key) {
if (metadata[key]) {
return undefined;
}
const defaultMimeType = 'application/json';
metadata[key] = [defaultMimeType];
}
}
exports.SwaggerExplorer = SwaggerExplorer;

@@ -14,3 +14,3 @@ "use strict";

app.use(finalPath, swaggerUi.serve, swaggerUi.setup(document, options));
app.use(finalPath + '?json', (req, res) => res.json(document));
app.use(finalPath + '-json', (req, res) => res.json(document));
}

@@ -17,0 +17,0 @@ }

{
"name": "@nestjs/swagger",
"version": "1.2.3",
"version": "1.2.4",
"description":

@@ -5,0 +5,0 @@ "Nest - modern, fast, powerful node.js web framework (@swagger)",

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