Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Exposing types on the parsed model objects #27

Open
pmdartus opened this issue Jun 19, 2019 · 0 comments
Open

Exposing types on the parsed model objects #27

pmdartus opened this issue Jun 19, 2019 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@pmdartus
Copy link

Once the model is parsed and resolved, I am attempting to traverse the generated NodeShape tree to gather some information about the shape of our APIs. In order to properly traverse the tree, I need to differentiate between the different types of shapes (NodeShape, ArrayShape, ...). And I haven't found a proper way to do so.

My current workaround is to inspect the different object and retrieve the original class name via the special $classData that is defined on all the Scala objects.

export function isObjectNode(node) {
    return node.$classData.name.endsWith('ObjectNode');
}

It would be great if all the model objects carry along with their types. Or even better if the library provides helper functions like isObject, isArrayNode, ...

@jstoiko jstoiko added enhancement New feature or request good first issue Good for newcomers labels Jul 3, 2019
@jstoiko jstoiko added this to the v0.2.0 milestone Jul 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants