如何使用Ords重命名Oracle Rest API上的项目

时间:2019-06-18 19:51:50

标签: json oracle rest api oracle-ords

我想更改REST API上ords生成的json上的名称“ items”。 我想成为表名或dll指令,例如“插入”或“更新”。

我已经安装了ords并运行了。 在模块上,我有GET:http://localhost:80/ords/db/products/:idTab

当我访问URL时,JSON返回如下:

{

    "items": [
        {
            "id_prod": 18159,
            "desc_prod": "ABRAC. \"D\"   1\""
        }
}

我想将项目名称替换为表名称(产品)。 如何在ords上执行此操作?

{

    "items": [
        {
            "id_prod": 18159,
            "desc_prod": "ABRAC. \"D\"   1\""
        }
}

1 个答案:

答案 0 :(得分:0)

你不能。

Oracle具有REST标准,该标准规定了使用该“项目”结构的集合所看到的JSON响应格式。

如果您还需要其他内容,则需要自己创建JSON,然后将输出作为媒体资源(clob或blob)以mime类型作为application-json =>返回,这样做时,我们不会t将输出转换为JSON。

enter image description here

Example here.