That's what container items are for. Vanilla does this with buckets of milk, for example. This is not handled by the crafting recipe json, but the item's class.
You need slots that only accept specific items.
As an example:
https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderfarming/inventory/SaltSlotHandler.java
Used:
https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderfarming/entity/TannerTileEntity.java#L56