Skip to content

Commit

Permalink
Merge pull request #266 from hey-api/fix/config-postfix-models-remove
Browse files Browse the repository at this point in the history
fix(config): remove postfixModels option
  • Loading branch information
mrlubos authored Apr 5, 2024
2 parents 32bb3a6 + 1dd7624 commit 9235d63
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-bottles-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hey-api/openapi-ts": minor
---

fix(config): remove postfixModels option
1 change: 0 additions & 1 deletion packages/openapi-ts/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const params = program
.option('--lint [value]', 'Process output folder with linter?')
.option('--name <value>', 'Custom client class name')
.option('--operationId [value]', 'Use operationd ID?')
.option('--postfixModels <value>', 'Model name postfix')
.option('--postfixServices <value>', 'Service name postfix')
.option('--request <value>', 'Path to custom request file')
.option('--serviceResponse [value]', 'Define shape of returned value from service calls')
Expand Down
8 changes: 0 additions & 8 deletions packages/openapi-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ const getConfig = async (userConfig: UserConfig, dependencies: Dependencies) =>
lint = false,
name,
operationId = true,
postfixModels = '',
postfixServices = 'Service',
request,
serviceResponse = 'body',
Expand All @@ -127,12 +126,6 @@ const getConfig = async (userConfig: UserConfig, dependencies: Dependencies) =>
throw new Error('🚫 output must be within the current working directory');
}

if (postfixModels) {
console.warn(
'⚠️ Deprecation warning: postfixModels. This setting will be removed in future versions. Please create an issue wih your use case if you need this option https://github.com/hey-api/openapi-ts/issues'
);
}

if (postfixServices && postfixServices !== 'Service') {
console.warn(
'⚠️ Deprecation warning: postfixServices. This setting will be removed in future versions. Please create an issue wih your use case if you need this option https://github.com/hey-api/openapi-ts/issues'
Expand Down Expand Up @@ -164,7 +157,6 @@ const getConfig = async (userConfig: UserConfig, dependencies: Dependencies) =>
name,
operationId,
output,
postfixModels,
postfixServices,
request,
serviceResponse,
Expand Down
1 change: 0 additions & 1 deletion packages/openapi-ts/src/openApi/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('parse', () => {
lint: false,
operationId: true,
output: '',
postfixModels: '',
postfixServices: '',
serviceResponse: 'body',
useDateType: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('getServices', () => {
lint: false,
operationId: false,
output: '',
postfixModels: '',
postfixServices: 'Service',
serviceResponse: 'body',
useDateType: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('getServices', () => {
lint: false,
operationId: true,
output: '',
postfixModels: '',
postfixServices: 'Service',
serviceResponse: 'body',
useDateType: false,
Expand Down
5 changes: 0 additions & 5 deletions packages/openapi-ts/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ export interface UserConfig {
* The relative location of the output directory
*/
output: string;
/**
* Model name postfix
* @default '''
*/
postfixModels?: string;
/**
* Service name postfix
* @default 'Service'
Expand Down
2 changes: 0 additions & 2 deletions packages/openapi-ts/src/utils/__tests__/handlebars.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe('registerHandlebarHelpers', () => {
lint: false,
operationId: true,
output: '',
postfixModels: '',
postfixServices: '',
serviceResponse: 'body',
useDateType: false,
Expand Down Expand Up @@ -75,7 +74,6 @@ describe('registerHandlebarTemplates', () => {
lint: false,
operationId: true,
output: '',
postfixModels: '',
postfixServices: '',
serviceResponse: 'body',
useDateType: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe('writeClientClass', () => {
name: 'AppClient',
operationId: true,
output: '',
postfixModels: '',
postfixServices: '',
serviceResponse: 'body',
useDateType: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ describe('writeClient', () => {
lint: false,
operationId: true,
output: './dist',
postfixModels: 'AppClient',
postfixServices: 'Service',
serviceResponse: 'body',
useDateType: false,
Expand Down
3 changes: 0 additions & 3 deletions packages/openapi-ts/src/utils/write/__tests__/core.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe('writeClientCore', () => {
name: 'AppClient',
operationId: true,
output: '',
postfixModels: '',
postfixServices: '',
serviceResponse: 'body',
useDateType: false,
Expand Down Expand Up @@ -81,7 +80,6 @@ describe('writeClientCore', () => {
name: 'AppClient',
operationId: true,
output: '',
postfixModels: '',
postfixServices: '',
serviceResponse: 'body',
useDateType: false,
Expand Down Expand Up @@ -124,7 +122,6 @@ describe('writeClientCore', () => {
name: 'AppClient',
operationId: true,
output: '',
postfixModels: '',
postfixServices: '',
serviceResponse: 'body',
useDateType: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe('writeClientIndex', () => {
lint: false,
operationId: true,
output: '',
postfixModels: '',
postfixServices: 'Service',
serviceResponse: 'body',
useDateType: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ describe('writeClientModels', () => {
name: 'AppClient',
operationId: true,
output: '',
postfixModels: '',
postfixServices: '',
serviceResponse: 'body',
useDateType: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ describe('writeClientSchemas', () => {
name: 'AppClient',
operationId: true,
output: '',
postfixModels: '',
postfixServices: '',
serviceResponse: 'body',
useDateType: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe('writeClientServices', () => {
lint: false,
operationId: true,
output: '',
postfixModels: '',
postfixServices: 'Service',
serviceResponse: 'body',
useDateType: false,
Expand Down

0 comments on commit 9235d63

Please sign in to comment.