-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Feat/rust reqwest shallow object query param #21321
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
Draft
whirm
wants to merge
8
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.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7d9e385
objectQueryParam.yaml: Add both required and not required object quer…
whirm 1e671cf
[Rust] Add object-query-param config for reqwest (fails to compile)
whirm 7c0025d
[Rust] Add support for shallow object query params
whirm 499304e
[Rust] Update samples
whirm a599884
fixup! [Rust] Add support for shallow object query params
whirm ef09a5b
fixup! [Rust] Update samples
whirm 0f49b59
fixup! [Rust] Update samples
whirm 8c9b3c1
Add deep object query params for testing
whirm 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: "true" | ||
additionalProperties: | ||
supportAsync: "false" | ||
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 |
25 changes: 25 additions & 0 deletions
25
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,25 @@ | ||
.gitignore | ||
.travis.yml | ||
Cargo.toml | ||
README.md | ||
docs/DefaultApi.md | ||
docs/ListDeepParameter.md | ||
docs/ListDeepParameterFoo.md | ||
docs/ListNotRequiredDeepParameter.md | ||
docs/ListNotRequiredDeepParameterFoo.md | ||
docs/ListNotRequiredParameter.md | ||
docs/ListPageQueryParameter.md | ||
docs/Page.md | ||
git_push.sh | ||
src/apis/configuration.rs | ||
src/apis/default_api.rs | ||
src/apis/mod.rs | ||
src/lib.rs | ||
src/models/list_deep_parameter.rs | ||
src/models/list_deep_parameter_foo.rs | ||
src/models/list_not_required_deep_parameter.rs | ||
src/models/list_not_required_deep_parameter_foo.rs | ||
src/models/list_not_required_parameter.rs | ||
src/models/list_page_query_parameter.rs | ||
src/models/mod.rs | ||
src/models/page.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", "blocking", "multipart"] } |
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.
Please correct me If I am wrong @wing328: isModel here does not guarantee non-nested?
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.
isModel can have nested properties (properties that are models)
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.
Good catch.
There's an issue though, it seems like the
isDeepObject
flag is not correctly set for nested objects. I've added a couple test cases to the PR.@wing328 am I doing something wrong here?
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.
@wing328 ping!
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.
I think
isDeepObject
also does not guarantee non-nested.Generated code from @whirm integration test:
However, regarding specs, it's nested object: