Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refactor http/json support into fine-grained modules #41

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

evacchi
Copy link
Contributor

@evacchi evacchi commented Mar 17, 2025

Refactors the Chicory SDK spinning out HTTP and JSON as optional components.

Notes

  • HTTP and the implied JSON support must now be explicitly configured
  • It will require users to update their dependency management when upgrading. The changes maintain backward compatibility at the API level but the module and package names have changed

Key Changes

  1. Project Structure Reorganization:

    • Converted from a single module to a multi-module Maven project
    • Created a core module for essential functionality
    • Created separate HTTP-related modules for different implementations
  2. Module Breakdown:

    • core: Contains the core SDK functionality
    • http/api: Defines HTTP API interfaces
    • http/client-javanet: Implementation using Java's built-in HTTP client
    • http/client-urlconnection: Implementation using HttpURLConnection (for Android)
    • http/json-jackson: JSON implementation using Jackson
    • http/json-jakarta: JSON implementation using Jakarta JSON
    • http/config-generic: Pre-configured setup for standard Java environments
    • http/config-android: Pre-configured setup for Android environments
    • http/integration-tests: Tests for HTTP functionality
  3. Package Restructuring:

    • Moved core classes to org.extism.sdk.chicory.core
    • Moved HTTP-related classes to org.extism.sdk.chicory.http.*
    • Created specialized subpackages for different implementations
  4. HTTP Configuration Changes:

    • Made HTTP configuration optional rather than defaulting to a specific implementation
    • Improved error handling for missing HTTP configuration
    • Replaced the internal Lazy class with explicit configuration providers
  5. Exception Handling:

    • Created more specific exception types
    • Added ExtismConfigurationException for configuration issues
    • Separated HTTP and JSON exceptions from core exceptions

evacchi added 8 commits March 17, 2025 11:50
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
@evacchi evacchi self-assigned this Mar 17, 2025
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.

1 participant