Saving Smartdoc wipes out values and schema

Not applicable

Here are the steps that I took.

1) Created new Model

2) Imported swagger 2.0 Json file

3) Published and rendered all APIs

4) Previewed a smartdoc and was able to see the Values and Schema that were in Swagger doc

5) Edited the Smartdoc and clicked Save

6) Previewed the same smartdoc and Values and Schema were missing (content of Smartdoc looked the same)

Doing a compare on the model export and noticed the schema was missing:

Before:

"required" : true, "schema" : "{\n \"$ref\" : \"#/definitions/Something\"\n}", "type" : "body"

After:

"required" : true, "type" : "body"

Everything would work as long as I setup the Swagger doc so nothing needs to be saved, but I could see that being difficult in some situtations.

0 13 271
13 REPLIES 13

Thank you @wkbye for highlighting this issue. schema reference is required to render the request schema object. Looks like clearly a bug to me. Let us investigate further and update you.

Thanks again Anil! I look forward to your update.

@wkbye ,

Issue is already fixed in latest developer portal. I can able to reproduce above issue in older versions of developer portal.

Please update developer portal to below mentioned latest version.

Version: 16.08.29.00
Build Number: 76
Build Timestamp: 20160829.1033
SCM Revision: b33193897301d0294a2dd08cde6b4672a6eb8b70

Make sure you run /update.php (Database Updates) once you update codebase to latest.

I see that your dev instance is already updated. Where do you see above issue ? In Test / Live instances ? If that's the case, you need to update other instances too

Hope it helps. Keep us posted if any.

I was actually reporting this issue from our Dev environment. Feel free to try testing this in our dev environment since we are just setting things up.

@wkbye , Did you run database updates ? If Yes, You need to create a new version of same model by re-importing spec OR You need to delete the model & recreate the model again to see the changes. Hope it helps. Keep us posted.

Database was already updated, but I just tried to run the update again. Then I created a new Model with the same results.

@wkbye , I have tested in your portal dev instance. Created a new model called 'Test Petstore', added petstore openApi Spec, Updated "updateUser" method by editing the smartdoc page. I see request schema getting rendered as per design. It's working as expected. Am i missing something here ?

Your example seemed to work, but I'm still having issues with Swagger docs that I import. I just imported another model called "Test Swagger." Please preview any of the APIs with Values in the body and you will see the values appear. Then if you try going back and save that smartdoc you will see the value disappear.

@wkbye , Can you please explain "Swagger docs that I import" ? Are you using OpenAPI Spec ? How can i reproduce issue that you see?

I tried importing the sample "petstore.swagger.json" and I didn't have any issues after saving so it must be something in our swagger file we are trying to import. I'll compare the two to figure out what we are doing wrong.

Hi @Anil Sagar

I am facing a similar issue.

When I import the swagger in smartdocs developer portal,request schema gets populated and request value(example) gets populated in wrong format.

eg.

{

"WORKORDER":"object"

}

correct example should be like --

{ "WORKORDER":{ "Client_Work_Order_Reference": "1", "Client_Location_Reference": "DEMOLOC1" } }

but when i edit something like description from portal, request schema is removed and request value(example) gets populated which is not the example I have added in swagger, the example which i had added earlier through edit option gets populated. I cleared all the cache, still the older example gets populated.

the example which gets populated is --

{ "WORKORDER":{ "Client_Work_Order_Reference": "222", "Client_Location_Reference": "DEMOLOC0001" } }