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

Refactor to Native Metaschema API Implementation #32

Open
3 tasks
wandmagic opened this issue Nov 7, 2024 · 1 comment
Open
3 tasks

Refactor to Native Metaschema API Implementation #32

wandmagic opened this issue Nov 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@wandmagic
Copy link
Collaborator

User Story

As a developer working with the OSCAL server,
I want to refactor the implementation to use the native metaschema-java APIs directly instead of CLI commands,
So that we can improve performance, reliability, and enable more advanced metaschema operations.

Goals

Background

Currently, the system uses CLI commands for metaschema operations, which has limitations:

  • Requires log4j logging to be at info level
  • Needs to write output to files before reading back
  • Limited to CLI capabilities
  • Additional overhead from CLI process management

Acceptance Criteria

  1. Replace CLI command executions with direct calls to metaschema-java APIs:

    • Core API
    • Databind API
    • Schemagen API
  2. Maintain existing functionality while using native APIs:

    • Schema generation
    • Data validation
    • Model transformation
  3. Remove dependencies on:

    • CLI command execution
    • Temporary file operations for CLI I/O
    • Log4j level requirements
  4. Update tests to verify equivalent functionality using native APIs

  5. Document any API-specific configuration or setup requirements

Technical Notes

  • This refactor should be treated as an incremental step toward a more comprehensive REST API
  • Consider maintaining CLI parity for certain operations where it provides specific benefits
  • Future scope may include expanded capabilities for generic storage and registration of metaschema models

Out of Scope

  • Full REST API implementation
  • Changes to existing endpoint interfaces
  • Additional features beyond current CLI capabilities

Implementation Phases

  1. Initial API integration for core operations
  2. Removal of CLI dependencies
  3. Performance optimization
  4. Documentation updates

Definition of Done

  • All CLI commands replaced with native API calls
  • Tests passing with equivalent coverage

Dependencies

Metaschema documentation regarding best practices of schemagen and databind

Acceptance Criteria

  • All website and readme documentation affected by the changes in this issue have been updated.
  • A Pull Request (PR) is submitted that fully addresses the goals of this User Story. This issue is referenced in the PR.
  • The CI-CD build process runs without any reported errors on the PR. This can be confirmed by reviewing that all checks have passed in the PR.

Revisions

No response

@wandmagic wandmagic added the enhancement New feature or request label Nov 7, 2024
@wandmagic
Copy link
Collaborator Author

see discussion here:
#31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant