cancel
Showing results for 
Search instead for 
Did you mean: 

OData metadata in JSON

sreehari_vpillai
Active Contributor
0 Kudos

Is there any way i can get the metadata of OData service in JSON format ?

Accepted Solutions (1)

Accepted Solutions (1)

sreehari_vpillai
Active Contributor

Dear Syam,

this is the URL

***/sap/opu/odata/sap/ZCOUNTRY1_SRV/$metadata?sap-client=800&$format=JSON

SyambabuAllu
Contributor
0 Kudos

Hi Sreehari,

As per SAP releases Odata metadata is not supports JSON,It supports only XML.

In order to consume an OData service, you should retrieve the metadata that describes

the service. This is done by adding the suffix $metadata to the Service Document

URL. (OData metadata is only available in XML format, not JSON)

Try with below URL ..You will get all Entity Sets(Collection) available in your model

***/sap/opu/odata/sap/ZCOUNTRY1_SRV/?$format=JSON

Thanks,

Syam

Answers (3)

Answers (3)

sreehari_vpillai
Active Contributor
0 Kudos

Ok,

So no donuts .. its the time to start parsing XML then

Thanks guys ....Closing the post

0 Kudos

Hi,

$format=json is supported only on ServiceDocument and on Runtime UrL's

Regards,

Suma

arunchembra1
Participant
0 Kudos

Hi Sreehari,


Yes,you can pass the required format in the URL.

Example:

/FLIGHTINFORMATION/$metadata?sap-­client=100&$format=xml

/FLIGHTINFORMATION/$metadata?sap-­client=100&$format=JSON

Thanks,

Arun

sreehari_vpillai
Active Contributor
0 Kudos

Hi Arun,

Still i get the same problem.

"System query options '$expand,$filter,$format,$orderby,$skip,$top,$skiptoken,$inlinecount,$select,' are not allowed in the requested URI"

SyambabuAllu
Contributor
0 Kudos

Hi Sree,

Are you sure your passing correct way or not.Can you paste here you service document URL with ending with JSON.

Thanks,

Syam