Jonathan Amsterdam
2a09582fa4
jsonschema: dynamic references
...
A dynamic reference is like a dynamic variable in a programming
language, with two twists:
- There must be a dynamic anchor in lexical scope for the ref to
resolve. (Think of it as declaring the dynamic variable.)
- The ref resolves to the schema highest on the stack, not lowest.
That feels odd, but it turns out to work for the intended purpose,
which is to provide extension points for additional features.
There is some distracting code motion and refactoring in this CL:
resolveRefs was moved down in the file, and resolution of a single
ref was split off.
Change-Id: I17da6052e0782fc540d14b8a41b06a2645923872
Reviewed-on: https://go-review.googlesource.com/c/tools/+/674155
Auto-Submit: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-21 05:05:04 -07:00
..
additionalProperties.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
allOf.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
anchor.json
jsonschema: dynamic references
2025-05-21 05:05:04 -07:00
anyOf.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
boolean_schema.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
const.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
contains.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
defs.json
jsonschema: dynamic references
2025-05-21 05:05:04 -07:00
dependentRequired.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
dependentSchemas.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
dynamicRef.json
jsonschema: dynamic references
2025-05-21 05:05:04 -07:00
enum.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
exclusiveMaximum.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
exclusiveMinimum.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
if-then-else.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
infinite-loop-detection.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
items.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
maxContains.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
maximum.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
maxItems.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
maxLength.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
maxProperties.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
minContains.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
minimum.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
minItems.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
minLength.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
minProperties.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
multipleOf.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
not.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
oneOf.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
pattern.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
patternProperties.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
prefixItems.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
properties.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
propertyNames.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
README.md
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
ref.json
jsonschema: resolve refs
2025-05-08 08:56:49 -07:00
refRemote.json
jsonschema: resolve remote references
2025-05-13 11:46:13 -07:00
required.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
type.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
unevaluatedItems.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
unevaluatedProperties.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00
uniqueItems.json
internal/mcp: move jsonschema out of mcp/internal
2025-05-05 13:17:44 -07:00