config/schema: store parent's annotations in nodes
Sometimes we need to know somethings about ancestor nodes during processing of a current node. Now, the `<schema node>.computed.annotations` table represents all the annotations from the root of the schema down to the given schema node merged into a flat table. If the same named annotation met several times on the path, the descendant value is preferred. This computed annotations table is available everywhere, where the schema node is returned or passed as a callback's argument. For example, in values of the `<schema>:pairs()` iterator and in the `validate()` schema node's callback. It will be used in one of the next commits this way: ```lua for _, w in instance_config:pairs() do if w.schema.computed.annotations.enterprise_edition then <...> else <...> end end ``` Part of #8862 NO_DOC=the schema module is internal, at least now NO_CHANGELOG=see NO_DOC
Showing
Loading
Please register or sign in to comment