-
Notifications
You must be signed in to change notification settings - Fork 470
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
[EPIC] Import/Export: ✨ Improve Error Formats in JSON /validate
Responses
#30882
Closed
3 of 10 tasks
Tracked by
#31217
Labels
Comments
/validate
Responses
Closed
6 tasks
jgambarios
added a commit
that referenced
this issue
Jan 21, 2025
jgambarios
added a commit
that referenced
this issue
Jan 22, 2025
jgambarios
added a commit
that referenced
this issue
Jan 22, 2025
/validate
Responses/validate
Responses
This was referenced Jan 27, 2025
jgambarios
added a commit
that referenced
this issue
Feb 8, 2025
jgambarios
added a commit
that referenced
this issue
Feb 9, 2025
jgambarios
added a commit
that referenced
this issue
Feb 10, 2025
jgambarios
added a commit
that referenced
this issue
Feb 10, 2025
jgambarios
added a commit
that referenced
this issue
Feb 10, 2025
6 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Feb 20, 2025
This PR represents the final stage of the Import Content response improvements, where the `ImportContentletsProcessor` now leverages the new structured response format while maintaining full backward compatibility with existing Struts implementations. ### Changes Overview * Updated `ImportContentletsProcessor` to use new response format * Added converter to maintain backward compatibility with Struts actions * Improved error handling and validation message organization * Enhanced documentation and code organization ### What's Not Changed We intentionally kept several aspects unchanged to ensure stability: * Core import logic remains untouched * Legacy response format is still fully supported * Existing workflow processing behavior * Current transaction handling * Permission checking mechanisms While working on this code, we identified several potential improvements that were intentionally left for future iterations to keep the scope focused on the immediate needs. This PR is related to: #30882 This PR fixes: #31339
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Problem Statement
The current validation response structure in our system is unclear and inconsistent. This complexity leads to increased development costs and potential errors as it mixes data types, includes unnecessary information, and lacks a standardized error format. Simplifying and standardizing the structure would improve reliability and ease of integration.
Objectives
User Story
As a developer, I want the validation responses to be standardized and clearly structured, so that I can easily integrate and manage them in my applications.
Detailed Requirements
Here is an example of the proposal response.
The response is a JSON object with a main
results
object containing:File Information (
results.file
)Must include:
totalRows
: Total number of rows in the uploaded fileparsedRows
: Number of successfully parsed rowsheaders
: Object containing:valid
: Array of valid headers matching content type fieldsinvalid
: Array of headers that don't match any fieldsmissing
: Array of required fields not present in headersData Processing (
results.data
)Must include:
processed
: Object with counts of valid/invalid recordssummary
: Object containing:Warning System (
results.warnings
)Each warning must include:
code
: Standardized warning code (e.g.,INVALID_HEADER
,MISSING_KEY_FIELD
)field
: Affected field name (when applicable)message
: Human-readable descriptionCommon warning codes to implement:
INVALID_HEADER
: When headers don't match content type fieldsMISSING_KEY_FIELD
: When unique identifiers are missingINCOMPLETE_HEADERS
: When required fields are missing from headersError System (
results.errors
)Each error must include:
code
: Standardized error codemessage
: Detailed error descriptionrow
: Row number where error occurred (when applicable)field
: Field where error occurred (when applicable)value
: Invalid value causing the error (when applicable)Common error codes to implement:
INVALID_FILE_TYPE
: For unsupported file formatsINVALID_IMAGE_PATH
: When image references are invalidINVALID_RELATIONSHIP
: When referenced entities don't existREQUIRED_FIELD_MISSING
: When mandatory fields are emptyImportance
Development Guidelines
Acceptance Criteria
Technical Details
The response structure reform relies on standardized JSON formats.
Potential Challenges
Tasks
The text was updated successfully, but these errors were encountered: