-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[Rust] reqwest shallow object query param #21199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
whirm
wants to merge
3
commits into
OpenAPITools:master
Choose a base branch
from
whirm:feat/rust-reqwest-shallow-object-query-param
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
generatorName: rust | ||
outputDir: samples/client/others/rust/reqwest/object-query-param | ||
library: reqwest | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/objectQueryParam.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/rust | ||
validateSpec: "false" | ||
additionalProperties: | ||
supportAsync: "true" | ||
packageName: object-query-param-reqwest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
samples/client/others/rust/reqwest/object-query-param/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/target/ | ||
**/*.rs.bk | ||
Cargo.lock |
23 changes: 23 additions & 0 deletions
23
samples/client/others/rust/reqwest/object-query-param/.openapi-generator-ignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
15 changes: 15 additions & 0 deletions
15
samples/client/others/rust/reqwest/object-query-param/.openapi-generator/FILES
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.gitignore | ||
.travis.yml | ||
Cargo.toml | ||
README.md | ||
docs/DefaultApi.md | ||
docs/ListNotRequiredParameter.md | ||
docs/ListPageQueryParameter.md | ||
git_push.sh | ||
src/apis/configuration.rs | ||
src/apis/default_api.rs | ||
src/apis/mod.rs | ||
src/lib.rs | ||
src/models/list_not_required_parameter.rs | ||
src/models/list_page_query_parameter.rs | ||
src/models/mod.rs |
1 change: 1 addition & 0 deletions
1
samples/client/others/rust/reqwest/object-query-param/.openapi-generator/VERSION
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.14.0-SNAPSHOT |
1 change: 1 addition & 0 deletions
1
samples/client/others/rust/reqwest/object-query-param/.travis.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
language: rust |
14 changes: 14 additions & 0 deletions
14
samples/client/others/rust/reqwest/object-query-param/Cargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "object-query-param-reqwest" | ||
version = "1.0.0" | ||
authors = ["OpenAPI Generator team and contributors"] | ||
description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" | ||
license = "Apache-2.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
serde = { version = "^1.0", features = ["derive"] } | ||
serde_json = "^1.0" | ||
serde_repr = "^0.1" | ||
url = "^2.5" | ||
reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } |
47 changes: 47 additions & 0 deletions
47
samples/client/others/rust/reqwest/object-query-param/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Rust API client for object-query-param-reqwest | ||
|
||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
|
||
|
||
## Overview | ||
|
||
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. | ||
|
||
- API version: 1.0.0 | ||
- Package version: 1.0.0 | ||
- Generator version: 7.14.0-SNAPSHOT | ||
- Build package: `org.openapitools.codegen.languages.RustClientCodegen` | ||
|
||
## Installation | ||
|
||
Put the package under your project folder in a directory named `object-query-param-reqwest` and add the following to `Cargo.toml` under `[dependencies]`: | ||
|
||
``` | ||
object-query-param-reqwest = { path = "./object-query-param-reqwest" } | ||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *http://localhost:8080* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*DefaultApi* | [**list**](docs/DefaultApi.md#list) | **GET** /pony | | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [ListNotRequiredParameter](docs/ListNotRequiredParameter.md) | ||
- [ListPageQueryParameter](docs/ListPageQueryParameter.md) | ||
|
||
|
||
To get access to the crate's generated documentation, use: | ||
|
||
``` | ||
cargo doc --open | ||
``` | ||
|
||
## Author | ||
|
||
|
||
|
38 changes: 38 additions & 0 deletions
38
samples/client/others/rust/reqwest/object-query-param/docs/DefaultApi.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# \DefaultApi | ||
|
||
All URIs are relative to *http://localhost:8080* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**list**](DefaultApi.md#list) | **GET** /pony | | ||
|
||
|
||
|
||
## list | ||
|
||
> list(page_query, not_required) | ||
|
||
|
||
### Parameters | ||
|
||
|
||
Name | Type | Description | Required | Notes | ||
------------- | ------------- | ------------- | ------------- | ------------- | ||
**page_query** | [**ListPageQueryParameter**](.md) | | [required] | | ||
**not_required** | Option<[**ListNotRequiredParameter**](.md)> | | | | ||
|
||
### Return type | ||
|
||
(empty response body) | ||
|
||
### Authorization | ||
|
||
No authorization required | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: Not defined | ||
|
||
[[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) | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, having unimplemented here may cause unexpected panic from user point of view. How about auto fallback to
parse_deep_object
:or just don't handle it, let it fallback to
_ =>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user should never see that. That's a developer targeted error.
As far as I can tell, the only way a user sees this, is if a developer makes a mistake modifying the templates in a way that uses the wrong parse fn.
And I'd say that if I let it pass through, then it will generate incorrect values (I don't think converting objects to strings will be very useful) and will make figuring out that someone broke the templates more difficult.
Or I'm missing something here?