Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openapi-generator-plus/generator-common

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openapi-generator-plus/generator-common - npm Package Compare versions

Comparing version 0.3.4 to 0.4.0

2

dist/index.d.ts

@@ -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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc