Api#resourceByAssetID does not support same options as in documentation

未关闭
#357 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@adimiz1 已经在做这个了。

开始于 2025年2月6日。

评估

这个 Issue 还没有评估数据。

描述

Bug report for Cloudinary Java SDK

Before proceeding, please update to latest version and test if the issue persists

Describe the bug in a sentence or two.

It seems that Api#resourceByAssetID does not support same parameters as describe in documentation.
In Cloudinary Api Docs . E.g image_metadata is described as supported option. Thus, i would expect that
cloudinary.api().resourceByAssetID(asset.asset_id(), Map.of("image_metadata", true)) would result in GET /v1_1/<client>/resources/<asset-id>?image_metadata=true. But actually it results in /v1_1/<client>/resources/<asset-id> without 'image_metadata' parameter.

Api#resourceByAssetID implementation does not match configuration options in documentation.

    public ApiResponse resourceByAssetID(String assetId, Map options) throws Exception {
        if (options == null) options = ObjectUtils.emptyMap();
        if(options.get("fields") != null) {
            options.put("fields", StringUtils.join(ObjectUtils.asArray(options.get("fields")), ","));
        }
        Map params = ObjectUtils.only(options, "tags", "context", "moderations", "fields");
        ApiResponse response = callApi(HttpMethod.GET, Arrays.asList("resources", assetId), params, options);
        return response;
    }

Since with simple curl the api responds with expected image metadata included my guess is that the java implementation is too restrictive.

Issue Type (Can be multiple)

[ ] Build - Can’t install or import the SDK
[ ] Performance - Performance issues
[x ] Behaviour - Functions aren’t working as expected (Such as generate URL)
[ ] Documentation - Inconsistency between the docs and behaviour
[ ] Other (Specify)

Steps to reproduce

… if applicable

Error screenshots or Stack Trace (if applicable)

…

Build System

[ ] Maven
[x ] Gradle
[ ] Other (Specify)

OS (Please specify version)

[ ] Windows
[ ] Linux
[ ] Mac
[ ] Other (specify)

Versions and Libraries (fill in the version numbers)

Cloudinary Java SDK version - 2.0.0
JVM (dev environment) - 0.0.0
JVM (production environment) - 0.0.0
Maven - 0.0.0 / N/A
Gradle - 0.0.0 / N/A

Repository

If possible, please provide a link to a reproducible repository that showcases the problem

主要语言
Java
星标
176
派生
113
平均合并
9 天 20 小时
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cloudinary/cloudinary_java 的其他 Issue

查看 cloudinary/cloudinary_java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。