@qualisero/openapi-endpoint 0.19.1 → 0.20.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/dist/cli.js +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -324,8 +324,10 @@ function toEnumMemberName(value) {
|
|
|
324
324
|
// For non-identifier strings, replace special characters with underscores
|
|
325
325
|
const cleaned = toPascalCase(value.replace(/[^a-zA-Z0-9_$]/g, '_'));
|
|
326
326
|
// If the result is empty or still invalid, prefix with underscore to make it valid
|
|
327
|
+
// Sanitize the full value to ensure unique identifiers for enum members
|
|
327
328
|
if (cleaned.length === 0 || !/^[a-zA-Z_$]/.test(cleaned)) {
|
|
328
|
-
|
|
329
|
+
const sanitized = String(value).replace(/[^a-zA-Z0-9_$]/g, '_');
|
|
330
|
+
return sanitized.length > 0 ? `_${sanitized}` : '_Empty';
|
|
329
331
|
}
|
|
330
332
|
return cleaned;
|
|
331
333
|
}
|
|
@@ -707,8 +709,6 @@ function generateApiSchemasContent(openApiSpec) {
|
|
|
707
709
|
return `// Auto-generated from OpenAPI specification
|
|
708
710
|
// Do not edit this file manually
|
|
709
711
|
|
|
710
|
-
import type { components } from './openapi-types.js'
|
|
711
|
-
|
|
712
712
|
// No schemas found in the OpenAPI specification
|
|
713
713
|
`;
|
|
714
714
|
}
|