Skip to content

Conditions on Basic Types (Strings) #149

@dschwartznyc

Description

@dschwartznyc

Problem Description:

Rune allows attaching conditions directly to basic type aliases (e.g., typeAlias BusinessCenter: string condition IsValid). The Python generator does not yet support wrapping simple types to trigger these validators upon assignment.

Steps to Reproduce:

Example Rune code: (Type alias with condition)

typeAlias Currency:
    string

    condition C:
        item count = 3
  1. Define a typeAlias on a basic type (string, number, etc.) with an attached condition.
  2. Generate Python code and check the Pydantic field definition for the alias.

Expected Result:

The assignment should be intercepted and validated according to the condition.

Actual Result:

No validation occurs as the type is treated as a plain Python str.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions