A complete translation of the Python SHAPES.md document for Node.
Tango resources can have hundreds of fields. Shapes let you request:
- Only what you need
- In nested form
- With aliases
- With wildcards
- With flattening options
shape := field_list
field_list := field ("," field)*
field := field_name [alias] [nested]
field_name := identifier | "*"
alias := "::" identifier
nested := "(" field_list ")"
identifier := [a-zA-Z_][a-zA-Z0-9_]*
shape: "key,piid,award_date";shape: "recipient(display_name,uei)";shape: "recipient::vendor(display_name)";shape: "*";shape: "recipient(*)";shape: ShapeConfig.CONTRACTS_MINIMAL,
flat: trueThe Tango API returns dotted keys; the SDK unflattens them:
recipient.display_name → recipient.display_nameShapeParser enforces syntax.
TypeGenerator enforces semantic model rules (existence of fields, nested models).
- Use minimal shapes in production.
- Avoid full-wildcard unless you need all fields.
- Prefer shallow nested shapes for large nested structures.