@sleekify/sleekify
Version:
A TypeScript decorator driven approach for developing web applications.
25 lines (24 loc) • 948 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Consumes = void 0;
const Annotation_1 = require("./Annotation");
/**
* You may apply this decorator to your resource class or the resource class's
* methods to provide the default media type for requests. If this is present
* on both the class and a class method, then the decorator on the method will
* have higher precedence. This decorator should be used with the Schema
* decorator when your media type is not application/json. JSON is assumed to
* be the default media type.
*
* @param mediaTypes The supported media types
*/
function Consumes(mediaTypes) {
return function (target, propertyKey, _descriptor) {
Annotation_1.Annotation.set(target, propertyKey, Consumes, mediaTypes);
};
}
exports.Consumes = Consumes;
;
Annotation_1.Annotation.register(Consumes, '1ccfbf1a-0676-43e9-873f-3230ed5485c3', {
isAdditive: false
});