Skip to content
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

[Crystal] use encode_path instead of encode (deprecated) #11439

Merged
merged 1 commit into from
Jan 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
| C# | @mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) |
| Clojure | |
| Crystal | @cyangle (2021/01) |
| Dart | @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08) |
| Eiffel | @jvelilla (2017/09) |
| Elixir | @mrmstn (2018/12) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module {{moduleName}}
{{/hasValidation}}
{{/allParams}}
# resource path
local_var_path = "{{{path}}}"{{#pathParams}}.sub("{" + "{{baseName}}" + "}", URI.encode({{paramName}}.to_s){{^strictSpecBehavior}}.gsub("%2F", "/"){{/strictSpecBehavior}}){{/pathParams}}
local_var_path = "{{{path}}}"{{#pathParams}}.sub("{" + "{{baseName}}" + "}", URI.encode_path({{paramName}}.to_s){{^strictSpecBehavior}}.gsub("%2F", "/"){{/strictSpecBehavior}}){{/pathParams}}

# query parameters
query_params = Hash(String, String).new
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/crystal/src/petstore/api/pet_api.cr
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module Petstore
raise ArgumentError.new("Missing the required parameter 'pet_id' when calling PetApi.delete_pet")
end
# resource path
local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode(pet_id.to_s).gsub("%2F", "/"))
local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode_path(pet_id.to_s).gsub("%2F", "/"))

# query parameters
query_params = Hash(String, String).new
Expand Down Expand Up @@ -274,7 +274,7 @@ module Petstore
raise ArgumentError.new("Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id")
end
# resource path
local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode(pet_id.to_s).gsub("%2F", "/"))
local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode_path(pet_id.to_s).gsub("%2F", "/"))

# query parameters
query_params = Hash(String, String).new
Expand Down Expand Up @@ -390,7 +390,7 @@ module Petstore
raise ArgumentError.new("Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form")
end
# resource path
local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode(pet_id.to_s).gsub("%2F", "/"))
local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode_path(pet_id.to_s).gsub("%2F", "/"))

# query parameters
query_params = Hash(String, String).new
Expand Down Expand Up @@ -449,7 +449,7 @@ module Petstore
raise ArgumentError.new("Missing the required parameter 'pet_id' when calling PetApi.upload_file")
end
# resource path
local_var_path = "/pet/{petId}/uploadImage".sub("{" + "petId" + "}", URI.encode(pet_id.to_s).gsub("%2F", "/"))
local_var_path = "/pet/{petId}/uploadImage".sub("{" + "petId" + "}", URI.encode_path(pet_id.to_s).gsub("%2F", "/"))

# query parameters
query_params = Hash(String, String).new
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/crystal/src/petstore/api/store_api.cr
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module Petstore
raise ArgumentError.new("Missing the required parameter 'order_id' when calling StoreApi.delete_order")
end
# resource path
local_var_path = "/store/order/{orderId}".sub("{" + "orderId" + "}", URI.encode(order_id.to_s).gsub("%2F", "/"))
local_var_path = "/store/order/{orderId}".sub("{" + "orderId" + "}", URI.encode_path(order_id.to_s).gsub("%2F", "/"))

# query parameters
query_params = Hash(String, String).new
Expand Down Expand Up @@ -157,7 +157,7 @@ module Petstore
end

# resource path
local_var_path = "/store/order/{orderId}".sub("{" + "orderId" + "}", URI.encode(order_id.to_s).gsub("%2F", "/"))
local_var_path = "/store/order/{orderId}".sub("{" + "orderId" + "}", URI.encode_path(order_id.to_s).gsub("%2F", "/"))

# query parameters
query_params = Hash(String, String).new
Expand Down
6 changes: 3 additions & 3 deletions samples/client/petstore/crystal/src/petstore/api/user_api.cr
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ module Petstore
raise ArgumentError.new("Missing the required parameter 'username' when calling UserApi.delete_user")
end
# resource path
local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode(username.to_s).gsub("%2F", "/"))
local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode_path(username.to_s).gsub("%2F", "/"))

# query parameters
query_params = Hash(String, String).new
Expand Down Expand Up @@ -267,7 +267,7 @@ module Petstore
raise ArgumentError.new("Missing the required parameter 'username' when calling UserApi.get_user_by_name")
end
# resource path
local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode(username.to_s).gsub("%2F", "/"))
local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode_path(username.to_s).gsub("%2F", "/"))

# query parameters
query_params = Hash(String, String).new
Expand Down Expand Up @@ -451,7 +451,7 @@ module Petstore
raise ArgumentError.new("Missing the required parameter 'user' when calling UserApi.update_user")
end
# resource path
local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode(username.to_s).gsub("%2F", "/"))
local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode_path(username.to_s).gsub("%2F", "/"))

# query parameters
query_params = Hash(String, String).new
Expand Down