Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !9857

[typescript] FIX: Generate documentation and examples

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/NouemanKHAL/noueman/typescript-doc-generation into master 4 years ago
  • Overview 0
  • Commits 5
  • Pipelines 0
  • Changes 27

Created by: NouemanKHAL

Fix to the PR: https://github.com/OpenAPITools/openapi-generator/pull/9413

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    Commit all changed files. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
Compare
  • master (base)

and
  • latest version
    fa79ce52
    5 commits, 2 years ago

27 files
+ 6876
- 0

    Preferences

    File browser
    Compare changes
bin/c‎onfigs‎
typescript-conso‎lidated-deno.yaml‎ +2 -0
typescript-consolid‎ated-inversify.yaml‎ +2 -0
typescript-consol‎idated-jquery.yaml‎ +2 -0
typescript-consolidated-n‎ode-object-parameters.yaml‎ +2 -0
typescript-conso‎lidated-node.yaml‎ +2 -0
modules/openapi-g‎enerator/src/main‎
java/org/openapitoo‎ls/codegen/languages‎
TypeScriptClie‎ntCodegen.java‎ +632 -0
resources/‎typescript‎
api_doc.‎mustache‎ +84 -0
samples/openapi3/…/‎…/typescript/builds‎
def‎ault‎
.openapi-‎generator‎
FI‎LES‎ +3 -0
PetA‎pi.md‎ +505 -0
Store‎Api.md‎ +233 -0
UserA‎pi.md‎ +489 -0
de‎no‎
.openapi-‎generator‎
FI‎LES‎ +3 -0
PetA‎pi.md‎ +505 -0
Store‎Api.md‎ +233 -0
UserA‎pi.md‎ +489 -0
inve‎rsify‎
.openapi-‎generator‎
FI‎LES‎ +3 -0
PetA‎pi.md‎ +505 -0
Store‎Api.md‎ +233 -0
UserA‎pi.md‎ +489 -0
jqu‎ery‎
.openapi-‎generator‎
FI‎LES‎ +3 -0
PetA‎pi.md‎ +505 -0
Store‎Api.md‎ +233 -0
UserA‎pi.md‎ +489 -0
object‎_params‎
.openapi-‎generator‎
FI‎LES‎ +3 -0
PetA‎pi.md‎ +505 -0
Store‎Api.md‎ +233 -0
UserA‎pi.md‎ +489 -0
bin/configs/typescript-consolidated-deno.yaml
+ 2
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE


@@ -4,3 +4,5 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
additionalProperties:
platform: deno
npmName: ts-petstore-client
projectName: ts-petstore-client
moduleName: petstore
bin/configs/typescript-consolidated-inversify.yaml
+ 2
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE


@@ -5,3 +5,5 @@ additionalProperties:
platform: node
npmName: ts-petstore-client
useInversify: true
projectName: ts-petstore-client
moduleName: petstore
bin/configs/typescript-consolidated-jquery.yaml
+ 2
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE


@@ -4,3 +4,5 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
additionalProperties:
framework: jquery
npmName: ts-petstore-client
projectName: ts-petstore-client
moduleName: petstore
bin/configs/typescript-consolidated-node-object-parameters.yaml
+ 2
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE


@@ -5,3 +5,5 @@ additionalProperties:
platform: node
npmName: ts-petstore-client
useObjectParameters: true
projectName: ts-petstore-client
moduleName: petstore
bin/configs/typescript-consolidated-node.yaml
+ 2
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE


@@ -4,3 +4,5 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
additionalProperties:
platform: node
npmName: ts-petstore-client
projectName: ts-petstore-client
moduleName: petstore
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java
+ 632
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE

Files with large changes are collapsed by default.

modules/openapi-generator/src/main/resources/typescript/api_doc.mustache 0 → 100644
+ 84
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE

