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

@eropple/fastify-openapi3

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eropple/fastify-openapi3 - npm Package Compare versions

Comparing version 0.6.0-alpha to 0.6.0-alpha.1

2

package.json
{
"name": "@eropple/fastify-openapi3",
"version": "0.6.0-alpha",
"version": "0.6.0-alpha.1",
"author": "Ed Ropple",

@@ -5,0 +5,0 @@ "license": "LGPL-3.0",

@@ -8,2 +8,3 @@ import '../src/extensions.js';

import { APPLICATION_JSON } from '../src/constants.js';
import { SchemaObject } from "openapi3-ts";

@@ -28,2 +29,8 @@ const pluginOpts: OAS3PluginOptions = {

const ret = {
bar: {
foo: 'baz',
},
};
await fastify.register(async (fastify: FastifyInstance) => {

@@ -39,9 +46,3 @@ fastify.route<{ Reply: TestResponse }>({

oas: {},
handler: async (req, reply) => {
return {
bar: {
foo: 'baz',
},
};
}
handler: () => ret,
});

@@ -56,5 +57,16 @@ });

expect(oas.components?.schemas?.TestResponseInner).toBeTruthy();
expect((oas.components?.schemas?.TestResponse as SchemaObject)?.properties?.bar?.$ref)
.toEqual('#/components/schemas/TestResponseInner');
expect(op?.responses?.['200']?.content?.[APPLICATION_JSON]?.schema)
.toEqual({ $ref: '#/components/schemas/TestResponse' });
const response = await fastify.inject({
method: 'GET',
url: '/nested',
});
const responseBody = response.json();
expect(response.statusCode).toEqual(200);
expect(responseBody).toMatchObject(ret);
});
});
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