Skip to content

Requirements get lost when model is made a definition #2

Description

@momania

I have a simple case where I want to reuse a definition for a time period:

val period = $(text().constraint(pattern("^P.*"))).refName("Period").$$

This gets translated in the following definition:

"Period": {
  "type": "string"
}

Also, if I add the required constraint to the field when used in a mapping like so:

field("tenor", period.constraint(required()))

This required field is not reflected in the spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions