Skip to content

Commit 00fc01f

Browse files
authored
add separate tests for openapi-generator (#45)
The openapi-generator repo uses a slightly separate spec for Petstore. It is best to have a separate set of tests for that.
1 parent f0ce7e1 commit 00fc01f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5567
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ keywords = ["Swagger", "OpenAPI", "REST"]
44
license = "MIT"
55
desc = "OpenAPI server and client helper for Julia"
66
authors = ["JuliaHub Inc."]
7-
version = "0.1.13"
7+
version = "0.1.14"
88

99
[deps]
1010
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
java -jar openapi-generator-cli.jar generate \
2+
-i ../../specs/openapigenerator_petstore_v3.json \
3+
-g julia-client \
4+
-o petstore \
5+
--additional-properties=packageName=OpenAPIGenPetStoreClient \
6+
--additional-properties=exportModels=true \
7+
--additional-properties=exportOperations=true
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
README.md
2+
docs/ApiResponse.md
3+
docs/Category.md
4+
docs/Order.md
5+
docs/Pet.md
6+
docs/PetApi.md
7+
docs/StoreApi.md
8+
docs/Tag.md
9+
docs/User.md
10+
docs/UserApi.md
11+
src/OpenAPIGenPetStoreClient.jl
12+
src/apis/api_PetApi.jl
13+
src/apis/api_StoreApi.jl
14+
src/apis/api_UserApi.jl
15+
src/modelincludes.jl
16+
src/models/model_ApiResponse.jl
17+
src/models/model_Category.jl
18+
src/models/model_Order.jl
19+
src/models/model_Pet.jl
20+
src/models/model_Tag.jl
21+
src/models/model_User.jl
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.0.0-SNAPSHOT
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Julia API client for OpenAPIGenPetStoreClient
2+
3+
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
4+
5+
## Overview
6+
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.
7+
8+
- API version: 1.0.0
9+
- Build package: org.openapitools.codegen.languages.JuliaClientCodegen
10+
11+
12+
## Installation
13+
Place the Julia files generated under the `src` folder in your Julia project. Include OpenAPIGenPetStoreClient.jl in the project code.
14+
It would include the module named OpenAPIGenPetStoreClient.
15+
16+
Documentation is generated as markdown files under the `docs` folder. You can include them in your project documentation.
17+
Documentation is also embedded in Julia which can be used with a Julia specific documentation generator.
18+
19+
## API Endpoints
20+
21+
Class | Method
22+
------------ | -------------
23+
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet)<br/>**POST** /pet<br/>Add a new pet to the store
24+
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet)<br/>**DELETE** /pet/{petId}<br/>Deletes a pet
25+
*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status)<br/>**GET** /pet/findByStatus<br/>Finds Pets by status
26+
*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags)<br/>**GET** /pet/findByTags<br/>Finds Pets by tags
27+
*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id)<br/>**GET** /pet/{petId}<br/>Find pet by ID
28+
*PetApi* | [**update_pet**](docs/PetApi.md#update_pet)<br/>**PUT** /pet<br/>Update an existing pet
29+
*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form)<br/>**POST** /pet/{petId}<br/>Updates a pet in the store with form data
30+
*PetApi* | [**upload_file**](docs/PetApi.md#upload_file)<br/>**POST** /pet/{petId}/uploadImage<br/>uploads an image
31+
*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order)<br/>**DELETE** /store/order/{orderId}<br/>Delete purchase order by ID
32+
*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory)<br/>**GET** /store/inventory<br/>Returns pet inventories by status
33+
*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id)<br/>**GET** /store/order/{orderId}<br/>Find purchase order by ID
34+
*StoreApi* | [**place_order**](docs/StoreApi.md#place_order)<br/>**POST** /store/order<br/>Place an order for a pet
35+
*UserApi* | [**create_user**](docs/UserApi.md#create_user)<br/>**POST** /user<br/>Create user
36+
*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input)<br/>**POST** /user/createWithArray<br/>Creates list of users with given input array
37+
*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input)<br/>**POST** /user/createWithList<br/>Creates list of users with given input array
38+
*UserApi* | [**delete_user**](docs/UserApi.md#delete_user)<br/>**DELETE** /user/{username}<br/>Delete user
39+
*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name)<br/>**GET** /user/{username}<br/>Get user by user name
40+
*UserApi* | [**login_user**](docs/UserApi.md#login_user)<br/>**GET** /user/login<br/>Logs user into the system
41+
*UserApi* | [**logout_user**](docs/UserApi.md#logout_user)<br/>**GET** /user/logout<br/>Logs out current logged in user session
42+
*UserApi* | [**update_user**](docs/UserApi.md#update_user)<br/>**PUT** /user/{username}<br/>Updated user
43+
44+
45+
## Models
46+
47+
- [ApiResponse](docs/ApiResponse.md)
48+
- [Category](docs/Category.md)
49+
- [Order](docs/Order.md)
50+
- [Pet](docs/Pet.md)
51+
- [Tag](docs/Tag.md)
52+
- [User](docs/User.md)
53+
54+
55+
<a id="authorization"></a>
56+
## Authorization
57+
58+
Authentication schemes defined for the API:
59+
<a id="petstore_auth"></a>
60+
### petstore_auth
61+
- **Type**: OAuth
62+
- **Flow**: implicit
63+
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
64+
- **Scopes**:
65+
- **read:pets**: read your pets
66+
- **write:pets**: modify pets in your account
67+
68+
Example
69+
```
70+
using OpenAPI
71+
using OpenAPI.Clients
72+
import OpenAPI.Clients: Client, set_header
73+
client = Client(server_uri)
74+
set_header(client, "Authorization", "Bearer $bearer_auth")
75+
api = MyApi(client)
76+
result = callApi(api, args...; api_key)
77+
```
78+
<a id="api_key"></a>
79+
### api_key
80+
- **Type**: API key
81+
82+
Example
83+
```
84+
using OpenAPI
85+
using OpenAPI.Clients
86+
import OpenAPI.Clients: Client
87+
client = Client(server_uri)
88+
api = MyApi(client)
89+
result = callApi(api, args...; api_key)
90+
```
91+
92+
## Author
93+
94+
95+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ApiResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**message** | **String** | | [optional] [default to nothing]
8+
**code** | **Int64** | | [optional] [default to nothing]
9+
**type** | **String** | | [optional] [default to nothing]
10+
11+
12+
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
13+
14+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Category
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**name** | **String** | | [optional] [default to nothing]
8+
**id** | **Int64** | | [optional] [default to nothing]
9+
10+
11+
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
12+
13+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Order
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**petId** | **Int64** | | [optional] [default to nothing]
8+
**shipDate** | **ZonedDateTime** | | [optional] [default to nothing]
9+
**status** | **String** | Order Status | [optional] [default to nothing]
10+
**id** | **Int64** | | [optional] [default to nothing]
11+
**complete** | **Bool** | | [optional] [default to false]
12+
**quantity** | **Int64** | | [optional] [default to nothing]
13+
14+
15+
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
16+
17+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Pet
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**name** | **String** | | [default to nothing]
8+
**status** | **String** | pet status in the store | [optional] [default to nothing]
9+
**id** | **Int64** | | [optional] [default to nothing]
10+
**photoUrls** | **Vector{String}** | | [default to nothing]
11+
**tags** | [**Vector{Tag}**](Tag.md) | | [optional] [default to nothing]
12+
**category** | [***Category**](Category.md) | | [optional] [default to nothing]
13+
14+
15+
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
16+
17+

0 commit comments

Comments
 (0)