Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
01006c65ee Bump actions/setup-node from 5 to 6
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-14 23:02:47 +00:00
611 changed files with 183 additions and 106023 deletions

View File

@@ -21,7 +21,7 @@ jobs:
with:
go-version: "stable"
- name: Setup node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
- name: Run echo server
run: |
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server

View File

@@ -36,7 +36,7 @@ jobs:
~/.m2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Setup node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
- name: Run echo server
run: |
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server

View File

@@ -37,7 +37,7 @@ jobs:
~/.m2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Setup node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
- name: Run echo server
run: |
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server

View File

@@ -43,7 +43,7 @@ jobs:
~/.m2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Setup node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
- name: Run echo server
run: |
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server

View File

@@ -39,7 +39,7 @@ jobs:
run: |
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
- name: Use Node.js 20.x
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: 'npm' # Or 'yarn'

View File

@@ -20,7 +20,10 @@ jobs:
- samples/server/petstore/jaxrs/jersey2-useTags
- samples/server/petstore/jaxrs-jersey
- samples/server/petstore/jaxrs-spec
- samples/server/petstore/jaxrs-spec-withxml
- samples/server/petstore/jaxrs-spec-interface
- samples/server/petstore/jaxrs-spec-interface-response
- samples/server/petstore/jaxrs-jersey
- samples/server/petstore/jaxrs-spec
- samples/server/petstore/jaxrs-spec-interface
- samples/server/petstore/jaxrs-spec-interface-response
- samples/server/petstore/jaxrs-datelib-j8

View File

@@ -40,7 +40,7 @@ jobs:
build-root-directory: ${{ matrix.sample }}
arguments: wrapper
- name: Setup node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
- name: Run echo server
run: |
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server

View File

@@ -29,7 +29,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Setup node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
- name: Run echo server
run: |
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server

View File

@@ -28,7 +28,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Setup node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
- name: Run echo server
run: |
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server

View File

@@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- name: Setup node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
- name: Run echo server
run: |
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server

View File

@@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

View File

@@ -9,11 +9,11 @@ on:
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
- samples/client/petstore/typescript-angular-v16-provided-in-root/**
- samples/client/petstore/typescript-angular-v17-provided-in-root/**
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
#- samples/client/petstore/typescript-angular-v16-provided-in-root/**
# comment out below as there's no pom.xml
#- samples/client/petstore/typescript-angular-v17-provided-in-root/**
#- samples/client/petstore/typescript-angular-v18-provided-in-root/**
#- samples/client/petstore/typescript-angular-v19-provided-in-root/**
- samples/openapi3/client/petstore/typescript/builds/default/**
# comment out due to build failure
#- samples/openapi3/client/petstore/typescript/tests/default/**
@@ -47,11 +47,10 @@ on:
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
- samples/client/petstore/typescript-angular-v16-provided-in-root/**
- samples/client/petstore/typescript-angular-v17-provided-in-root/**
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
#- samples/client/petstore/typescript-angular-v16-provided-in-root/**
#- samples/client/petstore/typescript-angular-v17-provided-in-root/**
#- samples/client/petstore/typescript-angular-v18-provided-in-root/**
#- samples/client/petstore/typescript-angular-v19-provided-in-root/**
- samples/openapi3/client/petstore/typescript/builds/default/**
#- samples/openapi3/client/petstore/typescript/tests/default/**
- samples/openapi3/client/petstore/typescript/builds/jquery/**
@@ -96,11 +95,10 @@ jobs:
#- samples/client/petstore/typescript-angular-v13-provided-in-root/
#- samples/client/petstore/typescript-angular-v14-provided-in-root/
#- samples/client/petstore/typescript-angular-v15-provided-in-root/
- samples/client/petstore/typescript-angular-v16-provided-in-root/
- samples/client/petstore/typescript-angular-v17-provided-in-root/
- samples/client/petstore/typescript-angular-v18-provided-in-root/
- samples/client/petstore/typescript-angular-v19-provided-in-root/
- samples/client/petstore/typescript-angular-v20-provided-in-root/
#- samples/client/petstore/typescript-angular-v16-provided-in-root/
#- samples/client/petstore/typescript-angular-v17-provided-in-root/
#- samples/client/petstore/typescript-angular-v18-provided-in-root/
#- samples/client/petstore/typescript-angular-v19-provided-in-root/
- samples/openapi3/client/petstore/typescript/builds/default/
#- samples/openapi3/client/petstore/typescript/tests/default/
- samples/openapi3/client/petstore/typescript/builds/jquery/
@@ -127,13 +125,13 @@ jobs:
run: |
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
- name: Set up JDK 17
uses: actions/setup-java@v5
uses: actions/setup-java@v4
with:
java-version: '17' # Specify your desired Java version
distribution: 'temurin' # Or 'adopt', 'oracle', etc.
cache: maven # Cache Maven dependencies for faster builds
- name: Use Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: 'npm' # Or 'yarn'

View File

@@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

View File

@@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

View File

@@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

View File

@@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- name: Use Node.js 20.x
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: 'npm' # Or 'yarn'

View File

@@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

View File

@@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- name: Setup node
uses: actions/setup-node@v5
uses: actions/setup-node@v6
- name: Install dependencies
working-directory: ${{ matrix.sample }}
run: |

2
.gitignore vendored
View File

@@ -49,8 +49,6 @@ nb-configuration.xml
*.xml~
*.t~
**/.angular
/target
/generated-files
test-output/

View File

@@ -1,10 +0,0 @@
generatorName: jaxrs-spec
outputDir: samples/server/petstore/jaxrs-spec-withxml/
inputSpec: modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
additionalProperties:
artifactId: jaxrs-spec-withxml-petstore-server
serializableModel: "true"
hideGenerationTimestamp: "true"
generateBuilders: "true"
withXml: true

View File

@@ -1,9 +0,0 @@
generatorName: typescript-angular
outputDir: samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
ngVersion: 19.0.0
supportsES6: true
enumNameMappings:
delivered: SHIPPED

View File

@@ -1,9 +0,0 @@
generatorName: typescript-angular
outputDir: samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
ngVersion: 20.0.0
supportsES6: true
enumNameMappings:
delivered: SHIPPED

View File

@@ -1,7 +0,0 @@
generatorName: typescript-fetch
outputDir: samples/client/others/typescript-fetch/infinite-recursion-issue
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/infinite-recursion-issue.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
additionalProperties:
enumPropertyNaming: "original"
enumUnknownDefaultCase: true

View File

