Add modular module upgrade: jsonschema v1.4.0#200
Conversation
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
|
@copilot don't add "new" modules just because. I don't know that we have any justification for adding httpclient, httpserver, chimux, if we're not already using them. Rather just ensure existing modular dependencies are at their latest version. jsonschema, logmasker, and letsencrypt may be valid to add, but judge that based on what functionality they unlock and whether it's true value adds. |
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Removed The net change to |
There was a problem hiding this comment.
Pull request overview
This pull request adds the jsonschema.modular module (v1.4.0) from CrisisTextLine/modular to the workflow engine, integrating JSON Schema validation capabilities. The module was already referenced in e2e test fixtures and CHANGELOG but hadn't been wired into the engine.
Changes:
- Added
github.com/CrisisTextLine/modular/modules/jsonschema v1.4.0dependency - Registered
jsonschema.modularfactory in the modularcompat plugin - Added
jsonschema.modularto core module types schema registry
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Added jsonschema v1.4.0 direct dependency and updated transitive dependencies |
| go.sum | Added checksums for jsonschema v1.4.0 and its dependencies (dlclark/regexp2, santhosh-tekuri/jsonschema/v6, json-iterator update) |
| plugins/modularcompat/plugin.go | Added jsonschema.NewModule() factory, updated descriptions and ModuleTypes manifest (maintained alphabetical order) |
| plugins/modularcompat/plugin_test.go | Updated tests to expect 3 modules instead of 2, added TestJSONSchemaModuleFactory |
| schema/schema.go | Added "jsonschema.modular" to coreModuleTypes list in alphabetical position |
| schema/module_schema.go | Registered ModuleSchema for jsonschema.modular with validation category, inputs/outputs, and description |
| example/go.mod | Updated with jsonschema v1.4.0 indirect dependency and many transitive dependencies |
| example/go.sum | Added checksums for all new transitive dependencies |
|
@copilot You added jsonschema, make sure we have ample tests to validate it's functionality in workflow usage. Such as, if I wanted to build a schema registry using workflow, and use jsonschema to validate payloads against the schema registry, how would we make that happen? we'd need to load a schema and then run the validator, right? Make sure there's tests that replicate this type of usage to ensure the implementation here is complete enough. |
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Added
|
Adds
github.com/CrisisTextLine/modular/modules/jsonschema v1.4.0to the project and wires it into the engine via themodularcompatplugin. This module is already referenced in the e2e test fixtures and CHANGELOG as an integrated module type.Dependencies added (
go.mod)modules/jsonschemaplugins/modularcompat/plugin.goAdded factory for
jsonschema.modular:schema/schema.goAdded
jsonschema.modulartocoreModuleTypes(alphabetical order maintained).schema/module_schema.goAdded schema entry for
jsonschema.modularwith service inputs/outputs andvalidationcategory.plugins/modularcompat/jsonschema_test.goAdded integration tests validating real-world
jsonschema.modularusage within workflow:TestJSONSchemaModuleWiredIntoApp— verifies the factory from the modularcompat plugin boots inside amodular.Applicationand thejsonschema.serviceis accessible.TestJSONSchemaValidateBytes— 7-case table covering valid payloads, missing required fields, extra properties (additionalProperties: false), wrong types, and empty objects.TestJSONSchemaValidateReader— validates JSON streamed through anio.Reader(mirrors HTTP request body validation).TestJSONSchemaValidateInterface— validates pre-unmarshaled Gomap[string]anypayloads directly.TestJSONSchemaRegistryWorkflow— end-to-end schema-registry scenario: compile multiple schemas (user,product) once into an in-memory registry map, then route payload validation calls to the correct schema by name (6 valid/invalid cases). This is the minimal pattern for building a workflow-based schema registry.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.