# {{moduleName}}.{{classname}}{{#description}}
{{description}}{{/description}}
All URIs are relative to *{{basePath}}*
Method | HTTP request | Description
------------- | ------------- | -------------
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
{{/operation}}{{/operations}}
{{#operations}}
{{#operation}}
# **{{{operationId}}}**
> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}})
{{#notes}}
{{{notes}}}
{{/notes}}
### Example
```typescript
import { {{{moduleName}}} } from '{{{projectName}}}';
import * as fs from 'fs';
const configuration = {{{moduleName}}}.createConfiguration();
const apiInstance = new {{{moduleName}}}.{{classname}}(configuration);
{{#hasParams}}
let body:{{{moduleName}}}.{{classname}}{{operationIdCamelCase}}Request = {
{{#allParams}}
// {{{dataType}}}{{#description}} | {{{description}}}{{/description}}{{^required}} (optional){{/required}}
{{paramName}}: {{{example}}},
{{/allParams}}
};
{{/hasParams}}
{{^hasParams}}
let body:any = {};
{{/hasParams}}
apiInstance.{{{operationId}}}(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
{{^hasParams}}This endpoint does not need any parameter.{{/hasParams}}{{#allParams}}{{#-last}}
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
{{#allParams}}{{^defaultValue}} **{{paramName}}** | {{^isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}| {{description}} |
{{/defaultValue}}{{/allParams}}{{#allParams}}{{#defaultValue}} **{{paramName}}** | {{^isPrimitiveType}}{{^isEnum}}**{{dataType}}**{{/isEnum}}{{/isPrimitiveType}}{{#isPrimitiveType}}[**{{dataType}}**]{{/isPrimitiveType}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}{{#-first}}**Array<{{/-first}}{{value}}{{^-last}} &#124; {{/-last}}{{#-last}}>**{{/-last}}{{/enumVars}}{{/allowableValues}}{{/isEnum}} | {{description}} |{{^required}} (optional){{/required}} defaults to {{{.}}}
{{/defaultValue}}{{/allParams}}
### Return type
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
### Authorization
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
### HTTP request headers
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
{{#responses.0}}
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
{{#responses}}
**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}} <br> {{/headers}}{{^headers.0}} - {{/headers.0}} |
{{/responses}}
{{/responses.0}}
[[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)
{{/operation}}
{{/operations}}
samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/FILES
+ 3
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE


.gitignore
PetApi.md
README.md
StoreApi.md
UserApi.md
apis/PetApi.ts
apis/StoreApi.ts
apis/UserApi.ts
samples/openapi3/client/petstore/typescript/builds/default/PetApi.md 0 → 100644
+ 505
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE

# petstore.PetApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
# **addPet**
> Pet addPet(pet)
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.PetApi(configuration);
let body:petstore.PetApiAddPetRequest = {
// Pet | Pet object that needs to be added to the store
pet: {
id: 1,
category: {
id: 1,
name: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
},
name: "doggie",
photoUrls: [
"photoUrls_example",
],
tags: [
{
id: 1,
name: "name_example",
},
],
status: "available",
},
};
apiInstance.addPet(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | **Pet**| Pet object that needs to be added to the store |
### Return type
**Pet**
### Authorization
[petstore_auth](README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**405** | Invalid input | - |
[[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)
# **deletePet**
> deletePet()
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.PetApi(configuration);
let body:petstore.PetApiDeletePetRequest = {
// number | Pet id to delete
petId: 1,
// string (optional)
apiKey: "api_key_example",
};
apiInstance.deletePet(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | [**number**] | Pet id to delete | defaults to undefined
**apiKey** | [**string**] | | (optional) defaults to undefined
### Return type
void (empty response body)
### Authorization
[petstore_auth](README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**400** | Invalid pet value | - |
[[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)
# **findPetsByStatus**
> Array<Pet> findPetsByStatus()
Multiple status values can be provided with comma separated strings
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.PetApi(configuration);
let body:petstore.PetApiFindPetsByStatusRequest = {
// Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter
status: [
"available",
],
};
apiInstance.findPetsByStatus(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | **Array<&#39;available&#39; &#124; &#39;pending&#39; &#124; &#39;sold&#39;>** | Status values that need to be considered for filter | defaults to undefined
### Return type
**Array<Pet>**
### Authorization
[petstore_auth](README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**400** | Invalid status value | - |
[[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)
# **findPetsByTags**
> Array<Pet> findPetsByTags()
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.PetApi(configuration);
let body:petstore.PetApiFindPetsByTagsRequest = {
// Array<string> | Tags to filter by
tags: [
"tags_example",
],
};
apiInstance.findPetsByTags(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | **Array&lt;string&gt;** | Tags to filter by | defaults to undefined
### Return type
**Array<Pet>**
### Authorization
[petstore_auth](README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**400** | Invalid tag value | - |
[[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)
# **getPetById**
> Pet getPetById()
Returns a single pet
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.PetApi(configuration);
let body:petstore.PetApiGetPetByIdRequest = {
// number | ID of pet to return
petId: 1,
};
apiInstance.getPetById(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | [**number**] | ID of pet to return | defaults to undefined
### Return type
**Pet**
### Authorization
[api_key](README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**400** | Invalid ID supplied | - |
**404** | Pet not found | - |
[[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)
# **updatePet**
> Pet updatePet(pet)
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.PetApi(configuration);
let body:petstore.PetApiUpdatePetRequest = {
// Pet | Pet object that needs to be added to the store
pet: {
id: 1,
category: {
id: 1,
name: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
},
name: "doggie",
photoUrls: [
"photoUrls_example",
],
tags: [
{
id: 1,
name: "name_example",
},
],
status: "available",
},
};
apiInstance.updatePet(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | **Pet**| Pet object that needs to be added to the store |
### Return type
**Pet**
### Authorization
[petstore_auth](README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**400** | Invalid ID supplied | - |
**404** | Pet not found | - |
**405** | Validation exception | - |
[[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)
# **updatePetWithForm**
> updatePetWithForm()
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.PetApi(configuration);
let body:petstore.PetApiUpdatePetWithFormRequest = {
// number | ID of pet that needs to be updated
petId: 1,
// string | Updated name of the pet (optional)
name: "name_example",
// string | Updated status of the pet (optional)
status: "status_example",
};
apiInstance.updatePetWithForm(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | [**number**] | ID of pet that needs to be updated | defaults to undefined
**name** | [**string**] | Updated name of the pet | (optional) defaults to undefined
**status** | [**string**] | Updated status of the pet | (optional) defaults to undefined
### Return type
void (empty response body)
### Authorization
[petstore_auth](README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**405** | Invalid input | - |
[[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)
# **uploadFile**
> ApiResponse uploadFile()
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.PetApi(configuration);
let body:petstore.PetApiUploadFileRequest = {
// number | ID of pet to update
petId: 1,
// string | Additional data to pass to server (optional)
additionalMetadata: "additionalMetadata_example",
// HttpFile | file to upload (optional)
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
};
apiInstance.uploadFile(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | [**number**] | ID of pet to update | defaults to undefined
**additionalMetadata** | [**string**] | Additional data to pass to server | (optional) defaults to undefined
**file** | [**HttpFile**] | file to upload | (optional) defaults to undefined
### Return type
**ApiResponse**
### Authorization
[petstore_auth](README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **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)
samples/openapi3/client/petstore/typescript/builds/default/StoreApi.md 0 → 100644
+ 233
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE

# petstore.StoreApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
# **deleteOrder**
> deleteOrder()
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.StoreApi(configuration);
let body:petstore.StoreApiDeleteOrderRequest = {
// string | ID of the order that needs to be deleted
orderId: "orderId_example",
};
apiInstance.deleteOrder(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | [**string**] | ID of the order that needs to be deleted | defaults to undefined
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**400** | Invalid ID supplied | - |
**404** | Order not found | - |
[[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)
# **getInventory**
> { [key: string]: number; } getInventory()
Returns a map of status codes to quantities
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.StoreApi(configuration);
let body:any = {};
apiInstance.getInventory(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
This endpoint does not need any parameter.
### Return type
**{ [key: string]: number; }**
### Authorization
[api_key](README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **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)
# **getOrderById**
> Order getOrderById()
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.StoreApi(configuration);
let body:petstore.StoreApiGetOrderByIdRequest = {
// number | ID of pet that needs to be fetched
orderId: 1,
};
apiInstance.getOrderById(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | [**number**] | ID of pet that needs to be fetched | defaults to undefined
### Return type
**Order**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**400** | Invalid ID supplied | - |
**404** | Order not found | - |
[[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)
# **placeOrder**
> Order placeOrder(order)
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.StoreApi(configuration);
let body:petstore.StoreApiPlaceOrderRequest = {
// Order | order placed for purchasing the pet
order: {
id: 1,
petId: 1,
quantity: 1,
shipDate: new Date('1970-01-01T00:00:00.00Z'),
status: "placed",
complete: false,
},
};
apiInstance.placeOrder(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**order** | **Order**| order placed for purchasing the pet |
### Return type
**Order**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**400** | Invalid Order | - |
[[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)
samples/openapi3/client/petstore/typescript/builds/default/UserApi.md 0 → 100644
+ 489
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE

# petstore.UserApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
# **createUser**
> createUser(user)
This can only be done by the logged in user.
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.UserApi(configuration);
let body:petstore.UserApiCreateUserRequest = {
// User | Created user object
user: {
id: 1,
username: "username_example",
firstName: "firstName_example",
lastName: "lastName_example",
email: "email_example",
password: "password_example",
phone: "phone_example",
userStatus: 1,
},
};
apiInstance.createUser(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | **User**| Created user object |
### Return type
void (empty response body)
### Authorization
[api_key](README.md#api_key)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**0** | 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)
# **createUsersWithArrayInput**
> createUsersWithArrayInput(user)
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.UserApi(configuration);
let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
// Array<User> | List of user object
user: [
{
id: 1,
username: "username_example",
firstName: "firstName_example",
lastName: "lastName_example",
email: "email_example",
password: "password_example",
phone: "phone_example",
userStatus: 1,
},
],
};
apiInstance.createUsersWithArrayInput(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | **Array<User>**| List of user object |
### Return type
void (empty response body)
### Authorization
[api_key](README.md#api_key)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**0** | 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)
# **createUsersWithListInput**
> createUsersWithListInput(user)
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.UserApi(configuration);
let body:petstore.UserApiCreateUsersWithListInputRequest = {
// Array<User> | List of user object
user: [
{
id: 1,
username: "username_example",
firstName: "firstName_example",
lastName: "lastName_example",
email: "email_example",
password: "password_example",
phone: "phone_example",
userStatus: 1,
},
],
};
apiInstance.createUsersWithListInput(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | **Array<User>**| List of user object |
### Return type
void (empty response body)
### Authorization
[api_key](README.md#api_key)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**0** | 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)
# **deleteUser**
> deleteUser()
This can only be done by the logged in user.
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.UserApi(configuration);
let body:petstore.UserApiDeleteUserRequest = {
// string | The name that needs to be deleted
username: "username_example",
};
apiInstance.deleteUser(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | [**string**] | The name that needs to be deleted | defaults to undefined
### Return type
void (empty response body)
### Authorization
[api_key](README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**400** | Invalid username supplied | - |
**404** | User not found | - |
[[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)
# **getUserByName**
> User getUserByName()
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.UserApi(configuration);
let body:petstore.UserApiGetUserByNameRequest = {
// string | The name that needs to be fetched. Use user1 for testing.
username: "username_example",
};
apiInstance.getUserByName(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | [**string**] | The name that needs to be fetched. Use user1 for testing. | defaults to undefined
### Return type
**User**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**400** | Invalid username supplied | - |
**404** | User not found | - |
[[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)
# **loginUser**
> string loginUser()
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.UserApi(configuration);
let body:petstore.UserApiLoginUserRequest = {
// string | The user name for login
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
// string | The password for login in clear text
password: "password_example",
};
apiInstance.loginUser(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | [**string**] | The user name for login | defaults to undefined
**password** | [**string**] | The password for login in clear text | defaults to undefined
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when toekn expires <br> |
**400** | Invalid username/password supplied | - |
[[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)
# **logoutUser**
> logoutUser()
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.UserApi(configuration);
let body:any = {};
apiInstance.logoutUser(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
This endpoint does not need any parameter.
### Return type
void (empty response body)
### Authorization
[api_key](README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**0** | 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)
# **updateUser**
> updateUser(user)
This can only be done by the logged in user.
### Example
```typescript
import { petstore } from 'ts-petstore-client';
import * as fs from 'fs';
const configuration = petstore.createConfiguration();
const apiInstance = new petstore.UserApi(configuration);
let body:petstore.UserApiUpdateUserRequest = {
// string | name that need to be deleted
username: "username_example",
// User | Updated user object
user: {
id: 1,
username: "username_example",
firstName: "firstName_example",
lastName: "lastName_example",
email: "email_example",
password: "password_example",
phone: "phone_example",
userStatus: 1,
},
};
apiInstance.updateUser(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | **User**| Updated user object |
**username** | [**string**] | name that need to be deleted | defaults to undefined
### Return type
void (empty response body)
### Authorization
[api_key](README.md#api_key)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**400** | Invalid user supplied | - |
**404** | User not found | - |
[[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)
samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/FILES
+ 3
- 0
  • View file @ fa79ce52

  • Edit in single-file editor

  • Open in Web IDE


.gitignore
PetApi.md
StoreApi.md
UserApi.md
apis/PetApi.ts
apis/StoreApi.ts
apis/UserApi.ts
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
3
Client: C-Sharp Enhancement: CI/Test Server: C-Sharp
3
Client: C-Sharp Enhancement: CI/Test Server: C-Sharp
    Assign labels
  • Manage project labels

Milestone
3.3.1
3.3.1 (expired)
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: OpenAPITools/openapi-generator!1238
Source branch: github/fork/NouemanKHAL/noueman/typescript-doc-generation

Menu

Explore Projects Groups Snippets