feat(api): expose schema inference and validation in the public API#50
Open
shokurov wants to merge 1 commit into
Open
feat(api): expose schema inference and validation in the public API#50shokurov wants to merge 1 commit into
shokurov wants to merge 1 commit into
Conversation
Re-export createSchemaFromJson/inferSchema and validateJson with its ValidationResult/ValidationError types from src/index.ts, tagged @public for api-extractor. These are Monaco-free pure functions needed by the BDK schema editor (RSSL-11775); the Monaco-backed dialogs are not re-exported. Document the exported functions (params/returns/behavior) and every member of the ValidationResult/ValidationError types so the public .d.ts rollup carries meaningful TSDoc. RSSL-11797 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Re-exports the bare UI-free schema inference and validation functions from the public barrel (
src/index.ts) so they can be consumed as a library API, not just through the Monaco-backed dialogs.Newly exported (all tagged
@publicfor api-extractor):inferSchemasrc/lib/schema-inference.tscreateSchemaFromJsonsrc/lib/schema-inference.tsvalidateJsonsrc/utils/jsonValidator.tsValidationResultsrc/utils/jsonValidator.tsValidationErrorsrc/utils/jsonValidator.tsMotivation
A downstream schema editors need "generate schema from a JSON example" and "validate an example against a schema" as plain function calls. These already exist as pure, Monaco-free functions but weren't part of the public surface.
Notes
ajv/ajv-formatsand internal types. The Monaco-backedInferSchemaDialog/ValidateJsonDialogare intentionally not added here (they're already exported separately).@publicJSDoc tags and barrel re-exports.Verification
tsc --build— cleanbiome check— cleannpm run build(rslib + dts rollup) — all 5 symbols present indist/index.d.tsasexport declarenpm test— 65 passed, 0 failed