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

@elysiajs/swagger

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elysiajs/swagger - npm Package Compare versions

Comparing version 0.8.4 to 0.8.5

14

dist/cjs/index.js

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

const relativePath = path.startsWith('/') ? path.slice(1) : path;
app.get(path, () => {
app.get(path, (() => {
const combinedSwaggerOptions = {

@@ -45,12 +45,10 @@ url: `${relativePath}/json`,

const stringifiedSwaggerOptions = JSON.stringify(combinedSwaggerOptions, (key, value) => {
if (typeof value == 'function') {
if (typeof value == 'function')
return undefined;
}
else {
return value;
}
return value;
});
const scalarConfiguration = {
spec: {
url: `${relativePath}/json`
...scalarConfig.spec,
url: `${relativePath}/json`,
},

@@ -66,3 +64,3 @@ ...scalarConfig

});
}).get(`${path}/json`, () => {
})()).get(`${path}/json`, () => {
const routes = app.routes;

@@ -69,0 +67,0 @@ if (routes.length !== totalRoutes) {

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

// @ts-ignore
required: schema.required?.includes(key) ?? false,
required: schema.required?.includes(key) ?? false
};

@@ -38,4 +38,4 @@ });

const mapTypesResponse = (types, schema) => {
if (typeof schema === 'object'
&& ['void', 'undefined', 'null'].includes(schema.type))
if (typeof schema === 'object' &&
['void', 'undefined', 'null'].includes(schema.type))
return;

@@ -98,2 +98,3 @@ const responses = {};

properties,
items: responseSchema.items,
required

@@ -123,7 +124,10 @@ }

description: rest.description,
content: mapTypesResponse(contentTypes, {
type,
properties,
required
})
content: mapTypesResponse(contentTypes, rest.type === 'object' || rest.type === 'array'
? {
type: rest.type,
properties,
items: value.items,
required
}
: value)
};

@@ -130,0 +134,0 @@ }

@@ -34,3 +34,3 @@ import { SwaggerUIRender } from './swagger';

const relativePath = path.startsWith('/') ? path.slice(1) : path;
app.get(path, () => {
app.get(path, (() => {
const combinedSwaggerOptions = {

@@ -42,12 +42,10 @@ url: `${relativePath}/json`,

const stringifiedSwaggerOptions = JSON.stringify(combinedSwaggerOptions, (key, value) => {
if (typeof value == 'function') {
if (typeof value == 'function')
return undefined;
}
else {
return value;
}
return value;
});
const scalarConfiguration = {
spec: {
url: `${relativePath}/json`
...scalarConfig.spec,
url: `${relativePath}/json`,
},

@@ -63,3 +61,3 @@ ...scalarConfig

});
}).get(`${path}/json`, () => {
})()).get(`${path}/json`, () => {
const routes = app.routes;

@@ -66,0 +64,0 @@ if (routes.length !== totalRoutes) {

@@ -24,3 +24,3 @@ import { Kind } from '@sinclair/typebox';

// @ts-ignore
required: schema.required?.includes(key) ?? false,
required: schema.required?.includes(key) ?? false
};

@@ -30,4 +30,4 @@ });

const mapTypesResponse = (types, schema) => {
if (typeof schema === 'object'
&& ['void', 'undefined', 'null'].includes(schema.type))
if (typeof schema === 'object' &&
['void', 'undefined', 'null'].includes(schema.type))
return;

@@ -88,2 +88,3 @@ const responses = {};

properties,
items: responseSchema.items,
required

@@ -113,7 +114,10 @@ }

description: rest.description,
content: mapTypesResponse(contentTypes, {
type,
properties,
required
})
content: mapTypesResponse(contentTypes, rest.type === 'object' || rest.type === 'array'
? {
type: rest.type,
properties,
items: value.items,
required
}
: value)
};

@@ -120,0 +124,0 @@ }

{
"name": "@elysiajs/swagger",
"version": "0.8.4",
"version": "0.8.5",
"description": "Plugin for Elysia to auto-generate Swagger page",

@@ -5,0 +5,0 @@ "author": {

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