Skip to content

Commit d7d005c

Browse files
Update public-api.yaml to image/jpeg
1 parent e973322 commit d7d005c

File tree

6 files changed

+19
-27
lines changed

6 files changed

+19
-27
lines changed

generated/docs/ClassificationResult.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Our classification result. This result can come from the detector, or a human re
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**label** | **str** | What is the predicted label? |
9-
**confidence** | **float** | On a scale of 0 to 1, how confident are we in the predicted label? | [optional]
9+
**confidence** | **float, none_type** | On a scale of 0 to 1, how confident are we in the predicted label? | [optional]
1010
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
1111

1212
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

generated/docs/ImageQueriesApi.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ with openapi_client.ApiClient(configuration) as api_client:
205205
# Create an instance of the API class
206206
api_instance = image_queries_api.ImageQueriesApi(api_client)
207207
detector_id = "detector_id_example" # str | Choose a detector by its ID.
208-
image_query = ImageQuery(
209-
) # ImageQuery | (optional)
208+
body = open('@path/to/image.jpeg', 'rb') # file_type | (optional)
210209

211210
# example passing only required values which don't have defaults set
212211
try:
@@ -218,7 +217,7 @@ with openapi_client.ApiClient(configuration) as api_client:
218217
# example passing only required values which don't have defaults set
219218
# and optional values
220219
try:
221-
api_response = api_instance.submit_image_query(detector_id, image_query=image_query)
220+
api_response = api_instance.submit_image_query(detector_id, body=body)
222221
pprint(api_response)
223222
except openapi_client.ApiException as e:
224223
print("Exception when calling ImageQueriesApi->submit_image_query: %s\n" % e)
@@ -230,7 +229,7 @@ with openapi_client.ApiClient(configuration) as api_client:
230229
Name | Type | Description | Notes
231230
------------- | ------------- | ------------- | -------------
232231
**detector_id** | **str**| Choose a detector by its ID. |
233-
**image_query** | [**ImageQuery**](ImageQuery.md)| | [optional]
232+
**body** | **file_type**| | [optional]
234233

235234
### Return type
236235

@@ -242,7 +241,7 @@ Name | Type | Description | Notes
242241

243242
### HTTP request headers
244243

245-
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
244+
- **Content-Type**: image/jpeg
246245
- **Accept**: application/json
247246

248247

generated/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: public-api.yaml
3-
# timestamp: 2022-05-08T05:20:12+00:00
3+
# timestamp: 2022-05-08T05:27:06+00:00
44

55
from __future__ import annotations
66

generated/openapi_client/api/image_queries_api.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def __init__(self, api_client=None):
156156
params_map={
157157
'all': [
158158
'detector_id',
159-
'image_query',
159+
'body',
160160
],
161161
'required': [
162162
'detector_id',
@@ -176,15 +176,15 @@ def __init__(self, api_client=None):
176176
'openapi_types': {
177177
'detector_id':
178178
(str,),
179-
'image_query':
180-
(ImageQuery,),
179+
'body':
180+
(file_type,),
181181
},
182182
'attribute_map': {
183183
'detector_id': 'detector_id',
184184
},
185185
'location_map': {
186186
'detector_id': 'query',
187-
'image_query': 'body',
187+
'body': 'body',
188188
},
189189
'collection_format_map': {
190190
}
@@ -194,9 +194,7 @@ def __init__(self, api_client=None):
194194
'application/json'
195195
],
196196
'content_type': [
197-
'application/json',
198-
'application/x-www-form-urlencoded',
199-
'multipart/form-data'
197+
'image/jpeg'
200198
]
201199
},
202200
api_client=api_client
@@ -373,7 +371,7 @@ def submit_image_query(
373371
detector_id (str): Choose a detector by its ID.
374372
375373
Keyword Args:
376-
image_query (ImageQuery): [optional]
374+
body (file_type): [optional]
377375
_return_http_data_only (bool): response data without head status
378376
code and headers. Default is True.
379377
_preload_content (bool): if False, the urllib3.HTTPResponse object

generated/openapi_client/model/classification_result.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def openapi_types():
8787
"""
8888
return {
8989
'label': (str,), # noqa: E501
90-
'confidence': (float,), # noqa: E501
90+
'confidence': (float, none_type,), # noqa: E501
9191
}
9292

9393
@cached_property
@@ -144,7 +144,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501
144144
Animal class but this time we won't travel
145145
through its discriminator because we passed in
146146
_visited_composed_classes = (Animal,)
147-
confidence (float): On a scale of 0 to 1, how confident are we in the predicted label?. [optional] # noqa: E501
147+
confidence (float, none_type): On a scale of 0 to 1, how confident are we in the predicted label?. [optional] # noqa: E501
148148
"""
149149

150150
_check_type = kwargs.pop('_check_type', True)
@@ -230,7 +230,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501
230230
Animal class but this time we won't travel
231231
through its discriminator because we passed in
232232
_visited_composed_classes = (Animal,)
233-
confidence (float): On a scale of 0 to 1, how confident are we in the predicted label?. [optional] # noqa: E501
233+
confidence (float, none_type): On a scale of 0 to 1, how confident are we in the predicted label?. [optional] # noqa: E501
234234
"""
235235

236236
_check_type = kwargs.pop('_check_type', True)

spec/public-api.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,14 @@ paths:
136136
- image-queries
137137
requestBody:
138138
content:
139-
application/json:
139+
image/jpeg:
140140
schema:
141-
$ref: '#/components/schemas/ImageQuery'
141+
type: string
142+
format: binary
142143
examples:
143144
JPEGBinaryImageData:
144145
value: '@path/to/image.jpeg'
145146
summary: JPEG binary image data
146-
application/x-www-form-urlencoded:
147-
schema:
148-
$ref: '#/components/schemas/ImageQuery'
149-
multipart/form-data:
150-
schema:
151-
$ref: '#/components/schemas/ImageQuery'
152147
security:
153148
- ApiToken: []
154149
responses:
@@ -189,9 +184,9 @@ components:
189184
properties:
190185
confidence:
191186
type: number
192-
format: double
193187
maximum: 1
194188
minimum: 0
189+
nullable: true
195190
description: On a scale of 0 to 1, how confident are we in the predicted
196191
label?
197192
label:

0 commit comments

Comments
 (0)