Skip to content

Commit

Permalink
Merge branch 'fix/julia_file' of https://github.com/qiaojunfeng/opena…
Browse files Browse the repository at this point in the history
…pi-generator into qiaojunfeng-fix/julia_file
  • Loading branch information
wing328 committed Dec 21, 2024
2 parents 8790f7c + 2ea1d2f commit 47b548d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const _returntypes_{{operationId}}_{{classname}} = Dict{Regex,Type}(
{{/responses}}
)

function _oacinternal_{{operationId}}(_api::{{classname}}{{#allParams}}{{#required}}, {{paramName}}::{{#dataType}}{{#isBinary}}Vector{UInt8}{{/isBinary}}{{^isBinary}}{{dataType}}{{/isBinary}}{{/dataType}}{{/required}}{{/allParams}};{{#allParams}}{{^required}} {{paramName}}=nothing,{{/required}}{{/allParams}} _mediaType=nothing)
function _oacinternal_{{operationId}}(_api::{{classname}}{{#allParams}}{{#required}}, {{paramName}}::{{dataType}}{{/required}}{{/allParams}};{{#allParams}}{{^required}} {{paramName}}=nothing,{{/required}}{{/allParams}} _mediaType=nothing)
{{#allParams}}
{{#hasValidation}}
{{#maxLength}}
Expand Down Expand Up @@ -61,7 +61,7 @@ function _oacinternal_{{operationId}}(_api::{{classname}}{{#allParams}}{{#requir
OpenAPI.Clients.set_param(_ctx.form, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}}
{{/isFile}}
{{#isFile}}
OpenAPI.Clients.set_param(_ctx.file, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}) # type {{#dataType}}{{#isBinary}}Vector{UInt8}{{/isBinary}}{{^isBinary}}{{dataType}}{{/isBinary}}{{/dataType}}
OpenAPI.Clients.set_param(_ctx.file, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}) # type {{dataType}}
{{/isFile}}
{{/formParams}}
OpenAPI.Clients.set_header_accept(_ctx, [{{#produces}}"{{{mediaType}}}", {{/produces}}])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Method | HTTP request | Description
{{#operations}}
{{#operation}}
# **{{{operationId}}}**
> {{operationId}}(req::HTTP.Request{{#allParams}}{{#required}}, {{paramName}}::{{dataType}}{{/required}}{{/allParams}};{{#allParams}}{{^required}} {{paramName}}=nothing,{{/required}}{{/allParams}}) -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Nothing{{/returnType}}
> {{operationId}}(req::HTTP.Request{{#allParams}}{{#required}}, {{paramName}}::{{#dataType}}{{#isBinary}}Vector{UInt8}{{/isBinary}}{{^isBinary}}{{dataType}}{{/isBinary}}{{/dataType}}{{/required}}{{/allParams}};{{#allParams}}{{^required}} {{paramName}}=nothing,{{/required}}{{/allParams}}) -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Nothing{{/returnType}}

{{{summary}}}{{#notes}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The following server methods must be implemented:
{{#operation}}
- **{{operationId}}**
- *invocation:* {{httpMethod}} {{{path}}}
- *signature:* {{operationId}}(req::HTTP.Request{{#allParams}}{{#required}}, {{paramName}}::{{dataType}}{{/required}}{{/allParams}};{{#allParams}}{{^required}} {{paramName}}=nothing,{{/required}}{{/allParams}}) -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Nothing{{/returnType}}
- *signature:* {{operationId}}(req::HTTP.Request{{#allParams}}{{#required}}, {{paramName}}::{{#dataType}}{{#isBinary}}Vector{UInt8}{{/isBinary}}{{^isBinary}}{{dataType}}{{/isBinary}}{{/dataType}}{{/required}}{{/allParams}};{{#allParams}}{{^required}} {{paramName}}=nothing,{{/required}}{{/allParams}}) -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Nothing{{/returnType}}
{{/operation}}
{{/operations}}
{{/apis}}
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/julia/src/apis/api_PetApi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function _oacinternal_upload_file(_api::PetApi, pet_id::Int64; additional_metada
_ctx = OpenAPI.Clients.Ctx(_api.client, "POST", _returntypes_upload_file_PetApi, "/pet/{petId}/uploadImage", ["petstore_auth", ])
OpenAPI.Clients.set_param(_ctx.path, "petId", pet_id) # type Int64
OpenAPI.Clients.set_param(_ctx.form, "additionalMetadata", additional_metadata) # type String
OpenAPI.Clients.set_param(_ctx.file, "file", file) # type Vector{UInt8}
OpenAPI.Clients.set_param(_ctx.file, "file", file) # type String
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? ["multipart/form-data", ] : [_mediaType])
return _ctx
Expand Down

0 comments on commit 47b548d

Please sign in to comment.