Skip to content

Should the :ref support reference a field appear after the current field? #13

@fefit

Description

@fefit
Such.as({
  a: ":string",
  b: ":ref:&./a"
});

The above example will worked fine, because the field "b" reference the field "a" is appeared before itself.

But when you changed the field's position:

// exchange the position of field 'a' and 'b'
Such.as({
  b: ":ref:&./a"
  a: ":string",
});

It will cause an error because the reference field 'a' is not generated a data yet. This may not friendly experience, but it's easy to code the logic for the library and most time you can just type the field 'a' before field 'b' to avoid this problem.

So do you think there are some scenes it's better or valuable to support that thing ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions