Skip to content

Conversation

@jairad26
Copy link
Contributor

@jairad26 jairad26 commented Nov 30, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • There are some types in ef schemas that support null json fields, which were not explicitly stated in the schemas. This PR fixes that by allowing null type
  • New functionality
    • ...

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Migration plan

Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?

Observability plan

What is the plan to instrument and monitor this change?

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@jairad26 jairad26 force-pushed the jai/update-schema-params branch from 83d3f52 to eda7a7b Compare November 30, 2025 16:52
@jairad26 jairad26 marked this pull request as ready for review November 30, 2025 16:53
@propel-code-bot
Copy link
Contributor

Make several embedding-function schema fields nullable

Updates 7 JSON schema files under schemas/embedding_functions/ so that parameters which are allowed to be null at runtime are explicitly declared as such in the schema. Most changes switch a single-type declaration (e.g. "string") to a union type ["string", "null"]; an analogous pattern is applied to boolean, integer, array, and object parameters. One new optional property query_config is added to jina.json.

Key Changes

• Changed property task, late_chunking, truncate, dimensions, embedding_type, normalized in schemas/embedding_functions/jina.json from singular types to [type, "null"] and added optional query_config
• Made gateway_id in schemas/embedding_functions/cloudflare_workers_ai.json nullable
• Made preferred_providers in schemas/embedding_functions/onnx_mini_lm_l6_v2.json nullable
• Made device in schemas/embedding_functions/open_clip.json nullable (note: still listed in required)
• Made input_type in schemas/embedding_functions/voyageai.json nullable
• Made api_key_env_var in schemas/embedding_functions/huggingface_server.json nullable
• Made instruction in schemas/embedding_functions/instructor.json nullable

Affected Areas

schemas/embedding_functions/*.json validation rules
• Any runtime JSON-schema validation/serialization logic for embedding-function configs

This summary was automatically generated by @propel-code-bot

Comment on lines +58 to 64
"query_config": {
"type": [
"object",
"null"
],
"description": "Parameter query_config for the jina embedding function"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Important

[Security] The new query_config field in jina.json has type ["object", "null"] but doesn't specify the structure of the object. JSON Schema requires either:

  • An additionalProperties constraint
  • A properties definition
  • Both

Without this, any arbitrary object structure would be valid, which likely isn't the intent. Define the expected structure:

"query_config": {
  "type": ["object", "null"],
  "description": "Parameter query_config for the jina embedding function",
  "additionalProperties": false,
  "properties": {
    // Define expected properties here
  }
}
Context for Agents
The new `query_config` field in `jina.json` has type `["object", "null"]` but doesn't specify the structure of the object. JSON Schema requires either:
- An `additionalProperties` constraint
- A `properties` definition
- Both

Without this, any arbitrary object structure would be valid, which likely isn't the intent. Define the expected structure:

```json
"query_config": {
  "type": ["object", "null"],
  "description": "Parameter query_config for the jina embedding function",
  "additionalProperties": false,
  "properties": {
    // Define expected properties here
  }
}
```

File: schemas/embedding_functions/jina.json
Line: 64

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