@@ -100,8 +100,6 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
private final DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE;
private final DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME;
protected String apiDocPath = "docs/";
public TypeScriptClientCodegen() {
super();
@@ -402,11 +400,6 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
return objs;
}
@Override
public String apiDocFileFolder() {
return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
}
private List<Map<String, String>> toTsImports(CodegenModel cm, Set<String> imports) {
List<Map<String, String>> tsImports = new ArrayList<>();
for (String im : imports) {
@@ -439,8 +432,6 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
apiPackage = this.apiPackage + ".apis";
testPackage = this.testPackage + ".tests";
additionalProperties.put("apiDocPath", apiDocPath);
additionalProperties.putIfAbsent(FRAMEWORK_SWITCH, FRAMEWORKS[0]);
supportingFiles.add(new SupportingFile("index.mustache", "index.ts"));

View File

@@ -1605,13 +1605,11 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
if (this.discriminator != null) {
Set<CodegenDiscriminator.MappedModel> mappedModels = this.discriminator.getMappedModels();
for(CodegenDiscriminator.MappedModel mappedModel : mappedModels) {
if(mappedModel.getModelName().equals(cm.classname)) {
this.selfReferencingDiscriminatorMapping = mappedModel;
if(mappedModel.getModelName().equals(cm.classname)){
this.discriminator.getMappedModels().remove(mappedModel);
this.selfReferencingDiscriminatorMapping=mappedModel;
}
}
if(this.selfReferencingDiscriminatorMapping != null) {
this.discriminator.getMappedModels().remove(this.selfReferencingDiscriminatorMapping);
}
}
}

View File

@@ -1,11 +1,7 @@
{{#withXml}}
@XmlType(name="{{datatypeWithEnum}}")
@XmlEnum({{dataType}}.class)
{{/withXml}}
{{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} {
{{#allowableValues}}
{{#enumVars}}{{#withXml}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}){{/withXml}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}
{{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}
{{/allowableValues}}

View File

@@ -7,23 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
{{#withXml}}
import {{javaxPackage}}.xml.bind.annotation.XmlElement;
import {{javaxPackage}}.xml.bind.annotation.XmlRootElement;
import {{javaxPackage}}.xml.bind.annotation.XmlAccessType;
import {{javaxPackage}}.xml.bind.annotation.XmlAccessorType;
import {{javaxPackage}}.xml.bind.annotation.XmlType;
import {{javaxPackage}}.xml.bind.annotation.XmlEnum;
import {{javaxPackage}}.xml.bind.annotation.XmlEnumValue;
{{/withXml}}
{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{#description}}/**
* {{.}}
**/{{/description}}
{{#useSwaggerAnnotations}}{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}
@org.eclipse.microprofile.openapi.annotations.media.Schema({{#title}}title="{{{.}}}", {{/title}}{{#description}}description="{{{.}}}"{{/description}}{{^description}}description=""{{/description}}){{/useMicroProfileOpenAPIAnnotations}}
@JsonTypeName("{{name}}")
{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}{{>xmlPojoAnnotation}}
{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}
{{#vendorExtensions.x-class-extra-annotation}}
{{{vendorExtensions.x-class-extra-annotation}}}
{{/vendorExtensions.x-class-extra-annotation}}
@@ -102,9 +92,6 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
return this;
}
{{#withXml}}
@XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}})
{{/withXml}}
{{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}}{{#useSwaggerAnnotations}}
@ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}
@org.eclipse.microprofile.openapi.annotations.media.Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}description = "{{{description}}}"){{/useMicroProfileOpenAPIAnnotations}}

View File

@@ -1,8 +0,0 @@
{{#withXml}}
@XmlAccessorType(XmlAccessType.FIELD)
{{#hasVars}} @XmlType(name = "{{classname}}", propOrder =
{ {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}}
}){{/hasVars}}
{{^hasVars}}@XmlType(name = "{{classname}}"){{/hasVars}}
{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}}
{{/withXml}}

View File

@@ -302,7 +302,7 @@ export class {{classname}} extends BaseService {
headers: localVarHeaders,
observe: observe,
{{#httpTransferCacheInOptions}}
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
{{/httpTransferCacheInOptions}}
reportProgress: reportProgress
}

View File

@@ -1,53 +0,0 @@
openapi: 3.0.3
info:
title: Minimal
description: Api to reproduce bug
version: 0.5.1-SNAPSHOT.0
tags:
- name: test
servers:
- url: http://localhost:8080
paths:
/api/v1/test:
get:
tags:
- test
operationId: test
responses:
"200":
description: test operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/TestBaseDto"
components:
schemas:
TestObjectType:
type: string
enum:
- TEST1
- TEST2
TestBaseDto:
type: object
properties:
something:
type: string
testObjectType:
$ref: "#/components/schemas/TestObjectType"
discriminator:
propertyName: testObjectType
mapping:
TEST2: '#/components/schemas/ExtendDto'
TEST1: '#/components/schemas/TestBaseDto'
ExtendDto:
allOf:
- $ref: '#/components/schemas/TestBaseDto'
- type: object
properties:
someItems:
type: array
items:
$ref: '#/components/schemas/TestBaseDto'

View File

@@ -1,5 +1,11 @@
.gitattributes
.gitignore
AuthApi.md
BodyApi.md
FormApi.md
HeaderApi.md
PathApi.md
QueryApi.md
README.md
apis/AuthApi.ts
apis/BodyApi.ts
@@ -11,12 +17,6 @@ apis/baseapi.ts
apis/exception.ts
auth/auth.ts
configuration.ts
docs/AuthApi.md
docs/BodyApi.md
docs/FormApi.md
docs/HeaderApi.md
docs/PathApi.md
docs/QueryApi.md
git_push.sh
http/http.ts
http/isomorphic-fetch.ts

View File

@@ -1,103 +0,0 @@
# .AuthApi
All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testAuthHttpBasic**](AuthApi.md#testAuthHttpBasic) | **POST** /auth/http/basic | To test HTTP basic authentication
[**testAuthHttpBearer**](AuthApi.md#testAuthHttpBearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication
# **testAuthHttpBasic**
> string testAuthHttpBasic()
To test HTTP basic authentication
### Example
```typescript
import { createConfiguration, AuthApi } from '';
const configuration = createConfiguration();
const apiInstance = new AuthApi(configuration);
const request = {};
const data = await apiInstance.testAuthHttpBasic(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
This endpoint does not need any parameter.
### Return type
**string**
### Authorization
[http_auth](README.md#http_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testAuthHttpBearer**
> string testAuthHttpBearer()
To test HTTP bearer authentication
### Example
```typescript
import { createConfiguration, AuthApi } from '';
const configuration = createConfiguration();
const apiInstance = new AuthApi(configuration);
const request = {};
const data = await apiInstance.testAuthHttpBearer(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
This endpoint does not need any parameter.
### Return type
**string**
### Authorization
[http_bearer_auth](README.md#http_bearer_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View File

@@ -1,581 +0,0 @@
# .BodyApi
All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body
[**testBodyApplicationOctetstreamBinary**](BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
[**testBodyMultipartFormdataArrayOfBinary**](BodyApi.md#testBodyMultipartFormdataArrayOfBinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime
[**testBodyMultipartFormdataSingleBinary**](BodyApi.md#testBodyMultipartFormdataSingleBinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime
[**testEchoBodyAllOfPet**](BodyApi.md#testEchoBodyAllOfPet) | **POST** /echo/body/allOf/Pet | Test body parameter(s)
[**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
[**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s)
[**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body
[**testEchoBodyStringEnum**](BodyApi.md#testEchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body
[**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
# **testBinaryGif**
> HttpFile testBinaryGif()
Test binary (gif) response body
### Example
```typescript
import { createConfiguration, BodyApi } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request = {};
const data = await apiInstance.testBinaryGif(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
This endpoint does not need any parameter.
### Return type
**HttpFile**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: image/gif
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testBodyApplicationOctetstreamBinary**
> string testBodyApplicationOctetstreamBinary()
Test body parameter(s)
### Example
```typescript
import { createConfiguration, BodyApi } from '';
import type { BodyApiTestBodyApplicationOctetstreamBinaryRequest } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request: BodyApiTestBodyApplicationOctetstreamBinaryRequest = {
body: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
};
const data = await apiInstance.testBodyApplicationOctetstreamBinary(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **HttpFile**| |
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/octet-stream
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testBodyMultipartFormdataArrayOfBinary**
> string testBodyMultipartFormdataArrayOfBinary()
Test array of binary in multipart mime
### Example
```typescript
import { createConfiguration, BodyApi } from '';
import type { BodyApiTestBodyMultipartFormdataArrayOfBinaryRequest } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request: BodyApiTestBodyMultipartFormdataArrayOfBinaryRequest = {
files: [
{ data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
],
};
const data = await apiInstance.testBodyMultipartFormdataArrayOfBinary(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**files** | **Array&lt;HttpFile&gt;** | | defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testBodyMultipartFormdataSingleBinary**
> string testBodyMultipartFormdataSingleBinary()
Test single binary in multipart mime
### Example
```typescript
import { createConfiguration, BodyApi } from '';
import type { BodyApiTestBodyMultipartFormdataSingleBinaryRequest } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request: BodyApiTestBodyMultipartFormdataSingleBinaryRequest = {
myFile: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
};
const data = await apiInstance.testBodyMultipartFormdataSingleBinary(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**myFile** | [**HttpFile**] | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testEchoBodyAllOfPet**
> Pet testEchoBodyAllOfPet()
Test body parameter(s)
### Example
```typescript
import { createConfiguration, BodyApi } from '';
import type { BodyApiTestEchoBodyAllOfPetRequest } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request: BodyApiTestEchoBodyAllOfPetRequest = {
// Pet object that needs to be added to the store (optional)
pet: null,
};
const data = await apiInstance.testEchoBodyAllOfPet(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | **Pet**| Pet object that needs to be added to the store |
### Return type
**Pet**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testEchoBodyFreeFormObjectResponseString**
> string testEchoBodyFreeFormObjectResponseString()
Test free form object
### Example
```typescript
import { createConfiguration, BodyApi } from '';
import type { BodyApiTestEchoBodyFreeFormObjectResponseStringRequest } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request: BodyApiTestEchoBodyFreeFormObjectResponseStringRequest = {
// Free form object (optional)
body: {},
};
const data = await apiInstance.testEchoBodyFreeFormObjectResponseString(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **any**| Free form object |
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testEchoBodyPet**
> Pet testEchoBodyPet()
Test body parameter(s)
### Example
```typescript
import { createConfiguration, BodyApi } from '';
import type { BodyApiTestEchoBodyPetRequest } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request: BodyApiTestEchoBodyPetRequest = {
// Pet object that needs to be added to the store (optional)
pet: {
id: 10,
name: "doggie",
category: {
id: 1,
name: "Dogs",
},
photoUrls: [
"photoUrls_example",
],
tags: [
{
id: 1,
name: "name_example",
},
],
status: "available",
},
};
const data = await apiInstance.testEchoBodyPet(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | **Pet**| Pet object that needs to be added to the store |
### Return type
**Pet**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testEchoBodyPetResponseString**
> string testEchoBodyPetResponseString()
Test empty response body
### Example
```typescript
import { createConfiguration, BodyApi } from '';
import type { BodyApiTestEchoBodyPetResponseStringRequest } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request: BodyApiTestEchoBodyPetResponseStringRequest = {
// Pet object that needs to be added to the store (optional)
pet: {
id: 10,
name: "doggie",
category: {
id: 1,
name: "Dogs",
},
photoUrls: [
"photoUrls_example",
],
tags: [
{
id: 1,
name: "name_example",
},
],
status: "available",
},
};
const data = await apiInstance.testEchoBodyPetResponseString(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | **Pet**| Pet object that needs to be added to the store |
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testEchoBodyStringEnum**
> StringEnumRef testEchoBodyStringEnum()
Test string enum response body
### Example
```typescript
import { createConfiguration, BodyApi } from '';
import type { BodyApiTestEchoBodyStringEnumRequest } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request: BodyApiTestEchoBodyStringEnumRequest = {
// String enum (optional)
body: "success",
};
const data = await apiInstance.testEchoBodyStringEnum(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **string**| String enum |
### Return type
**StringEnumRef**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testEchoBodyTagResponseString**
> string testEchoBodyTagResponseString()
Test empty json (request body)
### Example
```typescript
import { createConfiguration, BodyApi } from '';
import type { BodyApiTestEchoBodyTagResponseStringRequest } from '';
const configuration = createConfiguration();
const apiInstance = new BodyApi(configuration);
const request: BodyApiTestEchoBodyTagResponseStringRequest = {
// Tag object (optional)
tag: {
id: 1,
name: "name_example",
},
};
const data = await apiInstance.testEchoBodyTagResponseString(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tag** | **Tag**| Tag object |
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View File

@@ -1,194 +0,0 @@
# .FormApi
All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s)
[**testFormObjectMultipart**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
[**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
# **testFormIntegerBooleanString**
> string testFormIntegerBooleanString()
Test form parameter(s)
### Example
```typescript
import { createConfiguration, FormApi } from '';
import type { FormApiTestFormIntegerBooleanStringRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FormApi(configuration);
const request: FormApiTestFormIntegerBooleanStringRequest = {
integerForm: 1,
booleanForm: true,
stringForm: "stringForm_example",
};
const data = await apiInstance.testFormIntegerBooleanString(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**integerForm** | [**number**] | | (optional) defaults to undefined
**booleanForm** | [**boolean**] | | (optional) defaults to undefined
**stringForm** | [**string**] | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testFormObjectMultipart**
> string testFormObjectMultipart()
Test form parameter(s) for multipart schema
### Example
```typescript
import { createConfiguration, FormApi } from '';
import type { FormApiTestFormObjectMultipartRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FormApi(configuration);
const request: FormApiTestFormObjectMultipartRequest = {
marker: {
name: "name_example",
},
};
const data = await apiInstance.testFormObjectMultipart(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**marker** | **TestFormObjectMultipartRequestMarker** | | defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testFormOneof**
> string testFormOneof()
Test form parameter(s) for oneOf schema
### Example
```typescript
import { createConfiguration, FormApi } from '';
import type { FormApiTestFormOneofRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FormApi(configuration);
const request: FormApiTestFormOneofRequest = {
form1: "form1_example",
form2: 1,
form3: "form3_example",
form4: true,
id: 1,
name: "name_example",
};
const data = await apiInstance.testFormOneof(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**form1** | [**string**] | | (optional) defaults to undefined
**form2** | [**number**] | | (optional) defaults to undefined
**form3** | [**string**] | | (optional) defaults to undefined
**form4** | [**boolean**] | | (optional) defaults to undefined
**id** | [**number**] | | (optional) defaults to undefined
**name** | [**string**] | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View File

@@ -1,75 +0,0 @@
# .HeaderApi
All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testHeaderIntegerBooleanStringEnums**](HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
# **testHeaderIntegerBooleanStringEnums**
> string testHeaderIntegerBooleanStringEnums()
Test header parameter(s)
### Example
```typescript
import { createConfiguration, HeaderApi } from '';
import type { HeaderApiTestHeaderIntegerBooleanStringEnumsRequest } from '';
const configuration = createConfiguration();
const apiInstance = new HeaderApi(configuration);
const request: HeaderApiTestHeaderIntegerBooleanStringEnumsRequest = {
integerHeader: 1,
booleanHeader: true,
stringHeader: "string_header_example",
enumNonrefStringHeader: "success",
enumRefStringHeader: "success",
};
const data = await apiInstance.testHeaderIntegerBooleanStringEnums(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**integerHeader** | [**number**] | | (optional) defaults to undefined
**booleanHeader** | [**boolean**] | | (optional) defaults to undefined
**stringHeader** | [**string**] | | (optional) defaults to undefined
**enumNonrefStringHeader** | [**&#39;success&#39; | &#39;failure&#39; | &#39;unclassified&#39;**]**Array<&#39;success&#39; &#124; &#39;failure&#39; &#124; &#39;unclassified&#39;>** | | (optional) defaults to undefined
**enumRefStringHeader** | **StringEnumRef** | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View File

@@ -1,72 +0,0 @@
# .PathApi
All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
# **testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**
> string testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath()
Test path parameter(s)
### Example
```typescript
import { createConfiguration, PathApi } from '';
import type { PathApiTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest } from '';
const configuration = createConfiguration();
const apiInstance = new PathApi(configuration);
const request: PathApiTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest = {
pathString: "path_string_example",
pathInteger: 1,
enumNonrefStringPath: "success",
enumRefStringPath: "success",
};
const data = await apiInstance.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pathString** | [**string**] | | defaults to undefined
**pathInteger** | [**number**] | | defaults to undefined
**enumNonrefStringPath** | [**&#39;success&#39; | &#39;failure&#39; | &#39;unclassified&#39;**]**Array<&#39;success&#39; &#124; &#39;failure&#39; &#124; &#39;unclassified&#39;>** | | defaults to undefined
**enumRefStringPath** | **StringEnumRef** | | defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View File

@@ -1,659 +0,0 @@
# .QueryApi
All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**deprecatedTest**](QueryApi.md#deprecatedTest) | **GET** /test/deprecated | Test deprecation
[**testEnumRefString**](QueryApi.md#testEnumRefString) | **GET** /query/enum_ref_string | Test query parameter(s)
[**testQueryDatetimeDateString**](QueryApi.md#testQueryDatetimeDateString) | **GET** /query/datetime/date/string | Test query parameter(s)
[**testQueryIntegerBooleanString**](QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s)
[**testQueryStyleDeepObjectExplodeTrueObject**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s)
[**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
[**testQueryStyleFormExplodeFalseArrayInteger**](QueryApi.md#testQueryStyleFormExplodeFalseArrayInteger) | **GET** /query/style_form/explode_false/array_integer | Test query parameter(s)
[**testQueryStyleFormExplodeFalseArrayString**](QueryApi.md#testQueryStyleFormExplodeFalseArrayString) | **GET** /query/style_form/explode_false/array_string | Test query parameter(s)
[**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
[**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
[**testQueryStyleFormExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
# **deprecatedTest**
> string deprecatedTest()
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiDeprecatedTestRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiDeprecatedTestRequest = {
// name of pet (optional)
name: "name_example",
};
const data = await apiInstance.deprecatedTest(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | [**string**] | name of pet | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testEnumRefString**
> string testEnumRefString()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestEnumRefStringRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestEnumRefStringRequest = {
enumNonrefStringQuery: "success",
enumRefStringQuery: "success",
};
const data = await apiInstance.testEnumRefString(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumNonrefStringQuery** | [**&#39;success&#39; | &#39;failure&#39; | &#39;unclassified&#39;**]**Array<&#39;success&#39; &#124; &#39;failure&#39; &#124; &#39;unclassified&#39;>** | | (optional) defaults to undefined
**enumRefStringQuery** | **StringEnumRef** | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testQueryDatetimeDateString**
> string testQueryDatetimeDateString()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestQueryDatetimeDateStringRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestQueryDatetimeDateStringRequest = {
datetimeQuery: new Date('1970-01-01T00:00:00.00Z'),
dateQuery: new Date('1970-01-01').toISOString().split('T')[0];,
stringQuery: "string_query_example",
};
const data = await apiInstance.testQueryDatetimeDateString(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**datetimeQuery** | [**Date**] | | (optional) defaults to undefined
**dateQuery** | [**string**] | | (optional) defaults to undefined
**stringQuery** | [**string**] | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testQueryIntegerBooleanString**
> string testQueryIntegerBooleanString()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestQueryIntegerBooleanStringRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestQueryIntegerBooleanStringRequest = {
integerQuery: 1,
booleanQuery: true,
stringQuery: "string_query_example",
};
const data = await apiInstance.testQueryIntegerBooleanString(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**integerQuery** | [**number**] | | (optional) defaults to undefined
**booleanQuery** | [**boolean**] | | (optional) defaults to undefined
**stringQuery** | [**string**] | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testQueryStyleDeepObjectExplodeTrueObject**
> string testQueryStyleDeepObjectExplodeTrueObject()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestQueryStyleDeepObjectExplodeTrueObjectRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestQueryStyleDeepObjectExplodeTrueObjectRequest = {
queryObject: {
id: 10,
name: "doggie",
category: {
id: 1,
name: "Dogs",
},
photoUrls: [
"photoUrls_example",
],
tags: [
{
id: 1,
name: "name_example",
},
],
status: "available",
},
};
const data = await apiInstance.testQueryStyleDeepObjectExplodeTrueObject(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**queryObject** | **Pet** | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testQueryStyleDeepObjectExplodeTrueObjectAllOf**
> string testQueryStyleDeepObjectExplodeTrueObjectAllOf()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestQueryStyleDeepObjectExplodeTrueObjectAllOfRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestQueryStyleDeepObjectExplodeTrueObjectAllOfRequest = {
queryObject: null,
};
const data = await apiInstance.testQueryStyleDeepObjectExplodeTrueObjectAllOf(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**queryObject** | **TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter** | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testQueryStyleFormExplodeFalseArrayInteger**
> string testQueryStyleFormExplodeFalseArrayInteger()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestQueryStyleFormExplodeFalseArrayIntegerRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestQueryStyleFormExplodeFalseArrayIntegerRequest = {
queryObject: [
1,
],
};
const data = await apiInstance.testQueryStyleFormExplodeFalseArrayInteger(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**queryObject** | **Array&lt;number&gt;** | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testQueryStyleFormExplodeFalseArrayString**
> string testQueryStyleFormExplodeFalseArrayString()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestQueryStyleFormExplodeFalseArrayStringRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestQueryStyleFormExplodeFalseArrayStringRequest = {
queryObject: [
"query_object_example",
],
};
const data = await apiInstance.testQueryStyleFormExplodeFalseArrayString(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**queryObject** | **Array&lt;string&gt;** | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testQueryStyleFormExplodeTrueArrayString**
> string testQueryStyleFormExplodeTrueArrayString()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestQueryStyleFormExplodeTrueArrayStringRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestQueryStyleFormExplodeTrueArrayStringRequest = {
queryObject: {
values: [
"values_example",
],
},
};
const data = await apiInstance.testQueryStyleFormExplodeTrueArrayString(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**queryObject** | **TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter** | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testQueryStyleFormExplodeTrueObject**
> string testQueryStyleFormExplodeTrueObject()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestQueryStyleFormExplodeTrueObjectRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestQueryStyleFormExplodeTrueObjectRequest = {
queryObject: {
id: 10,
name: "doggie",
category: {
id: 1,
name: "Dogs",
},
photoUrls: [
"photoUrls_example",
],
tags: [
{
id: 1,
name: "name_example",
},
],
status: "available",
},
};
const data = await apiInstance.testQueryStyleFormExplodeTrueObject(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**queryObject** | **Pet** | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **testQueryStyleFormExplodeTrueObjectAllOf**
> string testQueryStyleFormExplodeTrueObjectAllOf()
Test query parameter(s)
### Example
```typescript
import { createConfiguration, QueryApi } from '';
import type { QueryApiTestQueryStyleFormExplodeTrueObjectAllOfRequest } from '';
const configuration = createConfiguration();
const apiInstance = new QueryApi(configuration);
const request: QueryApiTestQueryStyleFormExplodeTrueObjectAllOfRequest = {
queryObject: null,
};
const data = await apiInstance.testQueryStyleFormExplodeTrueObjectAllOf(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**queryObject** | **DataQuery** | | (optional) defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View File

@@ -78,7 +78,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);

View File

@@ -78,7 +78,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);

View File

@@ -1,23 +0,0 @@
# 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

View File

@@ -1,8 +0,0 @@
apis/TestApi.ts
apis/index.ts
index.ts
models/ExtendDto.ts
models/TestBaseDto.ts
models/TestObjectType.ts
models/index.ts
runtime.ts

View File

@@ -1,57 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Minimal
* Api to reproduce bug
*
* The version of the OpenAPI document: 0.5.1-SNAPSHOT.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
TestBaseDto,
} from '../models/index';
import {
TestBaseDtoFromJSON,
TestBaseDtoToJSON,
} from '../models/index';
/**
*
*/
export class TestApi extends runtime.BaseAPI {
/**
*/
async testRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TestBaseDto>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/api/v1/test`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TestBaseDtoFromJSON));
}
/**
*/
async test(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TestBaseDto>> {
const response = await this.testRaw(initOverrides);
return await response.value();
}
}

View File

@@ -1,3 +0,0 @@
/* tslint:disable */
/* eslint-disable */
export * from './TestApi';

View File

@@ -1,5 +0,0 @@
/* tslint:disable */
/* eslint-disable */
export * from './runtime';
export * from './apis/index';
export * from './models/index';

View File

@@ -1,82 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Minimal
* Api to reproduce bug
*
* The version of the OpenAPI document: 0.5.1-SNAPSHOT.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
import type { TestBaseDto } from './TestBaseDto';
import {
TestBaseDtoFromJSON,
TestBaseDtoFromJSONTyped,
TestBaseDtoToJSON,
TestBaseDtoToJSONTyped,
} from './TestBaseDto';
import type { TestObjectType } from './TestObjectType';
import {
TestObjectTypeFromJSON,
TestObjectTypeFromJSONTyped,
TestObjectTypeToJSON,
TestObjectTypeToJSONTyped,
} from './TestObjectType';
/**
*
* @export
* @interface ExtendDto
*/
export interface ExtendDto extends TestBaseDto {
/**
*
* @type {Array<TestBaseDto>}
* @memberof ExtendDto
*/
someItems?: Array<TestBaseDto>;
}
/**
* Check if a given object implements the ExtendDto interface.
*/
export function instanceOfExtendDto(value: object): value is ExtendDto {
return true;
}
export function ExtendDtoFromJSON(json: any): ExtendDto {
return ExtendDtoFromJSONTyped(json, false);
}
export function ExtendDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExtendDto {
if (json == null) {
return json;
}
return {
...TestBaseDtoFromJSONTyped(json, true),
'someItems': json['someItems'] == null ? undefined : ((json['someItems'] as Array<any>).map(TestBaseDtoFromJSON)),
};
}
export function ExtendDtoToJSON(json: any): ExtendDto {
return ExtendDtoToJSONTyped(json, false);
}
export function ExtendDtoToJSONTyped(value?: ExtendDto | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
...TestBaseDtoToJSONTyped(value, true),
'someItems': value['someItems'] == null ? undefined : ((value['someItems'] as Array<any>).map(TestBaseDtoToJSON)),
};
}

View File

@@ -1,102 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Minimal
* Api to reproduce bug
*
* The version of the OpenAPI document: 0.5.1-SNAPSHOT.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
import type { TestObjectType } from './TestObjectType';
import {
TestObjectTypeFromJSON,
TestObjectTypeFromJSONTyped,
TestObjectTypeToJSON,
TestObjectTypeToJSONTyped,
} from './TestObjectType';
import { type ExtendDto, ExtendDtoFromJSONTyped, ExtendDtoToJSON, ExtendDtoToJSONTyped } from './ExtendDto';
/**
*
* @export
* @interface TestBaseDto
*/
export interface TestBaseDto {
/**
*
* @type {string}
* @memberof TestBaseDto
*/
something?: string;
/**
*
* @type {TestObjectType}
* @memberof TestBaseDto
*/
testObjectType?: TestObjectType;
}
/**
* Check if a given object implements the TestBaseDto interface.
*/
export function instanceOfTestBaseDto(value: object): value is TestBaseDto {
return true;
}
export function TestBaseDtoFromJSON(json: any): TestBaseDto {
return TestBaseDtoFromJSONTyped(json, false);
}
export function TestBaseDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestBaseDto {
if (json == null) {
return json;
}
if (!ignoreDiscriminator) {
if (json['testObjectType'] === 'TEST2') {
return ExtendDtoFromJSONTyped(json, ignoreDiscriminator);
}
if (json['testObjectType'] === 'TEST1') {
return TestBaseDtoFromJSONTyped(json, true);
}
}
return {
'something': json['something'] == null ? undefined : json['something'],
'testObjectType': json['testObjectType'] == null ? undefined : TestObjectTypeFromJSON(json['testObjectType']),
};
}
export function TestBaseDtoToJSON(json: any): TestBaseDto {
return TestBaseDtoToJSONTyped(json, false);
}
export function TestBaseDtoToJSONTyped(value?: TestBaseDto | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
if (!ignoreDiscriminator) {
switch (value['testObjectType']) {
case 'TEST2':
return ExtendDtoToJSONTyped(value as ExtendDto, ignoreDiscriminator);
default:
return value;
}
}
return {
'something': value['something'],
'testObjectType': TestObjectTypeToJSON(value['testObjectType']),
};
}

View File

@@ -1,54 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Minimal
* Api to reproduce bug
*
* The version of the OpenAPI document: 0.5.1-SNAPSHOT.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
*/
export const TestObjectType = {
TEST1: 'TEST1',
TEST2: 'TEST2',
unknown_default_open_api: '11184809'
} as const;
export type TestObjectType = typeof TestObjectType[keyof typeof TestObjectType];
export function instanceOfTestObjectType(value: any): boolean {
for (const key in TestObjectType) {
if (Object.prototype.hasOwnProperty.call(TestObjectType, key)) {
if (TestObjectType[key as keyof typeof TestObjectType] === value) {
return true;
}
}
}
return false;
}
export function TestObjectTypeFromJSON(json: any): TestObjectType {
return TestObjectTypeFromJSONTyped(json, false);
}
export function TestObjectTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestObjectType {
return json as TestObjectType;
}
export function TestObjectTypeToJSON(value?: TestObjectType | null): any {
return value as any;
}
export function TestObjectTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): TestObjectType {
return value as TestObjectType;
}

View File

@@ -1,5 +0,0 @@
/* tslint:disable */
/* eslint-disable */
export * from './ExtendDto';
export * from './TestBaseDto';
export * from './TestObjectType';

View File

@@ -1,432 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Minimal
* Api to reproduce bug
*
* The version of the OpenAPI document: 0.5.1-SNAPSHOT.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, "");
export interface ConfigurationParameters {
basePath?: string; // override base path
fetchApi?: FetchAPI; // override for fetch implementation
middleware?: Middleware[]; // middleware to apply before/after fetch requests
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
username?: string; // parameter for basic security
password?: string; // parameter for basic security
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
headers?: HTTPHeaders; //header params we want to use on every request
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
}
export class Configuration {
constructor(private configuration: ConfigurationParameters = {}) {}
set config(configuration: Configuration) {
this.configuration = configuration;
}
get basePath(): string {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi(): FetchAPI | undefined {
return this.configuration.fetchApi;
}
get middleware(): Middleware[] {
return this.configuration.middleware || [];
}
get queryParamsStringify(): (params: HTTPQuery) => string {
return this.configuration.queryParamsStringify || querystring;
}
get username(): string | undefined {
return this.configuration.username;
}
get password(): string | undefined {
return this.configuration.password;
}
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === 'function' ? apiKey : () => apiKey;
}
return undefined;
}
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === 'function' ? accessToken : async () => accessToken;
}
return undefined;
}
get headers(): HTTPHeaders | undefined {
return this.configuration.headers;
}
get credentials(): RequestCredentials | undefined {
return this.configuration.credentials;
}
}
export const DefaultConfig = new Configuration();
/**
* This is the base class for all generated API classes.
*/
export class BaseAPI {
private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
private middleware: Middleware[];
constructor(protected configuration = DefaultConfig) {
this.middleware = configuration.middleware;
}
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
const next = this.clone<T>();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware<T>(...middlewares);
}
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware<T>(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
protected isJsonMime(mime: string | null | undefined): boolean {
if (!mime) {
return false;
}
return BaseAPI.jsonRegex.test(mime);
}
protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
const { url, init } = await this.createFetchParams(context, initOverrides);
const response = await this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, 'Response returned an error code');
}
private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
let url = this.configuration.basePath + context.path;
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
// only add the querystring to the URL if there are query parameters.
// this is done to avoid urls ending with a "?" character which buggy webservers
// do not handle correctly sometimes.
url += '?' + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
const initOverrideFn =
typeof initOverrides === "function"
? initOverrides
: async () => initOverrides;
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials,
};
const overriddenInit: RequestInit = {
...initParams,
...(await initOverrideFn({
init: initParams,
context,
}))
};
let body: any;
if (isFormData(overriddenInit.body)
|| (overriddenInit.body instanceof URLSearchParams)
|| isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers['Content-Type'])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init: RequestInit = {
...overriddenInit,
body
};
return { url, init };
}
private fetchApi = async (url: string, init: RequestInit) => {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = await middleware.pre({
fetch: this.fetchApi,
...fetchParams,
}) || fetchParams;
}
}
let response: Response | undefined = undefined;
try {
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = await middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : undefined,
}) || response;
}
}
if (response === undefined) {
if (e instanceof Error) {
throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = await middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone(),
}) || response;
}
}
return response;
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
private clone<T extends BaseAPI>(this: T): T {
const constructor = this.constructor as any;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
function isBlob(value: any): value is Blob {
return typeof Blob !== 'undefined' && value instanceof Blob;
}
function isFormData(value: any): value is FormData {
return typeof FormData !== "undefined" && value instanceof FormData;
}
export class ResponseError extends Error {
override name: "ResponseError" = "ResponseError";
constructor(public response: Response, msg?: string) {
super(msg);
}
}
export class FetchError extends Error {
override name: "FetchError" = "FetchError";
constructor(public cause: Error, msg?: string) {
super(msg);
}
}
export class RequiredError extends Error {
override name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) {
super(msg);
}
}
export const COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
export type Json = any;
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
export type HTTPHeaders = { [key: string]: string };
export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery };
export type HTTPBody = Json | FormData | URLSearchParams;
export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody };
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>
export interface FetchParams {
url: string;
init: RequestInit;
}
export interface RequestOpts {
path: string;
method: HTTPMethod;
headers: HTTPHeaders;
query?: HTTPQuery;
body?: HTTPBody;
}
export function querystring(params: HTTPQuery, prefix: string = ''): string {
return Object.keys(params)
.map(key => querystringSingleKey(key, params[key], prefix))
.filter(part => part.length > 0)
.join('&');
}
function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
.join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value as HTTPQuery, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
export function exists(json: any, key: string) {
const value = json[key];
return value !== null && value !== undefined;
}
export function mapValues(data: any, fn: (item: any) => any) {
const result: { [key: string]: any } = {};
for (const key of Object.keys(data)) {
result[key] = fn(data[key]);
}
return result;
}
export function canConsumeForm(consumes: Consume[]): boolean {
for (const consume of consumes) {
if ('multipart/form-data' === consume.contentType) {
return true;
}
}
return false;
}
export interface Consume {
contentType: string;
}
export interface RequestContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
}
export interface ResponseContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
response: Response;
}
export interface ErrorContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
error: unknown;
response?: Response;
}
export interface Middleware {
pre?(context: RequestContext): Promise<FetchParams | void>;
post?(context: ResponseContext): Promise<Response | void>;
onError?(context: ErrorContext): Promise<Response | void>;
}
export interface ApiResponse<T> {
raw: Response;
value(): Promise<T>;
}
export interface ResponseTransformer<T> {
(json: any): T;
}
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}
export class VoidApiResponse {
constructor(public raw: Response) {}
async value(): Promise<void> {
return undefined;
}
}
export class BlobApiResponse {
constructor(public raw: Response) {}
async value(): Promise<Blob> {
return await this.raw.blob();
};
}
export class TextApiResponse {
constructor(public raw: Response) {}
async value(): Promise<string> {
return await this.raw.text();
};
}

View File

@@ -71,7 +71,6 @@ export function AbstractUserDtoFromJSONTyped(json: any, ignoreDiscriminator: boo
if (json['type'] === 'remote-authenticated') {
return RemoteAuthenticatedUserDtoFromJSONTyped(json, ignoreDiscriminator);
}
}
return {

View File

@@ -1,12 +1,12 @@
.gitattributes
.gitignore
DefaultApi.md
README.md
apis/DefaultApi.ts
apis/baseapi.ts
apis/exception.ts
auth/auth.ts
configuration.ts
docs/DefaultApi.md
git_push.sh
http/http.ts
http/isomorphic-fetch.ts

View File

@@ -1,55 +0,0 @@
# .DefaultApi
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**list**](DefaultApi.md#list) | **GET** /list |
# **list**
> ListPaged list()
### Example
```typescript
import { createConfiguration, DefaultApi } from '';
const configuration = createConfiguration();
const apiInstance = new DefaultApi(configuration);
const request = {};
const data = await apiInstance.list(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
This endpoint does not need any parameter.
### Return type
**ListPaged**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View File

@@ -1,12 +1,12 @@
.gitattributes
.gitignore
DefaultApi.md
README.md
apis/DefaultApi.ts
apis/baseapi.ts
apis/exception.ts
auth/auth.ts
configuration.ts
docs/DefaultApi.md
git_push.sh
http/http.ts
http/isomorphic-fetch.ts

View File

@@ -1,55 +0,0 @@
# .DefaultApi
All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**uniqueItems**](DefaultApi.md#uniqueItems) | **GET** /unique-items |
# **uniqueItems**
> Response uniqueItems()
### Example
```typescript
import { createConfiguration, DefaultApi } from '';
const configuration = createConfiguration();
const apiInstance = new DefaultApi(configuration);
const request = {};
const data = await apiInstance.uniqueItems(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
This endpoint does not need any parameter.
### Return type
**Response**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View File

@@ -1,12 +1,12 @@
.gitattributes
.gitignore
DefaultApi.md
README.md
apis/DefaultApi.ts
apis/baseapi.ts
apis/exception.ts
auth/auth.ts
configuration.ts
docs/DefaultApi.md
git_push.sh
http/http.ts
http/isomorphic-fetch.ts

File diff suppressed because it is too large Load Diff

View File

@@ -138,4 +138,3 @@
</plugins>
</build>
</project>

View File

@@ -1,113 +0,0 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "tests",
"projects": {
"test-default": {
"root": "tests/default",
"sourceRoot": "tests/default/src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "tests/default/dist",
"index": "tests/default/src/index.html",
"main": "tests/default/src/main.ts",
"polyfills": "tests/default/src/polyfills.ts",
"tsConfig": "tests/default/src/tsconfig.app.json",
"assets": [
"tests/default/src/favicon.ico",
"tests/default/src/assets"
],
"styles": [
"tests/default/src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "tests/default/src/environments/environment.ts",
"with": "tests/default/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
},
"development": {}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
},
"configurations": {
"production": {
"browserTarget": "test-default:build:production"
},
"development": {
"browserTarget": "test-default:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "test-default:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "tests/default/src/test.ts",
"polyfills": "tests/default/src/polyfills.ts",
"tsConfig": "tests/default/src/tsconfig.spec.json",
"karmaConfig": "tests/default/src/karma.conf.js",
"styles": [
"tests/default/src/styles.css"
],
"scripts": [],
"assets": [
"tests/default/src/favicon.ico",
"tests/default/src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tests/default/src/tsconfig.app.json",
"tests/default/src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"cli": {
"analytics": false
}
}

View File

@@ -101,7 +101,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -162,7 +162,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -228,7 +228,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -295,7 +295,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -354,7 +354,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -424,7 +424,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -506,7 +506,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -592,7 +592,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);

View File

@@ -83,7 +83,7 @@ export class StoreService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -137,7 +137,7 @@ export class StoreService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -193,7 +193,7 @@ export class StoreService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -259,7 +259,7 @@ export class StoreService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);

View File

@@ -96,7 +96,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -163,7 +163,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -230,7 +230,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -287,7 +287,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -343,7 +343,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -410,7 +410,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -463,7 +463,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -534,7 +534,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);

View File

@@ -1,51 +0,0 @@
{
"name": "typescript-angular-v17-unit-tests",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"update": "ng update"
},
"private": true,
"dependencies": {
"@angular/animations": "^17.0.0",
"@angular/common": "^17.0.0",
"@angular/compiler": "^17.0.0",
"@angular/core": "^17.0.0",
"@angular/forms": "^17.0.0",
"@angular/platform-browser": "^17.0.0",
"@angular/platform-browser-dynamic": "^17.0.0",
"@angular/router": "^17.0.0",
"core-js": "^3.31.0",
"rxjs": "^7.8.1",
"tslib": "^2.5.3",
"zone.js": "~0.14.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.0.0",
"@angular/cli": "^17.0.0",
"@angular/compiler-cli": "^17.0.0",
"@angular/language-service": "^17.0.0",
"@types/jasmine": "~4.3.4",
"@types/jasminewd2": "~2.0.10",
"@types/node": "^18.16.18",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"eslint": "^8.43.0",
"eslint-config-standard-with-typescript": "^35.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"jasmine-core": "~5.0.1",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.2",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"ts-node": "~10.9.1",
"typescript": "^5.1.3"
}
}

View File

@@ -1,141 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>typescript-angular-v17-provided-in-root-tests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Typescript-Angular v17 Petstore Client</name>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>withnpmm-npm-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<basedir>builds/with-npm</basedir>
<arguments>
<argument>--legacy-peer-deps</argument>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>withnpmm-npm-run-build</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<basedir>builds/with-npm</basedir>
<arguments>
<argument>run</argument>
<argument>build</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>clean-typescript-angular-v16-test-outputs</id>
<goals>
<goal>clean</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>builds/with-npm</directory>
<followSymlinks>false</followSymlinks>
<useDefaultExcludes>false</useDefaultExcludes>
<includes>
<include>dist/**</include>
<include>node_modules/**</include>
<include>package-lock.json</include>
</includes>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>npm-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>npm-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>test</argument>
<argument>--</argument>
<argument>--progress=false</argument>
<argument>--no-watch</argument>
<argument>--browsers</argument>
<argument>ChromeHeadless</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,44 +0,0 @@
<div>
<h1>
Welcome to {{ title }}!
</h1>
</div>
<section id="pet-api">
<h2>Pet API</h2>
<button (click)="addPet()">
Add pet
</button>
<button (click)="getPetByID()">
Get pet by ID
</button>
<button (click)="updatePet()">
Update pet by ID
</button>
<button (click)="deletePet()">
Delete pet
</button>
</section>
<section id="pet">
<h2>Pet</h2>
<div *ngIf="pet">
<p>Name: {{ pet.name }}</p>
<p>ID: {{ pet.id }}</p>
</div>
</section>
<section id="store-api">
<h2>Store API</h2>
<button (click)="getStoreInventory()">
Get inventory
</button>
</section>
<section id="store">
<h2>Store</h2>
<ul *ngIf="store">
<li *ngFor="let item of store">{{item.key}}: {{item.number}}</li>
</ul>
</section>

View File

@@ -1,89 +0,0 @@
import { TestBed, waitForAsync } from '@angular/core/testing'
import { HttpClientModule } from '@angular/common/http'
import {
ApiModule,
Configuration,
type ConfigurationParameters,
PetService,
StoreService,
UserService
} from '@swagger/typescript-angular-petstore'
import { AppComponent } from './app.component'
import { fakePetstoreBackendProviders } from '../test/fakeBackend'
describe('AppComponent', () => {
const apiConfigurationParams: ConfigurationParameters = {
// add configuration params here
apiKeys: { api_key: 'foobar' }
}
const apiConfig = new Configuration(apiConfigurationParams)
const getApiConfig: () => Configuration = () => {
return apiConfig
}
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
AppComponent,
HttpClientModule,
ApiModule.forRoot(getApiConfig)
],
providers: [
PetService,
StoreService,
UserService,
...fakePetstoreBackendProviders
]
}).compileComponents()
}))
it('should create the app', waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent)
const app = fixture.debugElement.componentInstance
expect(app).toBeTruthy()
}))
it('should render title in a h1 tag', waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent)
fixture.detectChanges()
const compiled = fixture.debugElement.nativeElement
expect(compiled.querySelector('h1').textContent).toContain('Welcome to Typescript Angular v16 (provided in root)!')
}))
describe('constructor()', () => {
it('should have a petService provided', () => {
const petService = TestBed.inject(PetService)
expect(petService).toBeTruthy()
})
it('should have a storeService provided', () => {
const storeService = TestBed.inject(StoreService)
expect(storeService).toBeTruthy()
})
it('should have a userService provided', () => {
const userService = TestBed.inject(UserService)
expect(userService).toBeTruthy()
})
})
describe('addPet()', () => {
it('should add a new pet', () => {
const fixture = TestBed.createComponent(AppComponent)
const instance = fixture.componentInstance
const petService = TestBed.inject(PetService)
spyOn(petService, 'addPet').and.callThrough()
fixture.detectChanges()
instance.addPet()
expect(petService.addPet).toHaveBeenCalledWith({
name: 'pet',
photoUrls: []
})
})
})
})

View File

@@ -1,75 +0,0 @@
import { Component } from '@angular/core'
import {
PetService,
StoreService,
UserService,
type Pet
} from '@swagger/typescript-angular-petstore'
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Typescript Angular v16 (provided in root)'
pet: Pet
store: Array<{ key: string, number: number }>
constructor (private readonly petService: PetService,
private readonly storeService: StoreService,
private readonly userService: UserService
) {
this.pet = {
name: 'pet',
photoUrls: []
}
}
public addPet (): void {
this.petService.addPet(this.pet)
.subscribe((result: Pet) => {
this.pet = result
}
)
}
public getPetByID (): void {
if (this.pet.id !== undefined) {
this.petService.getPetById(this.pet.id)
.subscribe((result: Pet) => {
this.pet = result
}
)
}
}
public updatePet (): void {
this.petService.updatePet(this.pet)
.subscribe((result: Pet) => {
this.pet = result
}
)
}
public deletePet (): void {
if (this.pet.id !== undefined) {
this.petService.deletePet(this.pet.id)
.subscribe((result) => {
this.pet = result
}
)
}
}
public getStoreInventory (): void {
this.storeService.getInventory()
.subscribe((result) => {
this.store = []
for (const item in result) {
const number = result[item]
this.store.push({ key: item, number })
}
})
}
}

View File

@@ -1,32 +0,0 @@
import { BrowserModule } from '@angular/platform-browser'
import { NgModule } from '@angular/core'
import { HttpClientModule } from '@angular/common/http'
import {
ApiModule,
Configuration,
type ConfigurationParameters
} from '@swagger/typescript-angular-petstore'
import { AppComponent } from './app.component'
export const apiConfigurationParams: ConfigurationParameters = {
credentials: { api_key: 'foobar' }
}
export const apiConfig = new Configuration(apiConfigurationParams)
export function getApiConfig () {
return apiConfig
}
@NgModule({
imports: [
BrowserModule,
HttpClientModule,
ApiModule.forRoot(getApiConfig)
],
providers: [
],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@@ -1,3 +0,0 @@
export const environment = {
production: true
}

View File

@@ -1,15 +0,0 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false
}
/*
* In development mode, to ignore zone related error stack frames such as
* `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
* import the following file, but please comment it out in production mode
* because it will have performance impact when throw error
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -1,14 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cli</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>

View File

@@ -1,31 +0,0 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
})
}

View File

@@ -1,12 +0,0 @@
import { enableProdMode } from '@angular/core'
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
import { AppModule } from './app/app.module'
import { environment } from './environments/environment'
if (environment.production) {
enableProdMode()
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => { console.log(err) })

View File

@@ -1,62 +0,0 @@
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags.ts';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js' // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/

View File

@@ -1 +0,0 @@
/* You can add global styles to this file, and also import other style files */

View File

@@ -1,16 +0,0 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/testing'
import { getTestBed } from '@angular/core/testing'
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing'
declare const require: any
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
)

View File

@@ -1,145 +0,0 @@
import { TestBed, waitForAsync } from '@angular/core/testing'
import { HttpClientModule } from '@angular/common/http'
import {
ApiModule,
Configuration,
type ConfigurationParameters,
PetService,
StoreService,
UserService,
type Pet,
type User
} from '@swagger/typescript-angular-petstore'
import { fakePetstoreBackendProviders } from './fakeBackend'
import { switchMap } from 'rxjs/operators'
describe('API (functionality)', () => {
const getUser: () => User = () => {
const time = Date.now()
return {
username: `user-${time}`
}
}
const getPet: () => Pet = () => {
const time = Date.now()
return {
name: `pet-${time}`,
photoUrls: []
}
}
const newPet: Pet = getPet()
const newUser: User = getUser()
const apiConfigurationParams: ConfigurationParameters = {
// add configuration params here
apiKeys: { api_key: 'foobar' }
}
const apiConfig = new Configuration(apiConfigurationParams)
function getApiConfig (): Configuration {
return apiConfig
}
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
HttpClientModule,
ApiModule.forRoot(getApiConfig)
],
providers: [
PetService,
StoreService,
UserService,
...fakePetstoreBackendProviders
]
})
})
describe('PetService', () => {
it('should be provided', () => {
const petService = TestBed.inject(PetService)
expect(petService).toBeTruthy()
})
it('should add a pet', waitForAsync(() => {
const petService = TestBed.inject(PetService)
return petService.addPet(newPet).subscribe(
(result) => {
expect(result.id).toBeGreaterThan(0)
expect(result.name).toBe(newPet.name)
}
)
}))
it('should get the pet data by id', waitForAsync(() => {
const petService = TestBed.inject(PetService)
return petService.addPet(newPet).pipe(
switchMap((addedPet: Pet) => petService.getPetById(addedPet.id))
).subscribe(
result => {
expect(result.name).toBe(newPet.name)
}
)
}))
it('should update the pet name by pet object', waitForAsync(() => {
const petService = TestBed.inject(PetService)
return petService.addPet(newPet).pipe(
switchMap((addedPet: Pet) => petService.updatePet({
...addedPet,
name: 'something else'
}))
).subscribe(
result => { expect(result.name).toBe('something else') },
error => { fail(`expected a result, not the error: ${error.message}`) }
)
}))
it('should delete the pet', waitForAsync(() => {
const petService = TestBed.inject(PetService)
return petService.addPet(newPet).pipe(
switchMap((addedPet: Pet) => petService.deletePet(addedPet.id, undefined, 'response'))
).subscribe(
result => { expect(result.status).toEqual(200) }
)
}))
})
describe('StoreService', () => {
it('should be provided', () => {
const storeService = TestBed.inject(StoreService)
expect(storeService).toBeTruthy()
})
it('should get the inventory', waitForAsync(() => {
const storeService = TestBed.inject(StoreService)
return storeService.getInventory().subscribe(
result => { expect(result.mega).toBe(42) },
error => { fail(`expected a result, not the error: ${error.message}`) }
)
}))
})
describe('UserService', () => {
it('should be provided', () => {
const userService = TestBed.inject(UserService)
expect(userService).toBeTruthy()
})
it('should create the user', waitForAsync(() => {
const userService = TestBed.inject(UserService)
return userService.createUser(newUser, 'response').subscribe(
result => { expect(result.status).toEqual(200) }
)
}))
})
})

View File

@@ -1,61 +0,0 @@
import { TestBed, waitForAsync } from '@angular/core/testing'
import { HttpClient } from '@angular/common/http'
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'
import {
ApiModule,
PetService,
type Pet
} from '@swagger/typescript-angular-petstore'
import { BASE_PATH } from '../../../../builds/default/variables'
describe('API (basePath)', () => {
let httpClient: HttpClient
let httpTestingController: HttpTestingController
const pet: Pet = {
name: 'pet',
photoUrls: []
}
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
HttpClientTestingModule,
ApiModule
],
providers: [
PetService,
{ provide: BASE_PATH, useValue: '//test' }
]
})
// Inject the http service and test controller for each test
httpClient = TestBed.inject(HttpClient)
httpTestingController = TestBed.inject(HttpTestingController)
})
afterEach(() => {
// After every test, assert that there are no more pending requests.
httpTestingController.verify()
})
describe('PetService', () => {
it('should be provided', () => {
const petService = TestBed.inject(PetService)
expect(petService).toBeTruthy()
})
it('should call to the injected basePath //test/pet', waitForAsync(() => {
const petService = TestBed.inject(PetService)
petService.addPet(pet).subscribe(
async result => { await expect(result).toEqual(pet) },
error => { fail(`expected a result, not the error: ${error.message}`) }
)
const req = httpTestingController.expectOne('//test/pet')
expect(req.request.method).toEqual('POST')
req.flush(pet)
}))
})
})

View File

@@ -1,138 +0,0 @@
import { TestBed, waitForAsync } from '@angular/core/testing'
import { HttpClient } from '@angular/common/http'
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'
import {
ApiModule,
Configuration,
type ConfigurationParameters,
PetService,
type Pet
} from '@swagger/typescript-angular-petstore'
describe('API (with ConfigurationFactory)', () => {
let httpClient: HttpClient
let httpTestingController: HttpTestingController
const pet: Pet = {
name: 'pet',
photoUrls: []
}
const apiConfigurationParams: ConfigurationParameters = {
// add configuration params here
basePath: '//test-initial'
}
const apiConfig: Configuration = new Configuration(apiConfigurationParams)
const getApiConfig = () => {
return apiConfig
}
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
HttpClientTestingModule,
ApiModule.forRoot(getApiConfig)
],
providers: [
PetService
]
})
// Inject the http service and test controller for each test
httpClient = TestBed.inject(HttpClient)
httpTestingController = TestBed.inject(HttpTestingController)
})
afterEach(() => {
// After every test, assert that there are no more pending requests.
httpTestingController.verify()
})
describe('PetService', () => {
it('should be provided', () => {
const petService = TestBed.inject(PetService)
expect(petService).toBeTruthy()
})
it('should call initially configured basePath //test-initial/pet', waitForAsync(() => {
const petService = TestBed.inject(PetService)
petService.addPet(pet).subscribe(
async result => { await expect(result).toEqual(pet) },
error => { fail(`expected a result, not the error: ${error.message}`) }
)
const req = httpTestingController.expectOne('//test-initial/pet')
expect(req.request.method).toEqual('POST')
req.flush(pet)
}))
})
})
describe('API (with ConfigurationFactory and empty basePath)', () => {
let httpClient: HttpClient
let httpTestingController: HttpTestingController
const pet: Pet = {
name: 'pet',
photoUrls: []
}
const apiConfigurationParams: ConfigurationParameters = {
// add configuration params here
basePath: ''
}
const apiConfig: Configuration = new Configuration(apiConfigurationParams)
const getApiConfig = () => {
return apiConfig
}
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
HttpClientTestingModule,
ApiModule.forRoot(getApiConfig)
],
providers: [
PetService
]
})
// Inject the http service and test controller for each test
httpClient = TestBed.inject(HttpClient)
httpTestingController = TestBed.inject(HttpTestingController)
})
afterEach(() => {
// After every test, assert that there are no more pending requests.
httpTestingController.verify()
})
describe('PetService', () => {
it('should be provided', () => {
const petService = TestBed.inject(PetService)
expect(petService).toBeTruthy()
})
it('should call initially configured empty basePath /pet', waitForAsync(() => {
const petService = TestBed.inject(PetService)
petService.addPet(pet).subscribe(
async result => { await expect(result).toEqual(pet) },
error => { fail(`expected a result, not the error: ${error.message}`) }
)
const req = httpTestingController.expectOne('/pet')
expect(req.request.method).toEqual('POST')
req.flush(pet)
}))
})
})

View File

@@ -1,91 +0,0 @@
import { Injectable, type Provider } from '@angular/core'
import { Observable, type Observer } from 'rxjs'
import {
HTTP_INTERCEPTORS,
type HttpEvent,
HttpEventType,
type HttpHandler,
type HttpInterceptor,
type HttpRequest
} from '@angular/common/http'
import { TestRequest } from '@angular/common/http/testing'
import { type Pet } from '@swagger/typescript-angular-petstore'
@Injectable()
export class FakePetstoreBackendInterceptor implements HttpInterceptor {
private readonly fakePetstoreBackend = new FakePetstoreBackend()
constructor () {
}
intercept (req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const parsedUrl = new URL(req.url)
if (parsedUrl.pathname.indexOf('/v2/pet') === 0) {
if (req.method === 'GET') {
const pathParts = parsedUrl.pathname.split('/')
const petId = parseInt(pathParts[pathParts.length - 1], 10)
return this.respond(req, this.fakePetstoreBackend.getPet(petId))
} else if (req.method === 'POST') {
return this.respond(req, this.fakePetstoreBackend.addPet(req.body))
} else if (req.method === 'PUT') {
return this.respond(req, this.fakePetstoreBackend.updatePet(req.body))
} else if (req.method === 'DELETE') {
const pathParts = parsedUrl.pathname.split('/')
const petId = parseInt(pathParts[pathParts.length - 1], 10)
this.fakePetstoreBackend.deletePet(petId)
return this.respond(req, {})
}
} else if (parsedUrl.pathname.indexOf('/v2/store/inventory') === 0) {
if (req.method === 'GET') {
return this.respond(req, { mega: 42 })
}
} else if (parsedUrl.pathname.indexOf('/v2/user') === 0) {
if (req.method === 'POST') {
return this.respond(req, { mega: 42 })
}
}
throw new Error('Http call not implemented in fake backend. ' + req.url)
}
private respond (request: HttpRequest<any>, response: any): Observable<HttpEvent<any>> {
return new Observable((observer: Observer<any>) => {
const testReq = new TestRequest(request, observer)
observer.next({ type: HttpEventType.Sent } as HttpEvent<any>)
testReq.flush(response)
return () => { }
})
}
}
@Injectable()
class FakePetstoreBackend {
private nextId = 1
private readonly pets = new Map<string, Pet>()
public getPet (id: number): Pet {
return this.pets.get(String(id))
}
public addPet (pet: Pet): Pet {
const id = this.nextId++
this.pets.set(String(id), {
...pet,
id
})
return this.getPet(id)
}
public updatePet (pet: Pet): Pet {
this.pets.set(String(pet.id), pet)
return pet
}
public deletePet (id: number): void {
this.pets.delete(String(id))
}
}
export const fakePetstoreBackendProviders: Provider[] = [
{ provide: HTTP_INTERCEPTORS, useClass: FakePetstoreBackendInterceptor, multi: true }
]

View File

@@ -1,59 +0,0 @@
import { TestBed, waitForAsync } from '@angular/core/testing'
import { HttpClient } from '@angular/common/http'
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'
import {
ApiModule,
PetService,
type Pet
} from '@swagger/typescript-angular-petstore'
describe('API (no configuration)', () => {
let httpClient: HttpClient
let httpTestingController: HttpTestingController
const pet: Pet = {
name: 'pet',
photoUrls: []
}
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
HttpClientTestingModule,
ApiModule
],
providers: [
PetService
]
})
// Inject the http service and test controller for each test
httpClient = TestBed.inject(HttpClient)
httpTestingController = TestBed.inject(HttpTestingController)
})
afterEach(() => {
// After every test, assert that there are no more pending requests.
httpTestingController.verify()
})
describe('PetService', () => {
it('should be provided', () => {
const petService = TestBed.inject(PetService)
expect(petService).toBeTruthy()
})
it('should call to the default basePath http://petstore.swagger.io/v2/pet', waitForAsync(() => {
const petService = TestBed.inject(PetService)
petService.addPet(pet).subscribe(
async result => { await expect(result).toEqual(pet) },
error => { fail(`expected a result, not the error: ${error.message}`) }
)
const req = httpTestingController.expectOne('http://petstore.swagger.io/v2/pet')
expect(req.request.method).toEqual('POST')
req.flush(pet)
}))
})
})

View File

@@ -1,14 +0,0 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": []
},
"files": [
"main.ts",
"polyfills.ts"
],
"include": [
"tests/default/src/**/*.d.ts"
]
}

View File

@@ -1,18 +0,0 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"test.ts",
"polyfills.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

View File

@@ -1,17 +0,0 @@
{
"extends": "../../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
]
}
}

View File

@@ -1,25 +0,0 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"downlevelIteration": true,
"module": "es2022",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2022",
"typeRoots": [
"node_modules/@types"
],
"paths": {
"@swagger/typescript-angular-petstore": ["builds/default"]
},
"lib": [
"es2022",
"dom"
]
}
}

View File

@@ -1,129 +0,0 @@
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"deprecation": {
"severity": "warn"
},
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"no-output-on-prefix": true,
"no-inputs-metadata-property": true,
"no-outputs-metadata-property": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-output-rename": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
}
}

View File

@@ -1,113 +0,0 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "tests",
"projects": {
"test-default": {
"root": "tests/default",
"sourceRoot": "tests/default/src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "tests/default/dist",
"index": "tests/default/src/index.html",
"main": "tests/default/src/main.ts",
"polyfills": "tests/default/src/polyfills.ts",
"tsConfig": "tests/default/src/tsconfig.app.json",
"assets": [
"tests/default/src/favicon.ico",
"tests/default/src/assets"
],
"styles": [
"tests/default/src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "tests/default/src/environments/environment.ts",
"with": "tests/default/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
},
"development": {}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
},
"configurations": {
"production": {
"browserTarget": "test-default:build:production"
},
"development": {
"browserTarget": "test-default:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "test-default:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "tests/default/src/test.ts",
"polyfills": "tests/default/src/polyfills.ts",
"tsConfig": "tests/default/src/tsconfig.spec.json",
"karmaConfig": "tests/default/src/karma.conf.js",
"styles": [
"tests/default/src/styles.css"
],
"scripts": [],
"assets": [
"tests/default/src/favicon.ico",
"tests/default/src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tests/default/src/tsconfig.app.json",
"tests/default/src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"cli": {
"analytics": false
}
}

View File

@@ -101,7 +101,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -162,7 +162,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -228,7 +228,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -295,7 +295,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -354,7 +354,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -424,7 +424,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -506,7 +506,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -592,7 +592,7 @@ export class PetService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);

View File

@@ -83,7 +83,7 @@ export class StoreService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -137,7 +137,7 @@ export class StoreService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -193,7 +193,7 @@ export class StoreService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -259,7 +259,7 @@ export class StoreService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);

View File

@@ -96,7 +96,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -163,7 +163,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -230,7 +230,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -287,7 +287,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -343,7 +343,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -410,7 +410,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -463,7 +463,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
@@ -534,7 +534,7 @@ export class UserService extends BaseService {
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);

View File

@@ -1,51 +0,0 @@
{
"name": "typescript-angular-v18-unit-tests",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"update": "ng update"
},
"private": true,
"dependencies": {
"@angular/animations": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/compiler": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/forms": "^18.0.0",
"@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/router": "^18.0.0",
"core-js": "^3.31.0",
"rxjs": "^7.8.1",
"tslib": "^2.5.3",
"zone.js": "~0.14.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.0.0",
"@angular/cli": "^18.0.0",
"@angular/compiler-cli": "^18.0.0",
"@angular/language-service": "^18.0.0",
"@types/jasmine": "~4.3.4",
"@types/jasminewd2": "~2.0.10",
"@types/node": "^18.16.18",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"eslint": "^8.43.0",
"eslint-config-standard-with-typescript": "^35.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"jasmine-core": "~5.0.1",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.2",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"ts-node": "~10.9.1",
"typescript": "^5.1.3"
}
}

View File

@@ -1,141 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>typescript-angular-v18-provided-in-root-tests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Typescript-Angular v18 Petstore Client</name>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>withnpmm-npm-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<basedir>builds/with-npm</basedir>
<arguments>
<argument>--legacy-peer-deps</argument>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>withnpmm-npm-run-build</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<basedir>builds/with-npm</basedir>
<arguments>
<argument>run</argument>
<argument>build</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>clean-typescript-angular-v16-test-outputs</id>
<goals>
<goal>clean</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>builds/with-npm</directory>
<followSymlinks>false</followSymlinks>
<useDefaultExcludes>false</useDefaultExcludes>
<includes>
<include>dist/**</include>
<include>node_modules/**</include>
<include>package-lock.json</include>
</includes>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>npm-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>npm-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>test</argument>
<argument>--</argument>
<argument>--progress=false</argument>
<argument>--no-watch</argument>
<argument>--browsers</argument>
<argument>ChromeHeadless</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,44 +0,0 @@
<div>
<h1>
Welcome to {{ title }}!
</h1>
</div>
<section id="pet-api">
<h2>Pet API</h2>
<button (click)="addPet()">
Add pet
</button>
<button (click)="getPetByID()">
Get pet by ID
</button>
<button (click)="updatePet()">
Update pet by ID
</button>
<button (click)="deletePet()">
Delete pet
</button>
</section>
<section id="pet">
<h2>Pet</h2>
<div *ngIf="pet">
<p>Name: {{ pet.name }}</p>
<p>ID: {{ pet.id }}</p>
</div>
</section>
<section id="store-api">
<h2>Store API</h2>
<button (click)="getStoreInventory()">
Get inventory
</button>
</section>
<section id="store">
<h2>Store</h2>
<ul *ngIf="store">
<li *ngFor="let item of store">{{item.key}}: {{item.number}}</li>
</ul>
</section>

View File

@@ -1,89 +0,0 @@
import { TestBed, waitForAsync } from '@angular/core/testing'
import { HttpClientModule } from '@angular/common/http'
import {
ApiModule,
Configuration,
type ConfigurationParameters,
PetService,
StoreService,
UserService
} from '@swagger/typescript-angular-petstore'
import { AppComponent } from './app.component'
import { fakePetstoreBackendProviders } from '../test/fakeBackend'
describe('AppComponent', () => {
const apiConfigurationParams: ConfigurationParameters = {
// add configuration params here
apiKeys: { api_key: 'foobar' }
}
const apiConfig = new Configuration(apiConfigurationParams)
const getApiConfig: () => Configuration = () => {
return apiConfig
}
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
AppComponent,
HttpClientModule,
ApiModule.forRoot(getApiConfig)
],
providers: [
PetService,
StoreService,
UserService,
...fakePetstoreBackendProviders
]
}).compileComponents()
}))
it('should create the app', waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent)
const app = fixture.debugElement.componentInstance
expect(app).toBeTruthy()
}))
it('should render title in a h1 tag', waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent)
fixture.detectChanges()
const compiled = fixture.debugElement.nativeElement
expect(compiled.querySelector('h1').textContent).toContain('Welcome to Typescript Angular v16 (provided in root)!')
}))
describe('constructor()', () => {
it('should have a petService provided', () => {
const petService = TestBed.inject(PetService)
expect(petService).toBeTruthy()
})
it('should have a storeService provided', () => {
const storeService = TestBed.inject(StoreService)
expect(storeService).toBeTruthy()
})
it('should have a userService provided', () => {
const userService = TestBed.inject(UserService)
expect(userService).toBeTruthy()
})
})
describe('addPet()', () => {
it('should add a new pet', () => {
const fixture = TestBed.createComponent(AppComponent)
const instance = fixture.componentInstance
const petService = TestBed.inject(PetService)
spyOn(petService, 'addPet').and.callThrough()
fixture.detectChanges()
instance.addPet()
expect(petService.addPet).toHaveBeenCalledWith({
name: 'pet',
photoUrls: []
})
})
})
})

View File

@@ -1,75 +0,0 @@
import { Component } from '@angular/core'
import {
PetService,
StoreService,
UserService,
type Pet
} from '@swagger/typescript-angular-petstore'
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Typescript Angular v16 (provided in root)'
pet: Pet
store: Array<{ key: string, number: number }>
constructor (private readonly petService: PetService,
private readonly storeService: StoreService,
private readonly userService: UserService
) {
this.pet = {
name: 'pet',
photoUrls: []
}
}
public addPet (): void {
this.petService.addPet(this.pet)
.subscribe((result: Pet) => {
this.pet = result
}
)
}
public getPetByID (): void {
if (this.pet.id !== undefined) {
this.petService.getPetById(this.pet.id)
.subscribe((result: Pet) => {
this.pet = result
}
)
}
}
public updatePet (): void {
this.petService.updatePet(this.pet)
.subscribe((result: Pet) => {
this.pet = result
}
)
}
public deletePet (): void {
if (this.pet.id !== undefined) {
this.petService.deletePet(this.pet.id)
.subscribe((result) => {
this.pet = result
}
)
}
}
public getStoreInventory (): void {
this.storeService.getInventory()
.subscribe((result) => {
this.store = []
for (const item in result) {
const number = result[item]
this.store.push({ key: item, number })
}
})
}
}

Some files were not shown because too many files have changed in this diff Show More