typed-openapi 1.4.5 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -1,8 +1,9 @@
1
- import type { ReferenceObject, SchemaObject } from "openapi3-ts/oas31";
1
+ import type { OperationObject, ReferenceObject, SchemaObject } from "openapi3-ts/oas31";
2
2
  import type { SchemaObject as SchemaObject3 } from "openapi3-ts/oas30";
3
3
 
4
4
  import type { RefResolver } from "./ref-resolver.ts";
5
5
  import { Box } from "./box.ts";
6
+ import type { Method } from "./map-openapi-endpoints.ts";
6
7
 
7
8
  export type LibSchemaObject = SchemaObject & SchemaObject3;
8
9
 
@@ -94,10 +95,22 @@ export type FactoryCreator = (
94
95
  schema: SchemaObject | ReferenceObject,
95
96
  ctx: OpenapiSchemaConvertContext,
96
97
  ) => GenericFactory;
98
+
99
+ export type NameTransformOptions = {
100
+ transformSchemaName?: (name: string) => string;
101
+ transformEndpointName?: (endpoint: {
102
+ alias: string;
103
+ operation: OperationObject;
104
+ method: Method;
105
+ path: string;
106
+ }) => string;
107
+ };
108
+
97
109
  export type OpenapiSchemaConvertContext = {
98
110
  factory: FactoryCreator | GenericFactory;
99
111
  refs: RefResolver;
100
112
  onBox?: (box: Box<AnyBoxDef>) => Box<AnyBoxDef>;
113
+ nameTransform?: NameTransformOptions;
101
114
  };
102
115
 
103
116
  export type StringOrBox = string | Box<AnyBoxDef>;