You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iintroduce two Model modes: asJSON and asJSONGraph. The Model's default mode will be graph. These modes would create new Models, not mutate the existing one.
model.asTree().get("profiles[0..5].name")
In tree mode, all references are followed even if they are in found in the last key of the path. Sets behave the same way they would against a JSON object, replacing the target of a reference instead of the reference itself. This means that in tree mode the model will always emit JSON. In graph mode you can select references with paths, or select their target with a trailing null in the path. The null key will be aliased to a constant (REF_TARGET) for more readability. Note that null will only be necessary in the rare case in which references point to values.
This proposal can be clearly explained to developers using the same narrative we use to justify the JSON Graph language: JSON can't have refs. If you want to use a Graph, you go into Graph mode. If you want a tree, you will never see references.
Now that tree and graph moods are available, the model response output format options can be to just PathValue or Value. We've effectively separated the output format dimension from the behavior of whether the Model behaves like a tree or graph, which is a nice simplification.
The text was updated successfully, but these errors were encountered:
Iintroduce two Model modes: asJSON and asJSONGraph. The Model's default mode will be graph. These modes would create new Models, not mutate the existing one.
model.asTree().get("profiles[0..5].name")
In tree mode, all references are followed even if they are in found in the last key of the path. Sets behave the same way they would against a JSON object, replacing the target of a reference instead of the reference itself. This means that in tree mode the model will always emit JSON. In graph mode you can select references with paths, or select their target with a trailing null in the path. The null key will be aliased to a constant (REF_TARGET) for more readability. Note that null will only be necessary in the rare case in which references point to values.
This proposal can be clearly explained to developers using the same narrative we use to justify the JSON Graph language: JSON can't have refs. If you want to use a Graph, you go into Graph mode. If you want a tree, you will never see references.
Now that tree and graph moods are available, the model response output format options can be to just PathValue or Value. We've effectively separated the output format dimension from the behavior of whether the Model behaves like a tree or graph, which is a nice simplification.
The text was updated successfully, but these errors were encountered: