Return complete metadata structures when calling getMetadata#6
Merged
erseco merged 5 commits intoexelearning:mainfrom Jun 30, 2025
Merged
Return complete metadata structures when calling getMetadata#6erseco merged 5 commits intoexelearning:mainfrom
erseco merged 5 commits intoexelearning:mainfrom
Conversation
Changed expected JSON where returning complete metadata sets for Package, Dublin Core, LOM and LOM-ES.
There was a problem hiding this comment.
Pull Request Overview
The PR refactors getMetadata to return only comprehensive metadata structures for Package, Dublin Core, LOM, and LOM-ES, removing page content from the response and updating documentation accordingly.
- Restructures the Package schema into nested metadata fields and removes page collection.
- Simplifies other schemas (Dublin Core, LOM, LOM-ES) to return raw data arrays.
- Updates the API docs to reflect the metadata-only return value.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/ElpParser.php | Overhauled getMetadata: removed page content, restructured Package metadata, and switched other schemas to raw data |
| docs/api.md | Updated the Returns section to indicate metadata-only response |
Comments suppressed due to low confidence (2)
src/ElpParser.php:585
- [nitpick] The schema name 'Dublin core' uses inconsistent capitalization. Consider using 'Dublin Core' for consistency with common conventions.
'schema' => 'Dublin core',
src/ElpParser.php:547
- Several new nested metadata fields (e.g., 'description', 'usage', 'project_properties', 'format', 'taxonomy', 'advanced_options') were introduced. Add or update unit tests to verify these fields appear correctly in
getMetadataoutput.
'lang' => $data['_lang'] ?? '',
| ], | ||
| 'project_properties' => [ | ||
| 'backgroundImg' => $data['_backgroundImg'] ?? '', | ||
| 'backgroundImgTile' => $data['backgroundImgTile'] ?? '', |
There was a problem hiding this comment.
The key 'backgroundImgTile' is accessed without the leading underscore, while related keys use '_backgroundImg'. If the source field is '_backgroundImgTile', update this index to avoid returning an empty string.
Suggested change
| 'backgroundImgTile' => $data['backgroundImgTile'] ?? '', | |
| 'backgroundImgTile' => $data['_backgroundImgTile'] ?? '', |
erseco
approved these changes
Jun 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getMetadata fuction returns complete metadata structures for Package, Dublin Core, LOM and LOM-ES. Removed page contents from response, leaving only metadata. Updated test expected file for getMetadata test, and api.md documentation.