dify/api/controllers
QuantumGhost 2c1ab4879f
refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025)
refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025)

This PR addresses serialization issues in the VariablePool model by separating the `value_type` tags for `IntegerSegment`/`FloatSegment` and `IntegerVariable`/`FloatVariable`. Previously, both Integer and Float types shared the same `SegmentType.NUMBER` tag, causing conflicts during serialization.

Key changes:
- Introduce distinct `value_type` tags for Integer and Float segments/variables
- Add `VariableUnion` and `SegmentUnion` types for proper type discrimination
- Leverage Pydantic's discriminated union feature for seamless serialization/deserialization
- Enable accurate serialization of data structures containing these types

Closes #22024.
2025-07-16 12:31:37 +08:00
..
common Add `/site` API (#19631) 2025-05-14 10:43:36 +08:00
console refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
files Chore: remove unreachable code (#21986) 2025-07-07 21:55:34 +08:00
inner_api feat(inner-api/workspace): include tenant details in CreateWorkspace response (#21636) 2025-06-27 18:28:03 +08:00
mcp feat: add MCP support (#20716) 2025-07-10 14:01:34 +08:00
service_api feat(api/repo): Allow to config repository implementation (#21458) 2025-07-14 14:54:38 +08:00
web fix: Before publish the app, preview the voice of tts, it raise an er… (#21821) 2025-07-03 10:53:14 +08:00
__init__.py chore(api/controllers): Apply Ruff Formatter. (#7645) 2024-08-26 15:29:10 +08:00