From f65f23c1691ce782047b59e38e9b05ad45dc9797 Mon Sep 17 00:00:00 2001 From: Matthias Zronek Date: Thu, 14 May 2026 13:29:38 +0200 Subject: [PATCH 1/4] respect custom payload api route, add plugin option to customize the operation base paths --- package.json | 2 +- src/openapi/generators.ts | 45 ++++++++++---- src/openapiPlugin.ts | 2 + src/types.ts | 1 + test/openapi-generators.test.ts | 103 ++++++++++++++++++++++++++++---- 5 files changed, 130 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 52970ee..376b0f3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "payload-oapi", "description": "An OpenAPI plugin for Payload CMS", - "version": "0.2.5", + "version": "0.2.6", "homepage:": "https://github.com/janbuchar/payload-oapi", "repository:": "https://github.com/janbuchar/payload-oapi", "main": "dist/index.js", diff --git a/src/openapi/generators.ts b/src/openapi/generators.ts index 49e8f21..603cd5a 100644 --- a/src/openapi/generators.ts +++ b/src/openapi/generators.ts @@ -389,6 +389,7 @@ const isOpenToPublic = async (checker: Access): Promise => { const generateCollectionOperations = async ( collection: Collection, + apiBasePath: string, ): Promise> => { const { slug } = collection.config const { singular, plural } = collectionName(collection) @@ -400,7 +401,7 @@ const generateCollectionOperations = async ( } satisfies OpenAPIV3_1.ResponsesObject & OpenAPIV3.ResponsesObject return { - [`/api/${slug}`]: { + [`${apiBasePath}/${slug}`]: { get: { operationId: componentName('schemas', plural, { prefix: 'list' }), summary: `Retrieve a list of ${plural}`, @@ -436,9 +437,15 @@ const generateCollectionOperations = async ( { type: 'object' }, { anyOf: [ - composeRef('schemas', singular, { suffix: 'QueryOperations' }), - composeRef('schemas', singular, { suffix: 'QueryOperationsAnd' }), - composeRef('schemas', singular, { suffix: 'QueryOperationsOr' }), + composeRef('schemas', singular, { + suffix: 'QueryOperations', + }), + composeRef('schemas', singular, { + suffix: 'QueryOperationsAnd', + }), + composeRef('schemas', singular, { + suffix: 'QueryOperationsOr', + }), ], }, ], @@ -462,7 +469,7 @@ const generateCollectionOperations = async ( security: (await isOpenToPublic(collection.config.access.create)) ? [] : [apiKeySecurity], }, }, - [`/api/${slug}/{id}`]: { + [`${apiBasePath}/${slug}/{id}`]: { parameters: [ ...baseQueryParams, { @@ -549,7 +556,10 @@ const generateGlobalSchemas = ( ) return { - [componentName('schemas', globalName(global))]: { ...schema, title: globalName(global) }, + [componentName('schemas', globalName(global))]: { + ...schema, + title: globalName(global), + }, [componentName('schemas', globalName(global), { suffix: 'Read' })]: { title: `${globalName(global)} (if present)`, oneOf: [schema, { type: 'object', properties: {} }], @@ -563,13 +573,14 @@ const generateGlobalSchemas = ( const generateGlobalOperations = async ( global: SanitizedGlobalConfig, + apiBasePath: string, ): Promise> => { const slug = global.slug const singular = globalName(global) const tags = [singular] return { - [`/api/globals/${slug}`]: { + [`${apiBasePath}/globals/${slug}`]: { get: { summary: `Get the ${singular}`, tags, @@ -670,8 +681,14 @@ export const generateV30Spec = async ( servers: [{ url: `${req.protocol}//${req.headers.get('host')}` }], paths: Object.assign( {}, - ...(await Promise.all(collections.map(generateCollectionOperations))), - ...(await Promise.all(globals.map(generateGlobalOperations))), + ...(await Promise.all( + collections.map(collection => + generateCollectionOperations(collection, options.apiBasePath), + ), + )), + ...(await Promise.all( + globals.map(global => generateGlobalOperations(global, options.apiBasePath)), + )), ), components: { securitySchemes: generateSecuritySchemes(options.authEndpoint), @@ -734,8 +751,14 @@ export const generateV31Spec = async ( servers: [{ url: `${req.protocol}//${req.headers.get('host')}` }], paths: Object.assign( {}, - ...(await Promise.all(collections.map(generateCollectionOperations))), - ...(await Promise.all(globals.map(generateGlobalOperations))), + ...(await Promise.all( + collections.map(collection => + generateCollectionOperations(collection, options.apiBasePath), + ), + )), + ...(await Promise.all( + globals.map(global => generateGlobalOperations(global, options.apiBasePath)), + )), ), components: { securitySchemes: generateSecuritySchemes(options.authEndpoint), diff --git a/src/openapiPlugin.ts b/src/openapiPlugin.ts index 1d85d47..f1fe9aa 100644 --- a/src/openapiPlugin.ts +++ b/src/openapiPlugin.ts @@ -10,6 +10,7 @@ const openapi = metadata, enabled = true, filters = {}, + apiBasePath, }: PluginOptions): Plugin => ({ endpoints = [], ...config }) => { if (!enabled) { @@ -28,6 +29,7 @@ const openapi = metadata, authEndpoint, filters, + apiBasePath: apiBasePath ?? config.routes?.api ?? '/api', }), }, { diff --git a/src/types.ts b/src/types.ts index a2c1244..51ec14f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -21,6 +21,7 @@ export interface PluginOptions { authEndpoint?: string metadata: OpenAPIMetadata filters?: FilterOptions + apiBasePath?: string } export type SanitizedPluginOptions = Required> diff --git a/test/openapi-generators.test.ts b/test/openapi-generators.test.ts index f73c040..1a43c04 100644 --- a/test/openapi-generators.test.ts +++ b/test/openapi-generators.test.ts @@ -58,12 +58,17 @@ describe('openapi generators', () => { const payload = await buildPayload({}) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, + apiBasePath: '/api', }, ) @@ -89,12 +94,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, + apiBasePath: '/api', }, ) @@ -139,12 +149,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, + apiBasePath: '/api', }, ) @@ -173,12 +188,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, + apiBasePath: '/api', }, ) @@ -201,12 +221,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, + apiBasePath: '/api', }, ) @@ -224,12 +249,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { includeCollections: ['posts'] }, + apiBasePath: '/api', }, ) @@ -243,12 +273,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { excludeCollections: ['users'] }, + apiBasePath: '/api', }, ) @@ -262,12 +297,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { hideInternalCollections: true }, + apiBasePath: '/api', }, ) @@ -283,12 +323,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { includeCollections: [] }, + apiBasePath: '/api', }, ) @@ -311,12 +356,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { includeGlobals: ['settings'] }, + apiBasePath: '/api', }, ) @@ -338,12 +388,17 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, { openapiVersion: '3.0', authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { excludeGlobals: ['footer'] }, + apiBasePath: '/api', }, ) @@ -351,4 +406,30 @@ describe('openapi generators', () => { expect(spec.paths['/api/globals/footer']).toBeUndefined() }) }) + + test('apiBasePath option changes operation paths', async () => { + const payload = await buildPayload({ + collections: [Posts], + }) + + const spec = await generateV30Spec( + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, + { + openapiVersion: '3.0', + authEndpoint: '/api/auth', + metadata: { title: 'Test API', version: '1.0' }, + filters: { hideInternalCollections: true }, + apiBasePath: '/api/custom', + }, + ) + + expect(spec.paths['/api/custom/posts']).toBeDefined() + expect(spec.paths['/api/custom/payload-preferences']).toBeUndefined() + expect(spec.paths['/api/custom/payload-migrations']).toBeUndefined() + expect(spec.paths['/api/custom/payload-locked-documents']).toBeUndefined() + }) }) From fd64e8375672fece6fd5096f49a52f50ce56bae5 Mon Sep 17 00:00:00 2001 From: Matthias Zronek Date: Thu, 14 May 2026 21:58:15 +0200 Subject: [PATCH 2/4] use sanitized payload request config for apiBasePath default to avoid hardcoding /api, add another test to check if the payload api route config works --- src/openapi/generators.ts | 27 +++++++++-------- src/openapiPlugin.ts | 4 +-- src/types.ts | 2 +- test/openapi-generators.test.ts | 51 ++++++++++++++++++++++++++------- 4 files changed, 58 insertions(+), 26 deletions(-) diff --git a/src/openapi/generators.ts b/src/openapi/generators.ts index 603cd5a..d65bdca 100644 --- a/src/openapi/generators.ts +++ b/src/openapi/generators.ts @@ -663,6 +663,15 @@ const generateComponents = ( return { schemas, requestBodies, responses } } +/** + * Prefer the `apiBasePath` from plugin options (not null), + * otherwise use the currently configured api route from payload. + */ +const getApiBasePath = ( + options: SanitizedPluginOptions, + req: Pick, +): string => (options.apiBasePath !== null ? options.apiBasePath : req.payload.config.routes.api) + export const generateV30Spec = async ( req: Pick, options: SanitizedPluginOptions, @@ -674,6 +683,7 @@ export const generateV30Spec = async ( shouldIncludeCollection(collection, filters), ) const globals = req.payload.globals.config.filter(global => shouldIncludeGlobal(global, filters)) + const apiBasePath = getApiBasePath(options, req) const spec = { openapi: '3.0.3', @@ -682,13 +692,9 @@ export const generateV30Spec = async ( paths: Object.assign( {}, ...(await Promise.all( - collections.map(collection => - generateCollectionOperations(collection, options.apiBasePath), - ), - )), - ...(await Promise.all( - globals.map(global => generateGlobalOperations(global, options.apiBasePath)), + collections.map(collection => generateCollectionOperations(collection, apiBasePath)), )), + ...(await Promise.all(globals.map(global => generateGlobalOperations(global, apiBasePath)))), ), components: { securitySchemes: generateSecuritySchemes(options.authEndpoint), @@ -744,6 +750,7 @@ export const generateV31Spec = async ( shouldIncludeCollection(collection, filters), ) const globals = req.payload.globals.config.filter(global => shouldIncludeGlobal(global, filters)) + const apiBasePath = getApiBasePath(options, req) const spec = { openapi: '3.1.0', @@ -752,13 +759,9 @@ export const generateV31Spec = async ( paths: Object.assign( {}, ...(await Promise.all( - collections.map(collection => - generateCollectionOperations(collection, options.apiBasePath), - ), - )), - ...(await Promise.all( - globals.map(global => generateGlobalOperations(global, options.apiBasePath)), + collections.map(collection => generateCollectionOperations(collection, apiBasePath)), )), + ...(await Promise.all(globals.map(global => generateGlobalOperations(global, apiBasePath)))), ), components: { securitySchemes: generateSecuritySchemes(options.authEndpoint), diff --git a/src/openapiPlugin.ts b/src/openapiPlugin.ts index f1fe9aa..1aaf7ab 100644 --- a/src/openapiPlugin.ts +++ b/src/openapiPlugin.ts @@ -10,7 +10,7 @@ const openapi = metadata, enabled = true, filters = {}, - apiBasePath, + apiBasePath = null, }: PluginOptions): Plugin => ({ endpoints = [], ...config }) => { if (!enabled) { @@ -29,7 +29,7 @@ const openapi = metadata, authEndpoint, filters, - apiBasePath: apiBasePath ?? config.routes?.api ?? '/api', + apiBasePath, }), }, { diff --git a/src/types.ts b/src/types.ts index 51ec14f..982a877 100644 --- a/src/types.ts +++ b/src/types.ts @@ -21,7 +21,7 @@ export interface PluginOptions { authEndpoint?: string metadata: OpenAPIMetadata filters?: FilterOptions - apiBasePath?: string + apiBasePath?: string | null } export type SanitizedPluginOptions = Required> diff --git a/test/openapi-generators.test.ts b/test/openapi-generators.test.ts index 1a43c04..d68a052 100644 --- a/test/openapi-generators.test.ts +++ b/test/openapi-generators.test.ts @@ -68,7 +68,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -104,7 +104,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -159,7 +159,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -198,7 +198,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -231,7 +231,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: {}, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -259,7 +259,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { includeCollections: ['posts'] }, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -283,7 +283,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { excludeCollections: ['users'] }, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -307,7 +307,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { hideInternalCollections: true }, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -333,7 +333,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { includeCollections: [] }, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -366,7 +366,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { includeGlobals: ['settings'] }, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -398,7 +398,7 @@ describe('openapi generators', () => { authEndpoint: '/api/auth', metadata: { title: 'Test API', version: '1.0' }, filters: { excludeGlobals: ['footer'] }, - apiBasePath: '/api', + apiBasePath: null, }, ) @@ -432,4 +432,33 @@ describe('openapi generators', () => { expect(spec.paths['/api/custom/payload-migrations']).toBeUndefined() expect(spec.paths['/api/custom/payload-locked-documents']).toBeUndefined() }) + + test('payload routes api config changes operation paths', async () => { + const payload = await buildPayload({ + collections: [Posts], + routes: { + api: '/api/custom', + }, + }) + + const spec = await generateV30Spec( + { + protocol: 'https', + headers: new Headers({ host: 'localhost' }), + payload, + }, + { + openapiVersion: '3.0', + authEndpoint: '/api/auth', + metadata: { title: 'Test API', version: '1.0' }, + filters: { hideInternalCollections: true }, + apiBasePath: null, + }, + ) + + expect(spec.paths['/api/custom/posts']).toBeDefined() + expect(spec.paths['/api/custom/payload-preferences']).toBeUndefined() + expect(spec.paths['/api/custom/payload-migrations']).toBeUndefined() + expect(spec.paths['/api/custom/payload-locked-documents']).toBeUndefined() + }) }) From a816ebae9bb0f3299ed29c1c864b1979a4541468 Mon Sep 17 00:00:00 2001 From: Matthias Zronek Date: Thu, 14 May 2026 22:21:14 +0200 Subject: [PATCH 3/4] add proper zed config for biome linting, fix unnecessary style mismatches due to previously missing zed config --- .zed/settings.json | 35 +++++++++++++++ src/openapi/generators.ts | 17 ++----- test/openapi-generators.test.ts | 78 ++++++--------------------------- 3 files changed, 52 insertions(+), 78 deletions(-) create mode 100644 .zed/settings.json diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 0000000..1726768 --- /dev/null +++ b/.zed/settings.json @@ -0,0 +1,35 @@ +{ + "lsp": { + "biome": { + "binary": { + "path": "./node_modules/@biomejs/biome/bin/biome", + "arguments": ["lsp-proxy"] + } + } + }, + "languages": { + "JSON": { "formatter": { "language_server": { "name": "biome" } } }, + "JSONC": { "formatter": { "language_server": { "name": "biome" } } }, + "JavaScript": { + "formatter": { "language_server": { "name": "biome" } }, + "code_actions_on_format": { + "source.fixAll.biome": true, + "source.organizeImports.biome": true + } + }, + "TSX": { + "formatter": { "language_server": { "name": "biome" } }, + "code_actions_on_format": { + "source.fixAll.biome": true, + "source.organizeImports.biome": true + } + }, + "TypeScript": { + "formatter": { "language_server": { "name": "biome" } }, + "code_actions_on_format": { + "source.fixAll.biome": true, + "source.organizeImports.biome": true + } + } + } +} diff --git a/src/openapi/generators.ts b/src/openapi/generators.ts index d65bdca..e332edd 100644 --- a/src/openapi/generators.ts +++ b/src/openapi/generators.ts @@ -437,15 +437,9 @@ const generateCollectionOperations = async ( { type: 'object' }, { anyOf: [ - composeRef('schemas', singular, { - suffix: 'QueryOperations', - }), - composeRef('schemas', singular, { - suffix: 'QueryOperationsAnd', - }), - composeRef('schemas', singular, { - suffix: 'QueryOperationsOr', - }), + composeRef('schemas', singular, { suffix: 'QueryOperations' }), + composeRef('schemas', singular, { suffix: 'QueryOperationsAnd' }), + composeRef('schemas', singular, { suffix: 'QueryOperationsOr' }), ], }, ], @@ -556,10 +550,7 @@ const generateGlobalSchemas = ( ) return { - [componentName('schemas', globalName(global))]: { - ...schema, - title: globalName(global), - }, + [componentName('schemas', globalName(global))]: { ...schema, title: globalName(global) }, [componentName('schemas', globalName(global), { suffix: 'Read' })]: { title: `${globalName(global)} (if present)`, oneOf: [schema, { type: 'object', properties: {} }], diff --git a/test/openapi-generators.test.ts b/test/openapi-generators.test.ts index d68a052..ea6d663 100644 --- a/test/openapi-generators.test.ts +++ b/test/openapi-generators.test.ts @@ -58,11 +58,7 @@ describe('openapi generators', () => { const payload = await buildPayload({}) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -94,11 +90,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -149,11 +141,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -188,11 +176,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -221,11 +205,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -249,11 +229,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -273,11 +249,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -297,11 +269,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -323,11 +291,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -356,11 +320,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -388,11 +348,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -413,11 +369,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', @@ -442,11 +394,7 @@ describe('openapi generators', () => { }) const spec = await generateV30Spec( - { - protocol: 'https', - headers: new Headers({ host: 'localhost' }), - payload, - }, + { protocol: 'https', headers: new Headers({ host: 'localhost' }), payload }, { openapiVersion: '3.0', authEndpoint: '/api/auth', From e087a97816c03f7c81811a3cff183a82eeea724f Mon Sep 17 00:00:00 2001 From: Matthias Zronek Date: Mon, 1 Jun 2026 21:25:08 +0200 Subject: [PATCH 4/4] remove zed settings and ignore them in the future --- .gitignore | 3 +++ .zed/settings.json | 35 ----------------------------------- 2 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 .zed/settings.json diff --git a/.gitignore b/.gitignore index 6023549..54b08d3 100644 --- a/.gitignore +++ b/.gitignore @@ -137,6 +137,9 @@ GitHub.sublime-settings !.vscode/extensions.json .history +### Zed ### +.zed/* + ### WebStorm ### # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 diff --git a/.zed/settings.json b/.zed/settings.json deleted file mode 100644 index 1726768..0000000 --- a/.zed/settings.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "lsp": { - "biome": { - "binary": { - "path": "./node_modules/@biomejs/biome/bin/biome", - "arguments": ["lsp-proxy"] - } - } - }, - "languages": { - "JSON": { "formatter": { "language_server": { "name": "biome" } } }, - "JSONC": { "formatter": { "language_server": { "name": "biome" } } }, - "JavaScript": { - "formatter": { "language_server": { "name": "biome" } }, - "code_actions_on_format": { - "source.fixAll.biome": true, - "source.organizeImports.biome": true - } - }, - "TSX": { - "formatter": { "language_server": { "name": "biome" } }, - "code_actions_on_format": { - "source.fixAll.biome": true, - "source.organizeImports.biome": true - } - }, - "TypeScript": { - "formatter": { "language_server": { "name": "biome" } }, - "code_actions_on_format": { - "source.fixAll.biome": true, - "source.organizeImports.biome": true - } - } - } -}