简体   繁体   English

如何使用 ords 重命名 oracle rest api 上的项目

[英]How to rename items on oracle rest api using ords

I want to change the name "items" on the json generate by ords on REST API.我想更改由 REST API 上的 ords 生成的 json 上的名称“items”。 I want to be the table name or dll instructions like "insert" or "update".我想成为表名或 dll 指令,如“插入”或“更新”。

I have the ords installed and runnig.我已经安装并运行了 ord。 On a module I have the GET: http://localhost:80/ords/db/products/:idTab在一个模块上,我有 GET: http://localhost:80/ords/db/products/:idTab

When I access the URL the JSON returned like this:当我访问 URL 时,JSON 返回如下:

{

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

I want to replace the items name to the table name (product).我想将项目名称替换为表名称(产品)。 How Can I do this on the ords ?我怎么能在订单上做到这一点?

{

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

You can't.你不能。

Oracle has a REST standard, which dictates the JSON response format you see for a collection using that "items" structure. Oracle 有一个 REST 标准,它规定了您看到的使用“项目”结构的集合的 JSON 响应格式。

If you want something else, you would need to create the the JSON yourself, and return the output as a media resource (clob or blob) with a mime type as application-json => when you do that, we don't convert the output to JSON.如果你想要别的东西,你需要自己创建 JSON,并将输出作为媒体资源(clob 或 blob)返回,mime 类型为 application-json => 当你这样做时,我们不会转换输出到 JSON。

在此处输入图片说明

Example here. 例子在这里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM