private JsonNode enrichWithSchema(File jsonFile) throws Exception {
        JsonNode root = OBJECT_MAPPER.readTree(jsonFile);
        new ApimanExportVisitor(root) {

            @Override
            public void visitApiVersion(String orgId, String apiId, JsonNode apiVersionNode)
                throws Exception {

                if (apiVersionNode.hasNonNull("ApiDefinition")) {
                    throw new IllegalArgumentException("The file provided already seems to have "
                        + "'ApiDefinition' entries. This migration helper will likely not be useful");
                }

                ApiVersionBean avb = OBJECT_MAPPER.treeToValue(apiVersionNode.get("ApiVersionBean"), ApiVersionBean.class);
                LOGGER.debug("Will look up schema for Api Version with ID {}", avb.getId());
                getSchema(orgId, apiId, avb).ifPresent(schema -> {
                    LOGGER.debug("Found schema of size: " + schema.capacity());
                    LOGGER.info("Adding an ApiDefinition to API Version: {}", avb.getId());
                    ((ObjectNode) apiVersionNode).put("ApiDefinition", schema.array());
                });
            }
        };
        return root;
    }
Enrich pre-2.1.0.Final release.

Adds the missing ApiDefinition field to older Apiman export files.

@author Marc Savy {@literal <marc@blackparrotlabs.io>}
migration-assistant/src/main/java/io/apiman/migration/fix_pre_21/EnrichPre21ExportCommand.java