cloudinary / cloudinary/cloudinary_java

Api#resourceByAssetID does not support same options as in documentation

Abierto
#357 2 comentarios 0 reacciones 1 asignado Reclamado por @adimiz1 Ver en GitHub
Lenguaje dominante
Java
Estrellas
175
Forks
113
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## 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 ](https://cloudinary.com/documentation/admin_api#get_details_of_a_single_resource_by_assetid_syntax). 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//resources/?image_metadata=true`. But actually it results in `/v1_1//resources/` without 'image_metadata' parameter.

Api#resourceByAssetID implementation does not match configuration options in documentation.
```java
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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.