Skip to content

Commit

Permalink
Update public-api.yaml to image/jpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-groundlight committed May 8, 2022
1 parent e973322 commit d7d005c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 27 deletions.
2 changes: 1 addition & 1 deletion generated/docs/ClassificationResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Our classification result. This result can come from the detector, or a human re
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | **str** | What is the predicted label? |
**confidence** | **float** | On a scale of 0 to 1, how confident are we in the predicted label? | [optional]
**confidence** | **float, none_type** | On a scale of 0 to 1, how confident are we in the predicted label? | [optional]
**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]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
9 changes: 4 additions & 5 deletions generated/docs/ImageQueriesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = image_queries_api.ImageQueriesApi(api_client)
detector_id = "detector_id_example" # str | Choose a detector by its ID.
image_query = ImageQuery(
) # ImageQuery | (optional)
body = open('@path/to/image.jpeg', 'rb') # file_type | (optional)

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

### Return type

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

### HTTP request headers

- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
- **Content-Type**: image/jpeg
- **Accept**: application/json


Expand Down
2 changes: 1 addition & 1 deletion generated/model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: public-api.yaml
# timestamp: 2022-05-08T05:20:12+00:00
# timestamp: 2022-05-08T05:27:06+00:00

from __future__ import annotations

Expand Down
14 changes: 6 additions & 8 deletions generated/openapi_client/api/image_queries_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(self, api_client=None):
params_map={
'all': [
'detector_id',
'image_query',
'body',
],
'required': [
'detector_id',
Expand All @@ -176,15 +176,15 @@ def __init__(self, api_client=None):
'openapi_types': {
'detector_id':
(str,),
'image_query':
(ImageQuery,),
'body':
(file_type,),
},
'attribute_map': {
'detector_id': 'detector_id',
},
'location_map': {
'detector_id': 'query',
'image_query': 'body',
'body': 'body',
},
'collection_format_map': {
}
Expand All @@ -194,9 +194,7 @@ def __init__(self, api_client=None):
'application/json'
],
'content_type': [
'application/json',
'application/x-www-form-urlencoded',
'multipart/form-data'
'image/jpeg'
]
},
api_client=api_client
Expand Down Expand Up @@ -373,7 +371,7 @@ def submit_image_query(
detector_id (str): Choose a detector by its ID.
Keyword Args:
image_query (ImageQuery): [optional]
body (file_type): [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
Expand Down
6 changes: 3 additions & 3 deletions generated/openapi_client/model/classification_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def openapi_types():
"""
return {
'label': (str,), # noqa: E501
'confidence': (float,), # noqa: E501
'confidence': (float, none_type,), # noqa: E501
}

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

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

_check_type = kwargs.pop('_check_type', True)
Expand Down
13 changes: 4 additions & 9 deletions spec/public-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,14 @@ paths:
- image-queries
requestBody:
content:
application/json:
image/jpeg:
schema:
$ref: '#/components/schemas/ImageQuery'
type: string
format: binary
examples:
JPEGBinaryImageData:
value: '@path/to/image.jpeg'
summary: JPEG binary image data
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ImageQuery'
multipart/form-data:
schema:
$ref: '#/components/schemas/ImageQuery'
security:
- ApiToken: []
responses:
Expand Down Expand Up @@ -189,9 +184,9 @@ components:
properties:
confidence:
type: number
format: double
maximum: 1
minimum: 0
nullable: true
description: On a scale of 0 to 1, how confident are we in the predicted
label?
label:
Expand Down

0 comments on commit d7d005c

Please sign in to comment.