I am getting an error when I attempt to import a local RAML API definition into Mulesoft, it gives a very vague error that the API definition file exists and that API Kit is pointing to it.
This is the error message I get
The project is targeting Mule 4.3.0, and the version of Anypoint Studio is 7.11.1. In order to get this error I am right-clicking and selecting Mule > Generate Flows from Local REST API, I have also tried Mule > Generate flows from RAML. Both give the same error result.
The XML for the APIKit is as follows
<apikit:config outboundHeadersMapName="outboundHeaders" httpStatusVarName="httpStatus" doc:name="Router" doc:id="daffbcd4-325c-4911-a042-ca6e74e73970" name="ve-sys-moviesinformation-config" raml="ve-sys-moviesinformation.raml" api="api\ve-sys-moviesinformation.raml">
<apikit:flow-mappings >
<apikit:flow-mapping resource="/media/{movieId}" action="get" content-type="application/json" flow-ref="get:\media\(mediaId):ve-sys-moviesinformation-config" />
<apikit:flow-mapping resource="/media/{movieId}" action="post" content-type="multipart/form-data" flow-ref="post:\media\(mediaId):multipart\form-data:ve-sys-moviesinformation-config" />
</apikit:flow-mappings>
</apikit:config>
I have no idea how to resolve this issue, any help would be much appreciated.
I suspect that the problem is related to the APIKit configurations having manual mappings (ie <apikit:flow-mappings>
), which is very unusual in my experience. The normal usage that the mappings are dynamically generated at runtime and are not explicit in the configuration. Unless there is a very specific reason there is no need for manual mappings.
Also some configurations seem to be deprecated. Maybe the configuration was created with an older version of APIKit, or even carried from the Mule 3 version which is not recommended.
Try commenting or removing the APIKit configuration and repeat the Generate Flows action in Anypoint Studio. It should automatically create a sane APIKit configuration along with the flows. You may need to do some refactoring of the existing flows, but seeing it is using only two flows it is not probably a significant effort.