Refactor OpenAPI plugin: remove unused index.ts, update package.json with author info, enhance file detection logic, and add comprehensive tests for OpenAPI file detection.

This commit is contained in:
Luke Hagar
2025-09-25 16:32:08 +00:00
parent 61b49e4616
commit 8ffbcc25fa
10 changed files with 424 additions and 758 deletions

View File

@@ -4,19 +4,19 @@
// Function-based extensions with before/after helpers
export const extensions = {
'top-level': (before, after) => {
'top-level': (before: (key: string) => number, after: (key: string) => number) => {
return {
'x-example-before-info': before('info'), // Before 'info'
'x-example-after-paths': after('paths'), // After 'paths'
};
},
'operation': (before, after) => {
'operation': (before: (key: string) => number, after: (key: string) => number) => {
return {
'x-example-before-parameters': before('parameters'), // Before 'parameters'
'x-example-after-responses': after('responses'), // After 'responses'
};
},
'schema': (before, after) => {
'schema': (before: (key: string) => number, after: (key: string) => number) => {
return {
'x-example-validation': after('type'), // After 'type'
'x-example-example': after('example'), // After 'example'