feat: Separate SchemanticType to a new package#227
Conversation
Closes #222 The `schemantic` package has a heavy set of dependencies including `analyzer` which makes it a poor candidate to be a shared dependency across all implementations of JSON schema libaries that users may want to use with `package:genkti`. Pull out `SchemanticType` to a new package with fewer dependencies that may allow for other JSON schema libraries to take a dependency and implement `SchemanticType` for compatibility. Move `validate` to an extension method so that the implementation and error interfaces can remain in `package:schemantic`.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the schemantic package by extracting the core SchemanticType abstract class, its associated metadata, static schema factory methods, and internal schema building logic into a new schemantic_api package. The schemantic package now depends on and re-exports SchemanticType from schemantic_api, and the validate method has been moved to an extension on SchemanticType within schemantic. This modularization separates the API definition from its primary implementation, with a note in the changelog about potential static diagnostics for classes that previously overrode the validate method.
Closes #222
The
schemanticpackage has a heavy set of dependencies includinganalyzerwhich makes it a poor candidate to be a shared dependencyacross all implementations of JSON schema libaries that users may want
to use with
package:genkti. Pull outSchemanticTypeto a new packagewith fewer dependencies that may allow for other JSON schema libraries
to take a dependency and implement
SchemanticTypefor compatibility.Move
validateto an extension method so that the implementation anderror interfaces can remain in
package:schemantic.