Skip to content

Commit 1fc4f01

Browse files
github-actions[bot]github-actions
and
github-actions
authored
Add type as required property in source object of webhook (#797)
line/line-openapi#103 In the Messaging API webhook, we use `discriminator` to differentiate classes based on the value of `type`. During the development of bot SDK for Ruby v2, it seems that only `Source` does not have `type` marked as required. This is simply a mistake. The type should always be included to distinguish the kind of JSON, and there should not be any instances where it is absent. Co-authored-by: github-actions <[email protected]>
1 parent 8f3854e commit 1fc4f01

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

line-openapi

linebot/v3/webhooks/models/source.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
import linebot.v3.webhooks.models
2020

2121

22-
from typing import Optional, Union
22+
from typing import Union
2323
from pydantic.v1 import BaseModel, Field, StrictStr
2424

2525
class Source(BaseModel):
2626
"""
2727
the source of the event.
2828
https://developers.line.biz/en/reference/messaging-api/#source-user
2929
"""
30-
type: Optional[StrictStr] = Field(None, description="source type")
30+
type: StrictStr = Field(..., description="source type")
3131

3232
__properties = ["type"]
3333

0 commit comments

Comments
 (0)