Developer Portal not posting request in application/json format even though Content-Type is specified as application/json

Not applicable

I have created an api proxy that accepts JSON requests and using the extract variable policy to retrieve data from it. I have published the same in my developer portal using smartdocs. But when I am trying it out from the developer portal, the requests are being sent in "application/x-www-form-urlencoded" format, even though I have specified the Content-Type as application/json. As a result the extract variable policy is failing.

Please guide me if there is any way to POST request from developer portal as it is.

POST /manageservicestatus/ HTTP/1.1

Accept:
*/*
Accept-Encoding:
gzip
Accept-Language:
en-US
Authorization:
Bearer *************
Content-Length:
268
Content-Type:
application/json; type="application/x-www-form-urlencoded"; start="<startpart>"; boundary="---------------------------251172655216004--"
Host:
varunkumark-test.apigee.net
MIME-Version:
1.0
User-Agent:
Mozilla/5.0 (Windows NT 6.1; rv:49.0) Gecko/20100101 Firefox/49.0
<code>-----------------------------251172655216004--
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <startpart>

Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <textpart>
Solved Solved
3 7 525
1 ACCEPTED SOLUTION

@Varun Kumar Kannan ,

Thank you for highlighting this issue. Looks like Smartdocs is expecting $ref for body schema reference instead of inline schema ref. It's a bug in recent version of smartdocs.

3749-screen-shot-2016-10-17-at-11241-pm.png

For now, Just update the spec with "$ref", it should work fine. Please find attached spec which is working fine.

spec.zip

Keep us posted if any. If your query is resolved, please click on Accept link below the answer so that it will be helpful for others too.

View solution in original post

7 REPLIES 7

@Chris Novak , @Anil Sagar - Can you please help here and let us know if we need to do any specific settings in portal?

Thanks,

Santosh

@Varun Kumar Kannan , @santosh_ghalsasi , Please post sample OpenAPI / Swagger spec to reproduce issue & better understand same.

Hi @Anil Sagar,

I have attached the Open API spec for your reference.spec.zip

@Varun Kumar Kannan ,

Thank you for highlighting this issue. Looks like Smartdocs is expecting $ref for body schema reference instead of inline schema ref. It's a bug in recent version of smartdocs.

3749-screen-shot-2016-10-17-at-11241-pm.png

For now, Just update the spec with "$ref", it should work fine. Please find attached spec which is working fine.

spec.zip

Keep us posted if any. If your query is resolved, please click on Accept link below the answer so that it will be helpful for others too.

@harsh , @Chris Novak , @Daniel Johnson , @Marsh Gardiner FYI, Smartdocs bug found.

Hi @Anil Sagar

It is working as expected. Thanks for your help!

@Varun Kumar Kannan , Glad issue is resolved. Keep us posted moving forward if any.