Description
Hi I am trying to add the following swagger schema for an API endpoint using python client v4:
{'tags': ['Account'],
'summary': 'Update Account',
'security': [{'directLogin': [], 'gatewayLogin': []}],
'description': '\n\nUpdate the account.\n\nAuthentication is Mandatory\n\n**URL Parameters:**\n\n[ACCOUNT\\_ID](/glossary#Account.account_id): 8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\n\n[BANK\\_ID](/glossary#Bank.bank_id): gh.29.uk\n\n**JSON response body fields:**\n\n[**account\\_id**](/glossary#): 8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\n\n[**account\\_routings**](/glossary#account_routings):\n\n[**address**](/glossary#address):\n\n[**bank\\_id**](/glossary#): gh.29.uk\n\n[**branch\\_id**](/glossary#): DERBY6\n\n[**label**](/glossary#): My Account\n\n[**scheme**](/glossary#scheme): OBP\n\n[**type**](/glossary#type):\n\n',
'operationId': 'OBPv3.1.0-updateAccount',
'parameters': [{'in': 'body',
'name': 'body',
'description': 'JObject object that needs to be added.',
'required': True,
'schema': {'type': 'object',
'properties': {'label': {'type': 'string', 'example': 'Label'},
'type': {'type': 'string', 'example': 'CURRENT'},
'branch_id': {'type': 'string', 'example': '1234'},
'account_routings': {'type': 'array',
'items': {'type': 'object',
'properties': {'scheme': {'type': 'string', 'example': 'OBP'},
'address': {'type': 'string',
'example': '8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0'}},
'required': ['scheme', 'address']}}},
'required': ['label', 'type', 'branch_id', 'account_routings']}},
{'in': 'path',
'name': 'ACCOUNT_ID',
'description': 'The account id',
'required': True,
'type': 'string'},
{'in': 'path',
'name': 'BANK_ID',
'description': 'The bank id',
'required': True,
'type': 'string'}],
'responses': {'ok_200': {'description': 'Success',
'schema': {'type': 'object',
'properties': {'bank_id': {'type': 'string', 'example': 'gh.29.uk'},
'account_id': {'type': 'string',
'example': '8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0'},
'label': {'type': 'string', 'example': 'Label'},
'type': {'type': 'string', 'example': 'CURRENT'},
'branch_id': {'type': 'string', 'example': '1234'},
'account_routings': {'type': 'array',
'items': {'type': 'object',
'properties': {'scheme': {'type': 'string', 'example': 'IBAN'},
'address': {'type': 'string',
'example': 'DE91 1000 0000 0123 4567 89'}},
'required': ['scheme', 'address']}}},
'required': ['bank_id',
'account_id',
'label',
'type',
'branch_id',
'account_routings']}},
'badRequest_400': {'description': 'Error',
'schema': {'properties': {'message': {'type': 'string',
'example': 'OBP-10001: Incorrect json format.'}}}}}}
using
test_collection.data.insert(
properties = endpoint_object,
uuid=endpoint_uuid
)
and get the following error from the client:
UnexpectedStatusCodeError: Object was not added! Unexpected status code: 422, with response body: {'error': [{'message': "invalid object: invalid object property 'responses' on class 'Test': property 'responses.ok_200': invalid object property 'responses.ok_200' on class 'Test': property 'responses.ok_200.schema': invalid object property 'responses.ok_200.schema' on class 'Test': property 'responses.ok_200.schema.properties': invalid object property 'responses.ok_200.schema.properties' on class 'Test': property 'responses.ok_200.schema.properties.account_routings': invalid object property 'responses.ok_200.schema.properties.account_routings' on class 'Test': property 'responses.ok_200.schema.properties.account_routings.items': invalid object property 'responses.ok_200.schema.properties.account_routings.items' on class 'Test': property 'responses.ok_200.schema.properties.account_routings.items.properties': invalid object property 'responses.ok_200.schema.properties.account_routings.items.properties' on class 'Test': property 'responses.ok_200.schema.properties.account_routings.items.properties.address': invalid object property 'responses.ok_200.schema.properties.account_routings.items.properties.address' on class 'Test': property 'responses.ok_200.schema.properties.account_routings.items.properties.address.example': invalid uuid property 'responses.ok_200.schema.properties.account_routings.items.properties.address.example' on class 'Test': requires a string of UUID format, but the given value is 'DE91 1000 0000 0123 4567 89'"}]}.
The key bit of that being invalid uuid property 'responses.ok_200.schema.properties.account_routings.items.properties.address.example' on class 'Test': requires a string of UUID format, but the given value is 'DE91 1000 0000 0123 4567 89'"}]}.
For some reason it is not liking what I’ve given as my example for address i.e.
'properties': {'scheme': {'type': 'string', 'example': 'IBAN'},
'address': {'type': 'string',
'example': 'DE91 1000 0000 0123 4567 89'}},
'required': ['scheme', 'address']}}},
I can’t change this to UUID as it encodes a an IBAN bank account address (not a real one don’t get any ideas.
Any clue why this is happening and how to ovveride this UUID checking? I thought maybe address might be a reserved name or something but I can’t find that anywhere.
Server Setup Information
- Weaviate Server Version: 1.28.2
- Deployment Method: docker
- Client Language and Version: python3
Any additional Information
I’ll include my docker-compose.yaml file here for completion:
---
services:
weaviate:
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
image: cr.weaviate.io/semitechnologies/weaviate:1.28.2
ports:
- 8080:8080
- 50051:50051
volumes:
- weaviate_data:/var/lib/weaviate
restart: on-failure:0
environment:
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
ENABLE_API_BASED_MODULES: 'true'
ENABLE_MODULES: 'text2vec-ollama,generative-ollama'
CLUSTER_HOSTNAME: 'node1'
volumes:
weaviate_data:
...