private ObjectNode generate(MethodInfo methodInfo) {
        final ObjectNode root = mapper.createObjectNode();

        root.put("$id", methodInfo.id())
            .put("title", methodInfo.name())
            .put("description", methodInfo.descriptionInfo().docString())
            .put("additionalProperties", false)
            // TODO: Assumes every method takes an object, which is only valid for RPC based services
            //  and most of the REST services.
            .put("type", "object");

        final List<FieldInfo> methodFields;
        final Map<TypeSignature, String> visited = new HashMap<>();
        final String currentPath = "#";

        if (methodInfo.useParameterAsRoot()) {
            final TypeSignature signature = methodInfo.parameters().get(0)
                                                      .typeSignature();
            final StructInfo structInfo = typeSignatureToStructMapping.get(signature.signature());
            if (structInfo == null) {
                logger.debug("Could not find root parameter with signature: {}", signature);
                root.put("additionalProperties", true);
                methodFields = ImmutableList.of();
            } else {
                methodFields = structInfo.fields();
            }
            visited.put(signature, currentPath);
        } else {
            methodFields = methodInfo.parameters();
        }

        generateProperties(methodFields, visited, currentPath, root);
        return root;
    }
Generate the JSON Schema for the given {@link MethodInfo}.

@param methodInfo the method to generate the JSON Schema for.

@return ObjectNode containing the JSON schema for the parameter type.
core/src/main/java/com/linecorp/armeria/server/docs/JsonSchemaGenerator.java