@openapi-generator-plus/generator-common
Advanced tools
Comparing version 0.3.4 to 0.4.0
@@ -5,3 +5,3 @@ import { CodegenGenerator, CodegenServer } from '@openapi-generator-plus/types'; | ||
export * from './utils'; | ||
export declare function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toModelName'>; | ||
export declare function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toSchemaName'>; | ||
export declare function apiBasePath(servers: CodegenServer[] | undefined): string; |
@@ -26,3 +26,6 @@ "use strict"; | ||
}, | ||
toModelName: (name, options, state) => { | ||
toSchemaName: (name, options, state) => { | ||
if (options.nameSpecified) { | ||
return state.generator.toClassName(name, state); | ||
} | ||
if (options.purpose === types_1.CodegenSchemaPurpose.ARRAY_ITEM || options.purpose === types_1.CodegenSchemaPurpose.MAP_VALUE) { | ||
@@ -29,0 +32,0 @@ return state.generator.toClassName(pluralize_1.default.singular(name), state); |
{ | ||
"name": "@openapi-generator-plus/generator-common", | ||
"version": "0.3.4", | ||
"version": "0.4.0", | ||
"description": "Common utilities for openapi-generator-plus generators", | ||
@@ -24,3 +24,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@openapi-generator-plus/types": "^0.9.0", | ||
"@openapi-generator-plus/types": "^0.10.0", | ||
"pluralize": "^8.0.0", | ||
@@ -32,3 +32,3 @@ "url-parse": "^1.4.7" | ||
}, | ||
"gitHead": "4df5446c45800ea56c855f140fc9b28d40fde583" | ||
"gitHead": "6b785fbb3d4df867e8aa2cbdea10fbc3b0830dca" | ||
} |
@@ -9,5 +9,4 @@ import { CodegenGenerator, CodegenServer, CodegenSchemaPurpose } from '@openapi-generator-plus/types' | ||
export function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toModelName'> { | ||
export function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName' | 'toSchemaName'> { | ||
return { | ||
/** Create a default operation name for operations that lack an operationId */ | ||
@@ -22,3 +21,7 @@ toOperationName: (path: string, method: string): string => { | ||
toModelName: (name, options, state) => { | ||
toSchemaName: (name, options, state) => { | ||
if (options.nameSpecified) { | ||
return state.generator.toClassName(name, state) | ||
} | ||
if (options.purpose === CodegenSchemaPurpose.ARRAY_ITEM || options.purpose === CodegenSchemaPurpose.MAP_VALUE) { | ||
@@ -25,0 +28,0 @@ return state.generator.toClassName(pluralize.singular(name), state) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31627
460
+ Added@openapi-generator-plus/types@0.10.0(transitive)
- Removed@openapi-generator-plus/types@0.9.0(transitive)