Add a 'as_enum' on Scalar nodes to help with constraining inputs
Description
This adds helper methods on Node
s to allow getting a variable as an enum member.
This will ensure consistent error reporting for users when plugin authors want to constrain some inputs.
Changes proposed in this merge request:
- Mark as enums some types that weren't marked
- Add
as_enum
onScalarNode
- Add
get_enum
onMappingNode
as a shortcut for `mapping.get_scalar(value).as_enum(...) - Change core to use this when custom reporting was done
Edited by Benjamin Schubert