Do SmartDocs support PATCH methods?

Not applicable

On the "Create SmartDocs Method" page for my API resource, the required HTTP Method dropdown field does not contain a PATCH method choice. My API supports PATCH methods and I would like to document that method but it seems like I cannot. I see in the javascript of the Method template it refers to PATCH as being a valid choice but there is no way to set my method to it. Is this a bug? Is there a way to get a PATCH method in SmartDocs?

Solved Solved
0 10 264
1 ACCEPTED SOLUTION

@leagerleavitt , Looks like you are running older version of Apigee Edge Developer Portal,

You can fix it easily & it takes 2 minutes or may be less than that 😉

Step 1 : Goto "admin/structure/taxonomy/smartdocs_verbs" , Click on Add Term,

4742-step1smart.png

Step 2 : Give the name as "PATCH" & Click SAVE

4743-step2smart.png

That's it. You should be able to see the PATCH in the UI.

Hope it helps. Keep us posted if any. If your query is resolved, Click on Accept link below the answer so that it's helpful for others.

View solution in original post

10 REPLIES 10

@leagerleavitt , Welcome to Apigee Community !

Yes, We do support. In general, Most of Apigee customers use Open API Spec (Swagger Spec) to create smartdocs. You can document the PATCH methods using the Open API Spec.

For example, See sample spec below, File attached, patchjson.txt (remove txt extension, use .json when you use it. I am unable to attach .json files here.)

{
    "swagger": "2.0",
    "info": {
        "description": "Patch Demo",
        "version": "1.0.0",
        "title": "Patch Demo",
        "termsOfService": "http://apigee4mv4d-test.apigee.net/terms-of-service",
        "contact": {
            "name": "API Team",
            "url": "http://apigee4mv4d-test.apigee.net/contact",
            "email": "apiteam@example.com"
        },
        "license": {
            "name": "Apache 2.0",
            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        }
    },
    "host": "apigee4mv4d-test.apigee.net",
    "basePath": "/",
    "schemes": [
        "http"
    ],
    "paths": {
        "/no-target-2": {
            "get": {
                "summary": "Patch Example",
                "operationId": "patchExample",
                "produces": [
                    null
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                },
                "parameters": []
            }
        }
    }
}

Sample, Smartdoc here, which shows patch method in action.

Regarding the UI, I do see it, Can you please clarify when you say, I don't see it ?

4737-screen-shot-2017-04-26-at-14252-pm.png

Hope it helps. Keep us posted if you see any issue while in documenting the PATCH method in smartdocs using OpenAPI Spec option.

@Anil Sagar I see that you can add it using OpenAPI however to my understanding I would need to define my entire API this way and not just a single method. As I have already made all other methods of my API using the UI, I don't want to have to redo all that work in an OpenAPI definition. I've attached a screenshot of the options in my UI. Is it possible I have an outdated version of the SmartDocs module?

screen-shot-2017-04-26-at-45622-pm.png

@leagerleavitt , Yes, Looks like outdated, Which version are you in ? Goto '/buildInfo' in portal to find out. Also, Are you on cloud / opdk ?

@Anil Sagar going to /buildinfo returned the following:

Version: 17.03.27.00
Build Number: 89
Build Timestamp: 20170327.0632
SCM Revision: 3f131834ecf990bdccf67272f3146d5acf12a6ba

I am using Apigee cloud.

@leagerleavitt , That's strange, I have same revision & i do see it. Can you navigate to '/update.php' & see any database updates pending ? Please do backup of entire instance before you do any database upgrades. DO NOT do on production instance directly. Do it on dev after taking backups.

Any way, If it still doesn't work, See solution below in the answer. Keep us posted.

@leagerleavitt , I do see it , Can you please clarify where exactly you don't see it ? Are you onCloud / OPDK ? Which version ? Which page are you on ? How can i reproduce same.

See screenshot below, Where i see , when i add a new method from UI,

4739-screen-shot-2017-04-26-at-14629-pm.png

@Anil Sagar I replied to your answer with a screenshot showing my UI without the PATCH method as an option under HTTP Verb

@leagerleavitt , Looks like you are running older version of Apigee Edge Developer Portal,

You can fix it easily & it takes 2 minutes or may be less than that 😉

Step 1 : Goto "admin/structure/taxonomy/smartdocs_verbs" , Click on Add Term,

4742-step1smart.png

Step 2 : Give the name as "PATCH" & Click SAVE

4743-step2smart.png

That's it. You should be able to see the PATCH in the UI.

Hope it helps. Keep us posted if any. If your query is resolved, Click on Accept link below the answer so that it's helpful for others.

Perfect that did the trick thank you!

Anytime 🙂 @leagerleavitt , Glad to know it helped.

Also, Did you check my earlier message (see below) why it didn't work for you in first place ?

That's strange, I have same revision & i do see it. Can you navigate to '/update.php' & see any database updates pending ? Please do backup of entire instance before you do any database upgrades. DO NOT do on production instance directly. Do it on dev after taking backups.