refactor create dht value

This commit is contained in:
Christien Rioux
2023-07-08 22:50:44 -04:00
parent 9f9feeb325
commit 19f384ab33
13 changed files with 53 additions and 40 deletions

View File

@@ -46,7 +46,7 @@ class RoutingContext(ABC):
@abstractmethod
async def create_dht_record(
self, kind: types.CryptoKind, schema: types.DHTSchema
self, schema: types.DHTSchema, kind: Optional[types.CryptoKind] = None
) -> types.DHTRecordDescriptor:
pass

View File

@@ -514,7 +514,7 @@ class _JsonRoutingContext(RoutingContext):
)
async def create_dht_record(
self, kind: CryptoKind, schema: DHTSchema
self, schema: DHTSchema, kind: Optional[CryptoKind] = None
) -> DHTRecordDescriptor:
return DHTRecordDescriptor.from_json(
raise_api_result(

View File

@@ -303,13 +303,15 @@
{
"type": "object",
"required": [
"kind",
"rc_op",
"schema"
],
"properties": {
"kind": {
"type": "string"
"type": [
"string",
"null"
]
},
"rc_op": {
"type": "string",