Skip to content

Commit 189df37

Browse files
committed
Add sample for serde-path-to-error
1 parent 99ad150 commit 189df37

71 files changed

Lines changed: 3906 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
generatorName: rust
2+
outputDir: samples/client/petstore/rust/reqwest/petstore-serde-path-to-error
3+
library: reqwest
4+
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml
5+
templateDir: modules/openapi-generator/src/main/resources/rust
6+
additionalProperties:
7+
packageName: petstore-reqwest
8+
useSerdePathToError: true
9+
enumNameMappings:
10+
delivered: shipped
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target/
2+
**/*.rs.bk
3+
Cargo.lock
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.gitignore
2+
.openapi-generator-ignore
3+
.travis.yml
4+
Cargo.toml
5+
README.md
6+
docs/ActionContainer.md
7+
docs/AnyTypeTest.md
8+
docs/ApiResponse.md
9+
docs/ArrayItemRefTest.md
10+
docs/Baz.md
11+
docs/Category.md
12+
docs/EnumArrayTesting.md
13+
docs/FakeApi.md
14+
docs/NullableArray.md
15+
docs/NumericEnumTesting.md
16+
docs/OptionalTesting.md
17+
docs/Order.md
18+
docs/Page.md
19+
docs/Person.md
20+
docs/Pet.md
21+
docs/PetApi.md
22+
docs/PropertyTest.md
23+
docs/Ref.md
24+
docs/Return.md
25+
docs/StoreApi.md
26+
docs/Tag.md
27+
docs/TestAllOfWithMultiMetadataOnly.md
28+
docs/TestingApi.md
29+
docs/TypeTesting.md
30+
docs/UniqueItemArrayTesting.md
31+
docs/User.md
32+
docs/UserApi.md
33+
docs/Vehicle.md
34+
docs/WithInnerOneOf.md
35+
git_push.sh
36+
src/apis/configuration.rs
37+
src/apis/fake_api.rs
38+
src/apis/mod.rs
39+
src/apis/pet_api.rs
40+
src/apis/store_api.rs
41+
src/apis/testing_api.rs
42+
src/apis/user_api.rs
43+
src/lib.rs
44+
src/models/action_container.rs
45+
src/models/any_type_test.rs
46+
src/models/api_response.rs
47+
src/models/array_item_ref_test.rs
48+
src/models/baz.rs
49+
src/models/category.rs
50+
src/models/enum_array_testing.rs
51+
src/models/mod.rs
52+
src/models/model_ref.rs
53+
src/models/model_return.rs
54+
src/models/nullable_array.rs
55+
src/models/numeric_enum_testing.rs
56+
src/models/optional_testing.rs
57+
src/models/order.rs
58+
src/models/page.rs
59+
src/models/person.rs
60+
src/models/pet.rs
61+
src/models/property_test.rs
62+
src/models/tag.rs
63+
src/models/test_all_of_with_multi_metadata_only.rs
64+
src/models/type_testing.rs
65+
src/models/unique_item_array_testing.rs
66+
src/models/user.rs
67+
src/models/vehicle.rs
68+
src/models/with_inner_one_of.rs
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.18.0-SNAPSHOT
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
language: rust
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = "petstore-reqwest"
3+
version = "1.0.0"
4+
authors = ["OpenAPI Generator team and contributors"]
5+
description = "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters."
6+
license = "Apache-2.0"
7+
edition = "2021"
8+
9+
[dependencies]
10+
serde = { version = "^1.0", features = ["derive"] }
11+
serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] }
12+
serde_json = "^1.0"
13+
serde_repr = "^0.1"
14+
serde_path_to_error = "^0.1"
15+
url = "^2.5"
16+
uuid = { version = "^1.8", features = ["serde", "v4"] }
17+
reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] }
18+
19+
[features]
20+
default = ["native-tls"]
21+
native-tls = ["reqwest/native-tls"]
22+
rustls-tls = ["reqwest/rustls-tls"]
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Rust API client for petstore-reqwest
2+
3+
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
4+
5+
6+
## Overview
7+
8+
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client.
9+
10+
- API version: 1.0.0
11+
- Package version: 1.0.0
12+
- Generator version: 7.18.0-SNAPSHOT
13+
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
14+
15+
## Installation
16+
17+
Put the package under your project folder in a directory named `petstore-reqwest` and add the following to `Cargo.toml` under `[dependencies]`:
18+
19+
```
20+
petstore-reqwest = { path = "./petstore-reqwest" }
21+
```
22+
23+
## Documentation for API Endpoints
24+
25+
All URIs are relative to *http://localhost/v2*
26+
27+
Class | Method | HTTP request | Description
28+
------------ | ------------- | ------------- | -------------
29+
*FakeApi* | [**test_nullable_required_param**](docs/FakeApi.md#test_nullable_required_param) | **GET** /fake/user/{user_name} | To test nullable required parameters
30+
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
31+
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
32+
*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
33+
*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
34+
*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
35+
*PetApi* | [**pets_explode_post**](docs/PetApi.md#pets_explode_post) | **POST** /pets/explode | List all pets
36+
*PetApi* | [**pets_post**](docs/PetApi.md#pets_post) | **POST** /pets | List all pets
37+
*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
38+
*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
39+
*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
40+
*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
41+
*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
42+
*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
43+
*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
44+
*TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500)
45+
*TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file
46+
*TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema
47+
*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
48+
*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
49+
*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
50+
*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
51+
*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
52+
*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system
53+
*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
54+
*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user
55+
56+
57+
## Documentation For Models
58+
59+
- [ActionContainer](docs/ActionContainer.md)
60+
- [AnyTypeTest](docs/AnyTypeTest.md)
61+
- [ApiResponse](docs/ApiResponse.md)
62+
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
63+
- [Baz](docs/Baz.md)
64+
- [Category](docs/Category.md)
65+
- [EnumArrayTesting](docs/EnumArrayTesting.md)
66+
- [NullableArray](docs/NullableArray.md)
67+
- [NumericEnumTesting](docs/NumericEnumTesting.md)
68+
- [OptionalTesting](docs/OptionalTesting.md)
69+
- [Order](docs/Order.md)
70+
- [Page](docs/Page.md)
71+
- [Person](docs/Person.md)
72+
- [Pet](docs/Pet.md)
73+
- [PropertyTest](docs/PropertyTest.md)
74+
- [Ref](docs/Ref.md)
75+
- [Return](docs/Return.md)
76+
- [Tag](docs/Tag.md)
77+
- [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md)
78+
- [TypeTesting](docs/TypeTesting.md)
79+
- [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md)
80+
- [User](docs/User.md)
81+
- [Vehicle](docs/Vehicle.md)
82+
- [WithInnerOneOf](docs/WithInnerOneOf.md)
83+
84+
85+
To get access to the crate's generated documentation, use:
86+
87+
```
88+
cargo doc --open
89+
```
90+
91+
## Author
92+
93+
94+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ActionContainer
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**action** | [**models::Baz**](Baz.md) | |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AnyTypeTest
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**foo** | Option<[**serde_json::Value**](.md)> | |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

0 commit comments

Comments
 (0)