Skip to content

Commit b4600b3

Browse files
committed
update workflow, samples
1 parent 561258c commit b4600b3

195 files changed

Lines changed: 441 additions & 12052 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/samples-dart-build-test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- samples/openapi3/client/petstore/dart-dio/oneof/**
1111
- samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/**
1212
- samples/openapi3/client/petstore/dart-dio/binary_response/**
13-
- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/**
13+
- samples/openapi3/client/petstore/dart-dio/petstore-timemachine/**
1414
pull_request:
1515
paths:
1616
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/**
@@ -19,7 +19,7 @@ on:
1919
- samples/openapi3/client/petstore/dart-dio/oneof/**
2020
- samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/**
2121
- samples/openapi3/client/petstore/dart-dio/binary_response/**
22-
- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/**
22+
- samples/openapi3/client/petstore/dart-dio/petstore-timemachine/**
2323

2424
jobs:
2525
test:
@@ -35,7 +35,7 @@ jobs:
3535
- samples/openapi3/client/petstore/dart-dio/oneof/
3636
- samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/
3737
- samples/openapi3/client/petstore/dart-dio/binary_response/
38-
- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/
38+
- samples/openapi3/client/petstore/dart-dio/petstore-timemachine/
3939
steps:
4040
- uses: actions/checkout@v5
4141

bin/configs/dart-dio-petstore-client-lib-fake-timemachine.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generatorName: dart-dio
2-
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine
3-
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
2+
outputDir: samples/openapi3/client/petstore/dart-dio/petstore-timemachine
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
44
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
55
typeMappings:
66
Client: "ModelClient"

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/.gitignore renamed to samples/openapi3/client/petstore/dart-dio/petstore-timemachine/.gitignore

File renamed without changes.

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/.openapi-generator-ignore renamed to samples/openapi3/client/petstore/dart-dio/petstore-timemachine/.openapi-generator-ignore

File renamed without changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.gitignore
2+
README.md
3+
analysis_options.yaml
4+
doc/ApiResponse.md
5+
doc/Category.md
6+
doc/Order.md
7+
doc/Pet.md
8+
doc/PetApi.md
9+
doc/StoreApi.md
10+
doc/Tag.md
11+
doc/User.md
12+
doc/UserApi.md
13+
lib/openapi.dart
14+
lib/src/api.dart
15+
lib/src/api/pet_api.dart
16+
lib/src/api/store_api.dart
17+
lib/src/api/user_api.dart
18+
lib/src/api_util.dart
19+
lib/src/auth/api_key_auth.dart
20+
lib/src/auth/auth.dart
21+
lib/src/auth/basic_auth.dart
22+
lib/src/auth/bearer_auth.dart
23+
lib/src/auth/oauth.dart
24+
lib/src/model/api_response.dart
25+
lib/src/model/category.dart
26+
lib/src/model/order.dart
27+
lib/src/model/pet.dart
28+
lib/src/model/tag.dart
29+
lib/src/model/user.dart
30+
lib/src/offset_date_serializer.dart
31+
lib/src/serializers.dart
32+
pubspec.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.16.0-SNAPSHOT
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# openapi (EXPERIMENTAL)
2+
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
3+
4+
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
5+
6+
- API version: 1.0.0
7+
- Generator version: 7.16.0-SNAPSHOT
8+
- Build package: org.openapitools.codegen.languages.DartDioClientCodegen
9+
10+
## Requirements
11+
12+
* Dart 2.15.0+ or Flutter 2.8.0+
13+
* Dio 5.0.0+ (https://pub.dev/packages/dio)
14+
* timemachine option currently **DOES NOT** support sound null-safety and may not work
15+
16+
## Installation & Usage
17+
18+
### pub.dev
19+
To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml
20+
```yaml
21+
dependencies:
22+
openapi: 1.0.0
23+
```
24+
25+
### Github
26+
If this Dart package is published to Github, please include the following in pubspec.yaml
27+
```yaml
28+
dependencies:
29+
openapi:
30+
git:
31+
url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
32+
#ref: main
33+
```
34+
35+
### Local development
36+
To use the package from your local drive, please include the following in pubspec.yaml
37+
```yaml
38+
dependencies:
39+
openapi:
40+
path: /path/to/openapi
41+
```
42+
43+
## Getting Started
44+
45+
Please follow the [installation procedure](#installation--usage) and then run the following:
46+
47+
```dart
48+
import 'package:openapi/openapi.dart';
49+
50+
51+
final api = Openapi().getPetApi();
52+
final Pet pet = ; // Pet | Pet object that needs to be added to the store
53+
54+
try {
55+
final response = await api.addPet(pet);
56+
print(response);
57+
} catch on DioException (e) {
58+
print("Exception when calling PetApi->addPet: $e\n");
59+
}
60+
61+
```
62+
63+
## Documentation for API Endpoints
64+
65+
All URIs are relative to *http://petstore.swagger.io/v2*
66+
67+
Class | Method | HTTP request | Description
68+
------------ | ------------- | ------------- | -------------
69+
[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
70+
[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
71+
[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
72+
[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
73+
[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
74+
[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
75+
[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
76+
[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
77+
[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
78+
[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
79+
[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
80+
[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
81+
[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user
82+
[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
83+
[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
84+
[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
85+
[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
86+
[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
87+
[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
88+
[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
89+
90+
91+
## Documentation For Models
92+
93+
- [ApiResponse](doc/ApiResponse.md)
94+
- [Category](doc/Category.md)
95+
- [Order](doc/Order.md)
96+
- [Pet](doc/Pet.md)
97+
- [Tag](doc/Tag.md)
98+
- [User](doc/User.md)
99+
100+
101+
## Documentation For Authorization
102+
103+
104+
Authentication schemes defined for the API:
105+
### petstore_auth
106+
107+
- **Type**: OAuth
108+
- **Flow**: implicit
109+
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
110+
- **Scopes**:
111+
- **write:pets**: modify pets in your account
112+
- **read:pets**: read your pets
113+
114+
### api_key
115+
116+
- **Type**: API key
117+
- **API key parameter name**: api_key
118+
- **Location**: HTTP header
119+
120+
121+
## Author
122+
123+
124+

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/analysis_options.yaml renamed to samples/openapi3/client/petstore/dart-dio/petstore-timemachine/analysis_options.yaml

File renamed without changes.

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/doc/ApiResponse.md renamed to samples/openapi3/client/petstore/dart-dio/petstore-timemachine/doc/ApiResponse.md

File renamed without changes.

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/doc/Category.md renamed to samples/openapi3/client/petstore/dart-dio/petstore-timemachine/doc/Category.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:openapi/api.dart';
99
Name | Type | Description | Notes
1010
------------ | ------------- | ------------- | -------------
1111
**id** | **int** | | [optional]
12-
**name** | **String** | | [default to 'default-name']
12+
**name** | **String** | | [optional]
1313

1414
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1515

0 commit comments

Comments
 (0)