Skip to content

Commit f23d234

Browse files
committed
fix read event type
1 parent 2b53cd2 commit f23d234

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

eventsourcingdb/handlers/ping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# CloudEvent field names
1111
SPECVERSION_FIELD = "specversion"
1212
TYPE_FIELD = "type"
13-
PING_RECEIVED_TYPE = "io.eventsourcingdb.api.ping-received"
13+
PING_RECEIVED_TYPE = "io.eventsourcingdb.ping-received"
1414

1515

1616
async def ping(client: AbstractBaseClient) -> None:

eventsourcingdb/handlers/register_event_schema/register_event_schema.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,9 @@ async def register_event_schema(
2626
except Exception as other_error:
2727
raise InternalError(str(other_error)) from other_error
2828

29-
# Convert string schema to dict if needed
30-
schema_obj = json_schema
31-
3229
request_body = json.dumps({
3330
'eventType': event_type,
34-
'schema': schema_obj, # Now always a Python object, not a JSON string
31+
'schema': json_schema,
3532
})
3633

3734
response: Response

tests/test_read_event_types.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@ async def test_reads_all_types_of_existing_events_and_registered_schemas(
5050
),
5151
])
5252

53-
# Use Python dictionaries instead of JSON strings
5453
await client.register_event_schema(
5554
"org.ban.ban",
56-
{"type": "object"}
55+
{"type": "object"} # type: ignore
5756
)
5857
await client.register_event_schema(
5958
"org.bing.chilling",
60-
{"type": "object"}
59+
{"type": "object"} # type: ignore
6160
)
6261

6362
actual_event_types: set[EventType] = set()

0 commit comments

Comments
 (0)