@fastify/swagger-ui
Advanced tools
Comparing version 1.10.1 to 1.10.2
@@ -0,1 +1,3 @@ | ||
'use strict' | ||
const swaggerOption = { | ||
@@ -2,0 +4,0 @@ swagger: { |
@@ -172,3 +172,3 @@ 'use strict' | ||
: function (req, reply) { | ||
reply.send(transformSpecification(fastify.swagger()), req, reply) | ||
reply.send(transformSpecification(fastify.swagger(), req, reply)) | ||
} | ||
@@ -195,3 +195,3 @@ : function (req, reply) { | ||
.type('application/x-yaml') | ||
.send(yaml.stringify(transformSpecification(fastify.swagger()), req, reply)) | ||
.send(yaml.stringify(transformSpecification(fastify.swagger(), req, reply))) | ||
} | ||
@@ -198,0 +198,0 @@ : function (req, reply) { |
{ | ||
"name": "@fastify/swagger-ui", | ||
"version": "1.10.1", | ||
"version": "1.10.2", | ||
"description": "Serve Swagger-ui for Fastify", | ||
"main": "index.js", | ||
"type": "commonjs", | ||
"types": "types/index.d.ts", | ||
@@ -15,2 +16,5 @@ "scripts": { | ||
"test:dev": "npm run lint && npm run unit && npm run typescript", | ||
"test:e2e:command": "node ./examples/example-e2e.js", | ||
"test:e2e": "npx playwright test", | ||
"test:e2e:ui": "npx playwright test --ui", | ||
"typescript": "tsd", | ||
@@ -51,2 +55,3 @@ "unit": "tap", | ||
"@fastify/swagger": "^8.0.0", | ||
"@playwright/test": "^1.39.0", | ||
"@types/node": "^20.1.1", | ||
@@ -58,3 +63,3 @@ "ajv": "^8.11.0", | ||
"standard": "^17.0.0", | ||
"swagger-ui-dist": "5.9.0", | ||
"swagger-ui-dist": "5.10.3", | ||
"tap": "^16.3.2", | ||
@@ -61,0 +66,0 @@ "tsd": "^0.29.0" |
@@ -304,2 +304,6 @@ # @fastify/swagger-ui | ||
#### Rendering models at the bottom of the page | ||
To ensure that models are correctly rendered at the bottom of the Swagger UI page, it's important to define your schemas using $refs through [fastify.addSchema](https://fastify.dev/docs/latest/Reference/Validation-and-Serialization/#adding-a-shared-schema). Directly embedding JSON schemas within the schema property of your route definitions in Fastify may lead to them not being displayed in Swagger UI. | ||
<a name="license"></a> | ||
@@ -306,0 +310,0 @@ ## License |
@@ -0,1 +1,3 @@ | ||
'use strict' | ||
const fs = require('node:fs') | ||
@@ -2,0 +4,0 @@ const fse = require('fs-extra') |
@@ -10,3 +10,3 @@ 'use strict' | ||
test('transformSpecification should modify the json', async (t) => { | ||
t.plan(3) | ||
t.plan(5) | ||
const fastify = Fastify() | ||
@@ -57,2 +57,4 @@ | ||
t.not(swaggerObject, fastify.swagger()) | ||
t.ok(req) | ||
t.ok(reply) | ||
swaggerObject.swagger = '2.1' | ||
@@ -75,3 +77,3 @@ return swaggerObject | ||
test('transformSpecificationClone false should not deepclone fastify.swagger() /1', async (t) => { | ||
t.plan(2) | ||
t.plan(4) | ||
const fastify = Fastify() | ||
@@ -123,2 +125,4 @@ | ||
t.equal(swaggerObject, fastify.swagger()) | ||
t.ok(req) | ||
t.ok(reply) | ||
return swaggerObject | ||
@@ -139,3 +143,3 @@ } | ||
test('transformSpecification should modify the yaml', async (t) => { | ||
t.plan(2) | ||
t.plan(4) | ||
const fastify = Fastify() | ||
@@ -186,2 +190,4 @@ | ||
swaggerObject.swagger = '2.1' | ||
t.ok(req) | ||
t.ok(reply) | ||
return swaggerObject | ||
@@ -204,3 +210,3 @@ } | ||
test('transformSpecificationClone false should not deepclone fastify.swagger() /2', async (t) => { | ||
t.plan(2) | ||
t.plan(4) | ||
const fastify = Fastify() | ||
@@ -252,2 +258,4 @@ | ||
t.equal(swaggerObject, fastify.swagger()) | ||
t.ok(req) | ||
t.ok(reply) | ||
return swaggerObject | ||
@@ -254,0 +262,0 @@ } |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
5133109
71
11931
312
15
7