简体   繁体   中英

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. I want to be the table name or dll instructions like "insert" or "update".

I have the ords installed and runnig. On a module I have the GET: http://localhost:80/ords/db/products/:idTab

When I access the URL the JSON returned like this:

{

    "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.

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.

在此处输入图片说明

Example here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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