[tests] write a schema component for dummy_domain for example

This commit is contained in:
maxime 2023-08-02 13:29:57 +02:00
parent 60ff99d0fb
commit b1595beb14
2 changed files with 29 additions and 4 deletions

View File

@ -6,5 +6,22 @@ domain = {
'id': '8b88e60a625369235b36c2d6d70756a0c02c1c7fb169fcee6dc820bcf9723f5a', 'id': '8b88e60a625369235b36c2d6d70756a0c02c1c7fb169fcee6dc820bcf9723f5a',
'deps': ( 'deps': (
('halfapi', '=={}'.format(halfapi_version)), ('halfapi', '=={}'.format(halfapi_version)),
) ),
'schema_components': {
'schemas': {
'Pinnochio': {
'type': 'object',
'required': {
'id',
'name',
'nose_size'
},
'properties': {
'id': {'type': 'string'},
'name': {'type': 'string'},
'nose_size': {'type': 'number'}
}
}
}
}
} }

View File

@ -1,13 +1,21 @@
from uuid import uuid4
from halfapi.lib import acl from halfapi.lib import acl
ACLS = { ACLS = {
'GET' : [{'acl':acl.public}] 'GET' : [{'acl':acl.public}]
} }
def get(): def get():
""" """
description: description: The pinnochio guy
Not implemented
responses: responses:
200: 200:
description: test response description: test response
content:
application/json:
schema:
$ref: "#/components/schemas/Pinnochio"
""" """
raise NotImplementedError return {
'id': str(uuid4()),
'name': 'pinnochio',
'nose_size': 42
}