Product-apim: Cannot edit API Definition

Created on 25 Feb 2020  ·  3Comments  ·  Source: wso2/product-apim

I was created a sample API.
When i modify name of Resource from menu to menu123 and click to update content
Screenshot from 2020-02-25 15-10-05

In Over View, i can see the name of resource change to menu123
Screenshot from 2020-02-25 15-17-58

Then, i only click save at Runtime Configurations, it change back to menu
befor
Screenshot from 2020-02-25 15-26-14
after
Screenshot from 2020-02-25 15-27-05

3.1.0 PrioritHigh React-UI TypQuestion

All 3 comments

help me ~~

@Thangthanh, as a workaround you can follow the steps mentioned below:

  1. Update swagger definition
  2. Redeploy API from Lifecycle tab

After redeploying, if you made any changes to run-time configurations, it will not affect the changes made to resources.

@Thangthanh ,

Thanks for reporting this issue,

@vithu30

Here is a potential fix for this issue,

diff --git a/features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/APIDefinition/APIDefinition.jsx b/features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/APIDefinition/APIDefinition.jsx
index b14a6305a9..fafd494bba 100644
--- a/features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/APIDefinition/APIDefinition.jsx
+++ b/features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/APIDefinition/APIDefinition.jsx
@@ -317,7 +317,7 @@ class APIDefinition extends React.Component {
      * @param {string} toFormat The format it can be converted to.
      * */
     updateSwaggerDefinition(swaggerContent, specFormat, toFormat) {
-        const { api, intl } = this.props;
+        const { api, intl, updateAPI } = this.props;
         let parsedContent = {};
         if (this.hasJsonStructure(swaggerContent)) {
             parsedContent = JSON.parse(swaggerContent);
@@ -351,6 +351,7 @@ class APIDefinition extends React.Component {
                         this.setState({ swagger: swaggerContent });
                     }
                 }
+                updateAPI();
             })
             .catch((err) => {
                 console.log(err);
diff --git a/features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/index.jsx b/features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/index.jsx
index e18f4b1de4..5764c2e1aa 100644
--- a/features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/index.jsx
+++ b/features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/index.jsx
@@ -651,7 +651,7 @@ class Details extends Component {
                                 <Route path={Details.subPaths.OVERVIEW} component={() => <Overview api={api} />} />
                                 <Route
                                     path={Details.subPaths.API_DEFINITION}
-                                    component={() => <APIDefinition api={api} />}
+                                    component={() => <APIDefinition api={api} updateAPI={this.updateAPI} />}
                                 />
                                 <Route
                                     path={Details.subPaths.WSDL}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

YannickB picture YannickB  ·  25Comments

ruks picture ruks  ·  11Comments

kharsha64 picture kharsha64  ·  8Comments

akurathimohan picture akurathimohan  ·  3Comments

malinthaprasan picture malinthaprasan  ·  6Comments