Coverage for faststream / specification / asyncapi / v3_0_0 / schema / components.py: 70%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-05-08 01:48 +0000

1from typing import Any 

2 

3from pydantic import BaseModel 

4 

5from faststream._internal._compat import PYDANTIC_V2 

6from faststream.specification.asyncapi.v2_6_0.schema.message import Message 

7 

8 

9class Components(BaseModel): 

10 # TODO 

11 # servers 

12 # serverVariables 

13 # channels 

14 """A class to represent components in a system. 

15 

16 Attributes: 

17 messages : Optional dictionary of messages 

18 schemas : Optional dictionary of schemas 

19 

20 Note: 

21 The following attributes are not implemented yet: 

22 - servers 

23 - serverVariables 

24 - channels 

25 - securitySchemes 

26 - parameters 

27 - correlationIds 

28 - operationTraits 

29 - messageTraits 

30 - serverBindings 

31 - channelBindings 

32 - operationBindings 

33 - messageBindings 

34 

35 """ 

36 

37 messages: dict[str, Message] | None = None 

38 schemas: dict[str, dict[str, Any]] | None = None 

39 securitySchemes: dict[str, dict[str, Any]] | None = None 

40 # parameters 

41 # correlationIds 

42 # operationTraits 

43 # messageTraits 

44 # serverBindings 

45 # channelBindings 

46 # operationBindings 

47 # messageBindings 

48 

49 if PYDANTIC_V2: 49 ↛ 54line 49 didn't jump to line 54 because the condition on line 49 was always true

50 model_config = {"extra": "allow"} 

51 

52 else: 

53 

54 class Config: 

55 extra = "allow"