Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bin/configs/typescript-consolidated-deno-object-parameters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
generatorName: typescript
outputDir: samples/openapi3/client/petstore/typescript/builds/deno_object_params
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript
additionalProperties:
platform: deno
npmName: ts-petstore-client
useObjectParameters: true
projectName: ts-petstore-client
moduleName: petstore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export { Middleware } from './middleware{{importFileExtension}}';
export{{#platforms}}{{#deno}} type{{/deno}}{{/platforms}} { PromiseMiddleware as Middleware } from './middleware{{importFileExtension}}';
{{/useRxJS}}
{{#useObjectParameters}}
export { {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{classname}}{{operationIdCamelCase}}Request, {{/operation}}Object{{classname}} as {{classname}}{{^-last}}, {{/-last}} {{/operations}}{{/apis}}{{/apiInfo}}} from './types/ObjectParamAPI{{importFileExtension}}';
export { {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#platforms}}{{#deno}}type {{/deno}}{{/platforms}}{{classname}}{{operationIdCamelCase}}Request, {{/operation}}Object{{classname}} as {{classname}}{{^-last}}, {{/-last}} {{/operations}}{{/apis}}{{/apiInfo}}} from './types/ObjectParamAPI{{importFileExtension}}';

@joscha joscha Aug 29, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the meaningful change of this PR.

It makes sure that any re-exported request object is exported with the type keyword, e.g.

export { AuthApiXRequest, ObjectAuthApi as AuthApi } from './types/ObjectParamAPI.ts';

becomes

export { type AuthApiXRequest, ObjectAuthApi as AuthApi } from './types/ObjectParamAPI.ts';

e.g. meaning

export {
-  AuthApiXRequest,
+  type AuthApiXRequest,
   ObjectAuthApi as AuthApi
} from './types/ObjectParamAPI.ts';

An alternative, possibly more readable implementation would be to split the type exports from the classes, e.g.:

export { ObjectAuthApi as AuthApi, ObjectBlaApi as BlaApi } from './types/ObjectParamAPI.ts';
export type { AuthApiXRequest, BlaApiXRequest } from './types/ObjectParamAPI.ts';

{{/useObjectParameters}}
{{^useObjectParameters}}
{{#useRxJS}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.gitignore
PetApi.md
StoreApi.md
UserApi.md
apis/PetApi.ts
apis/StoreApi.ts
apis/UserApi.ts
apis/baseapi.ts
apis/exception.ts
auth/auth.ts
configuration.ts
git_push.sh
http/http.ts
http/isomorphic-fetch.ts
index.ts
middleware.ts
models/ApiResponse.ts
models/Category.ts
models/ObjectSerializer.ts
models/Order.ts
models/Pet.ts
models/Tag.ts
models/User.ts
models/all.ts
rxjsStub.ts
servers.ts
types/ObjectParamAPI.ts
types/ObservableAPI.ts
types/PromiseAPI.ts
util.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.9.0-SNAPSHOT
Loading