Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a warning only if the message scheme is changed #2021

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion faststream/specification/asyncapi/v2_6_0/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _resolve_msg_payloads(
payloads.update(m.payload.pop(DEF_KEY, {}))
p_title = m.payload.get("title", f"{channel_name}Payload")
p_title = clear_key(p_title)
if p_title in payloads:
if p_title in payloads and payloads[p_title] != m.payload:
warnings.warn(
f"Overwriting the message schema, data types have the same name: `{p_title}`",
RuntimeWarning,
Expand Down
2 changes: 1 addition & 1 deletion faststream/specification/asyncapi/v3_0_0/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def _resolve_msg_payloads(
payload_name = m.payload.get("title", f"{channel_name}:{message_name}:Payload")
payload_name = clear_key(payload_name)

if payload_name in payloads:
if payload_name in payloads and payloads[payload_name] != m.payload:
warnings.warn(
f"Overwriting the message schema, data types have the same name: `{payload_name}`",
RuntimeWarning,
Expand Down
Loading