schema: create a public schema parser and programmatic construction i…#16
Merged
schema: create a public schema parser and programmatic construction i…#16
Conversation
ce32799 to
a77dfd9
Compare
…mplementation Replaces the experimental schema package (x/exp/schema) and the internal schema parser, AST, and token packages with a new public schema API. The new schema package (schema/) supports parsing and marshaling Cedar schemas in both the human-readable (.cedarschema) and JSON formats, programmatic AST construction via schema/ast, and type resolution via schema/resolved. The resolver fully qualifies entity types, inlines common type references, and indexes all declarations by their qualified names, making the resolved schema directly usable for validation and tooling. Key structural changes: the schema AST now lives in schema/ast with a cleaner type hierarchy (IsType sum type, EntityTypeRef, TypeRef, RecordType, etc.), the parser and JSON codec are internal (schema/internal/parser and schema/internal/json), and the top-level schema.Schema type provides UnmarshalCedar, MarshalCedar, UnmarshalJSON, MarshalJSON, and Resolve methods as the primary public interface. The previous experimental 1.2.5 changelog entry is removed as this functionality is now stable. Signed-Off-By: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
Signed-off-by: Phil Hassey <phil@strongdm.com>
Signed-Off-By: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
a77dfd9 to
1c365d4
Compare
… two Signed-Off-By: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
1c365d4 to
8ca8d25
Compare
Signed-Off-By: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
8ca8d25 to
e1cc9c2
Compare
patjakdev
reviewed
Feb 9, 2026
There was a problem hiding this comment.
Make sure that the sumtype linter is actually doing something here...
(it turns out that go-check-sumtype's integration with golangci-lint means it can only check intra-package, which is pretty lame. I changed the CI so that it installs the standalone tool and runs it instead).
…e fact that the key should be unqualified Signed-Off-By: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
Signed-Off-By: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
576fff5 to
b8396f3
Compare
Signed-Off-By: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
Signed-off-by: Phil Hassey <phil@strongdm.com>
Signed-off-by: Phil Hassey <phil@strongdm.com>
5ad4916 to
c266436
Compare
When running go-check-sumtype in golangci-lint, sum types can only be checked in the package in which they're defined (see golangci/golangci-lint#4158). Bummer. This change makes it so that we now run the linter explicitly in CI. Signed-Off-By: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
c266436 to
a446b9d
Compare
Signed-off-by: Phil Hassey <phil@strongdm.com>
Signed-off-by: Phil Hassey <phil@strongdm.com>
…ed more than once Signed-off-by: Phil Hassey <phil@strongdm.com>
3621b6d to
a52283f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…mplementation