Skip to content

Add schema definition extension plumbing#1200

Open
jwils wants to merge 1 commit into
joshuaw/json-ingestion-gem-shellfrom
joshuaw/schema-extension-plumbing
Open

Add schema definition extension plumbing#1200
jwils wants to merge 1 commit into
joshuaw/json-ingestion-gem-shellfrom
joshuaw/schema-extension-plumbing

Conversation

@jwils
Copy link
Copy Markdown
Collaborator

@jwils jwils commented May 20, 2026

Why

Prepare schema definition for ingestion serializer extensions before moving JSON Schema code into its own gem.

What

  • Add schema definition extension_modules plumbing for APIs, factories, and rake tasks
  • Apply duplicate extension modules only once
  • Replace the rake-task sidecar enforcement option with schema-level schema.enforce_json_schema_version false
  • Update project templates, tests, and docs to configure JSON schema enforcement in schema definitions

Risk Assessment

Medium — this touches schema definition setup, but JSON Schema behavior remains in elasticgraph-schema_definition in this PR.

References

@jwils jwils force-pushed the joshuaw/schema-extension-plumbing branch from edb2d90 to ef7b7e5 Compare May 20, 2026 18:29
@jwils jwils force-pushed the joshuaw/json-ingestion-gem-shell branch from 3643e2f to 63b3c9f Compare May 20, 2026 18:29
@jwils jwils marked this pull request as ready for review May 22, 2026 18:22
Comment thread elasticgraph-apollo/apollo_tests_implementation/Rakefile Outdated
Comment thread elasticgraph-apollo/apollo_tests_implementation/Rakefile Outdated
@jwils jwils force-pushed the joshuaw/schema-extension-plumbing branch from ef7b7e5 to d841965 Compare May 22, 2026 22:41
Comment thread config/site/Rakefile
namespace schema_name do
::ElasticGraph::Local::RakeTasks.new(local_config_yaml: settings_file, path_to_schema: schema_file) do |tasks|
tasks.opensearch_versions = []
tasks.enforce_json_schema_version = false
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the site examples I think we want this to be false, as we don't want to ever bump the json schema version on them. The generated schema artifacts are git-ignored so it works fine on CI with either false or true, but it may add friction if these examples all inherit the default value of true. For example, if I'm iterating on a site example schema the default of true may force me to manually delete the schema artifacts between runs of be rake site:serve, whereas that was previously not needed.

Can you add schema.enforce_json_schema_version false next to schema.json_schema_version 1 in the site example schemas?

# ) do |tasks|
# # TODO: remove this once we're past the prototyping stage
# tasks.enforce_json_schema_version = false
# end
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful API documentation that previously rendered on our website. Can you copy it over to the new schema.enforce_json_schema_version API?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the changes here are needed--if I revert them, script/type_check still passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants