|
| 1 | +# This file was generated by the Julia OpenAPI Code Generator |
| 2 | +# Do not modify this file directly. Modify the OpenAPI specification instead. |
| 3 | + |
| 4 | + |
| 5 | +@doc raw""" |
| 6 | +Encapsulates generated server code for PetStoreServer |
| 7 | +
|
| 8 | +The following server methods must be implemented: |
| 9 | +
|
| 10 | +- **addPet** |
| 11 | + - *invocation:* POST /pet |
| 12 | + - *signature:* addPet(req::HTTP.Request, in\_Pet::Pet;) -> Nothing |
| 13 | +- **deletePet** |
| 14 | + - *invocation:* DELETE /pet/{petId} |
| 15 | + - *signature:* deletePet(req::HTTP.Request, in\_petId::Int64; in\_api_key=nothing,) -> Nothing |
| 16 | +- **findPetsByStatus** |
| 17 | + - *invocation:* GET /pet/findByStatus |
| 18 | + - *signature:* findPetsByStatus(req::HTTP.Request, in\_status::Vector{String};) -> Vector{Pet} |
| 19 | +- **findPetsByTags** |
| 20 | + - *invocation:* GET /pet/findByTags |
| 21 | + - *signature:* findPetsByTags(req::HTTP.Request, in\_tags::Vector{String};) -> Vector{Pet} |
| 22 | +- **getPetById** |
| 23 | + - *invocation:* GET /pet/{petId} |
| 24 | + - *signature:* getPetById(req::HTTP.Request, in\_petId::Int64;) -> Pet |
| 25 | +- **updatePet** |
| 26 | + - *invocation:* PUT /pet |
| 27 | + - *signature:* updatePet(req::HTTP.Request, in\_Pet::Pet;) -> Nothing |
| 28 | +- **updatePetWithForm** |
| 29 | + - *invocation:* POST /pet/{petId} |
| 30 | + - *signature:* updatePetWithForm(req::HTTP.Request, in\_petId::Int64; in\_name=nothing, in\_status=nothing,) -> Nothing |
| 31 | +- **uploadFile** |
| 32 | + - *invocation:* POST /pet/{petId}/uploadImage |
| 33 | + - *signature:* uploadFile(req::HTTP.Request, in\_petId::Int64; in\_additionalMetadata=nothing, in\_file=nothing,) -> ApiResponse |
| 34 | +- **deleteOrder** |
| 35 | + - *invocation:* DELETE /store/order/{orderId} |
| 36 | + - *signature:* deleteOrder(req::HTTP.Request, in\_orderId::String;) -> Nothing |
| 37 | +- **getInventory** |
| 38 | + - *invocation:* GET /store/inventory |
| 39 | + - *signature:* getInventory(req::HTTP.Request;) -> Dict{String, Int64} |
| 40 | +- **getOrderById** |
| 41 | + - *invocation:* GET /store/order/{orderId} |
| 42 | + - *signature:* getOrderById(req::HTTP.Request, in\_orderId::Int64;) -> Order |
| 43 | +- **placeOrder** |
| 44 | + - *invocation:* POST /store/order |
| 45 | + - *signature:* placeOrder(req::HTTP.Request, in\_Order::Order;) -> Order |
| 46 | +- **createUser** |
| 47 | + - *invocation:* POST /user |
| 48 | + - *signature:* createUser(req::HTTP.Request, in\_User::User;) -> Nothing |
| 49 | +- **createUsersWithArrayInput** |
| 50 | + - *invocation:* POST /user/createWithArray |
| 51 | + - *signature:* createUsersWithArrayInput(req::HTTP.Request, in\_User::Vector{User};) -> Nothing |
| 52 | +- **createUsersWithListInput** |
| 53 | + - *invocation:* POST /user/createWithList |
| 54 | + - *signature:* createUsersWithListInput(req::HTTP.Request, in\_User::Vector{User};) -> Nothing |
| 55 | +- **deleteUser** |
| 56 | + - *invocation:* DELETE /user/{username} |
| 57 | + - *signature:* deleteUser(req::HTTP.Request, in\_username::String;) -> Nothing |
| 58 | +- **getUserByName** |
| 59 | + - *invocation:* GET /user/{username} |
| 60 | + - *signature:* getUserByName(req::HTTP.Request, in\_username::String;) -> User |
| 61 | +- **loginUser** |
| 62 | + - *invocation:* GET /user/login |
| 63 | + - *signature:* loginUser(req::HTTP.Request, in\_username::String, in\_password::String;) -> String |
| 64 | +- **logoutUser** |
| 65 | + - *invocation:* GET /user/logout |
| 66 | + - *signature:* logoutUser(req::HTTP.Request;) -> Nothing |
| 67 | +- **updateUser** |
| 68 | + - *invocation:* PUT /user/{username} |
| 69 | + - *signature:* updateUser(req::HTTP.Request, in\_username::String, in\_User::User;) -> Nothing |
| 70 | +""" |
| 71 | +module PetStoreServer |
| 72 | + |
| 73 | +using HTTP |
| 74 | +using URIs |
| 75 | +using Dates |
| 76 | +using Random |
| 77 | +using TimeZones |
| 78 | +using OpenAPI |
| 79 | +using OpenAPI.Servers |
| 80 | + |
| 81 | +include("modelincludes.jl") |
| 82 | + |
| 83 | +include("api_PetApi.jl") |
| 84 | +include("api_StoreApi.jl") |
| 85 | +include("api_UserApi.jl") |
| 86 | + |
| 87 | +""" |
| 88 | +Register handlers for all APIs in this module in the supplier Router. |
| 89 | +
|
| 90 | +Paramerets: |
| 91 | +- `router`: Router to register handlers in |
| 92 | +- `impl`: module that implements the server methods |
| 93 | +
|
| 94 | +Optional parameters: |
| 95 | +- `path_prefix`: prefix to be applied to all paths |
| 96 | +- `optional_middlewares`: Register one or more optional middlewares to be applied to all requests. |
| 97 | +
|
| 98 | +Optional middlewares can be one or more of: |
| 99 | + - `init`: called before the request is processed |
| 100 | + - `pre_validation`: called after the request is parsed but before validation |
| 101 | + - `pre_invoke`: called after validation but before the handler is invoked |
| 102 | + - `post_invoke`: called after the handler is invoked but before the response is sent |
| 103 | +
|
| 104 | +The order in which middlewares are invoked are: |
| 105 | +`init |> read |> pre_validation |> validate |> pre_invoke |> invoke |> post_invoke` |
| 106 | +""" |
| 107 | +function register(router::HTTP.Router, impl; path_prefix::String="", optional_middlewares...) |
| 108 | + registerPetApi(router, impl; path_prefix=path_prefix, optional_middlewares...) |
| 109 | + registerStoreApi(router, impl; path_prefix=path_prefix, optional_middlewares...) |
| 110 | + registerUserApi(router, impl; path_prefix=path_prefix, optional_middlewares...) |
| 111 | + return router |
| 112 | +end |
| 113 | + |
| 114 | +export check_required |
| 115 | + |
| 116 | +# export models |
| 117 | +export ApiResponse |
| 118 | +export Category |
| 119 | +export Order |
| 120 | +export Pet |
| 121 | +export Tag |
| 122 | +export User |
| 123 | + |
| 124 | + |
| 125 | +end # module PetStoreServer |
0 commit comments