MODINV-1406: Add customFields to item - #932
Draft
elsenhans wants to merge 3 commits into
Draft
Conversation
elsenhans
requested review from
a team,
Aliaksandr-Fedasiuk,
psmagin and
viacheslavkol
July 31, 2026 08:04
elsenhans
marked this pull request as draft
July 31, 2026 08:05
charismatic-claire
left a comment
There was a problem hiding this comment.
I basically approve. I just have some comprehensive questions and one remark about persistence. Cool. Thanks for letting me read this :)
alb3rtino
requested changes
Aug 3, 2026
alb3rtino
left a comment
There was a problem hiding this comment.
inventory interface version should be bumped as the item schema has been updated. Also require a custom-fields supporting item-storage interface, see folio-org/mod-inventory-storage#1251 (review).
charismatic-claire
approved these changes
Aug 3, 2026
JSON Schema Changes (
|
| Status | File (HEAD) |
|---|---|
| Added | ramls/customFields.json |
| Modified | ramls/item.json |
Schema changes
ramls/customFields.json
--- ramls/customFields.json (base)
+++ ramls/customFields.json (head)
@@ -0,0 +1,7 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "additionalProperties": true,
+ "description": "Object that contains custom field",
+ "javaName": "CustomFields",
+ "type": "object"
+}ramls/item.json
--- ramls/item.json (base)
+++ ramls/item.json (head)
@@ -165,6 +165,11 @@
"description": "Copy number is the piece identifier. The copy number reflects if the library has a copy of a single-volume monograph; a copy of a multi-volume, (e.g. Copy 1, or C.7.)",
"type": "string"
},
+ "customFields": {
+ "$ref": "customFields.json",
+ "description": "Object that contains custom fields",
+ "type": "object"
+ },
"descriptionOfPieces": {
"description": "Text which descripe the pieces",
"type": "string"
Author
|
@alb3rtino Thanks for the hint! |
|
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.



MODINV-1406
This PR is connected to folio-org/mod-inventory-storage#1251 (which is blocked)
Purpose
Background
mod-inventory-storagealready integratesfolio-custom-fields: it defines/persists custom field definitions via its own/custom-fieldsinterface and accepts acustomFieldsvalue on the stored item record.mod-inventorysits in front of storage with its own copy of the item schema and domain model, so without this change anycustomFieldsvalue sent by a client would be silently dropped (schema hasadditionalProperties: false) and never returned in responses.Acceptance Criteria
customFieldspersists and returns that value unchanged via mod-inventory's APIcustomFieldsomit the property from the response (no empty/null noise)mod-inventory-storageApproach
customFieldsproperty toramls/item.json(referencing a newramls/customFields.jsonschema, generic object)customFieldsfield + getter/withCustomFieldstoItem.java, and ensure it's carried over incopyWithNewId/similar copy methodsItemRepresentation.javato includecustomFieldsin the API response when presentItemUtil.javamapping in both directions: request JSON → Item, Item → stored representation, stored representation → ItemChanges Checklist
Related Issues
Learning and Resources (if applicable)
Discuss any research conducted during the development of this pull request. Include links to relevant blog posts, patterns, libraries, or addons that were used to solve the problem.
Screenshots (if applicable)
If this pull request involves any visual changes or new features, consider including screenshots or GIFs to illustrate the changes.