Not able to create API Model on developer portal by calling API

Not applicable

We have had an api "swagger-to-apimodel" .. with 4.16.05 version of developer portal it is not working. its creates a model but when I try open it on developer portal it give error and does not render properly.

Step before calling this API is to generate swagger for proxy, using api-to-swagger.


For your reference I have attached the swagger-to-apimodel proxy.

apigee-swagger-to-apimodel-rev2-2016-08-05.zip

Solved Solved
1 4 578
1 ACCEPTED SOLUTION

Not applicable
@Pravin

Working on the support ticket, we found that this issue was specific to API models created via the API call and the ones that were created via the UI worked fine. The error logged indicated the problem to be due to a missing template. The workaround is to upload the template after the API model is created. API call to do this would be :

https://{{host}}/v1/organizations/{{org}}/apimodels/edge/templates?type=Method&name=devportal-drupal-cms" -d @devportal-drupal-cms.hbr

View solution in original post

4 REPLIES 4

@Pravin , Can you please let us know what's the error in developer portal ? What does developer portal log messages say ?

Are you trying to auto create model for your Apigee API Proxy in developer portal ?

@Anil Sagar

Yes creating automatically creating model for my API Proxy, specially for SOAP Services.

Created model using a API Call..

3315-swaggertomodel.png

Model created by when trying to open it shows nothing...

3317-notshowingmodel.png

when click on settings of smartdocs, getting below error.

3318-errorinsettingtemplate.png

Error logs:

3319-errorlog.png

Not applicable
@Pravin

Working on the support ticket, we found that this issue was specific to API models created via the API call and the ones that were created via the UI worked fine. The error logged indicated the problem to be due to a missing template. The workaround is to upload the template after the API model is created. API call to do this would be :

https://{{host}}/v1/organizations/{{org}}/apimodels/edge/templates?type=Method&name=devportal-drupal-cms" -d @devportal-drupal-cms.hbr

Thank you @Arun Kumar

This has solved the problem I had. So the steps are now 1. call api to generate swagger..2. second api to generate model...3. api to call add template to newly created model.

thank you.