-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[patch] Fix bad file names for windows (#64)
- Loading branch information
1 parent
a497d6f
commit 6503998
Showing
4 changed files
with
167 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:apikit="http://www.mulesoft.org/schema/mule/mule-apikit" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/mule-apikit http://www.mulesoft.org/schema/mule/mule-apikit/current/mule-apikit.xsd "> | ||
<http:listener-config name="test-api-httpListenerConfig"> | ||
<http:listener-connection host="0.0.0.0" port="8081" /> | ||
</http:listener-config> | ||
<apikit:config name="test-api-config" api="test-api.raml" outboundHeadersMapName="outboundHeaders" httpStatusVarName="httpStatus" /> | ||
<flow name="test-api-main"> | ||
<http:listener config-ref="test-api-httpListenerConfig" path="/api/*"> | ||
<http:response statusCode="#[vars.httpStatus default 200]"> | ||
<http:headers>#[vars.outboundHeaders default {}]</http:headers> | ||
</http:response> | ||
<http:error-response statusCode="#[vars.httpStatus default 500]"> | ||
<http:body>#[payload]</http:body> | ||
<http:headers>#[vars.outboundHeaders default {}]</http:headers> | ||
</http:error-response> | ||
</http:listener> | ||
<apikit:router config-ref="test-api-config" /> | ||
<error-handler> | ||
<on-error-propagate type="APIKIT:BAD_REQUEST"> | ||
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd"> | ||
<ee:message> | ||
<ee:set-payload><![CDATA[%dw 2.0 | ||
output application/json | ||
--- | ||
{message: "Bad request"}]]></ee:set-payload> | ||
</ee:message> | ||
<ee:variables> | ||
<ee:set-variable variableName="httpStatus">400</ee:set-variable> | ||
</ee:variables> | ||
</ee:transform> | ||
</on-error-propagate> | ||
<on-error-propagate type="APIKIT:NOT_FOUND"> | ||
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd"> | ||
<ee:message> | ||
<ee:set-payload><![CDATA[%dw 2.0 | ||
output application/json | ||
--- | ||
{message: "Resource not found"}]]></ee:set-payload> | ||
</ee:message> | ||
<ee:variables> | ||
<ee:set-variable variableName="httpStatus">404</ee:set-variable> | ||
</ee:variables> | ||
</ee:transform> | ||
</on-error-propagate> | ||
<on-error-propagate type="APIKIT:METHOD_NOT_ALLOWED"> | ||
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd"> | ||
<ee:message> | ||
<ee:set-payload><![CDATA[%dw 2.0 | ||
output application/json | ||
--- | ||
{message: "Method not allowed"}]]></ee:set-payload> | ||
</ee:message> | ||
<ee:variables> | ||
<ee:set-variable variableName="httpStatus">405</ee:set-variable> | ||
</ee:variables> | ||
</ee:transform> | ||
</on-error-propagate> | ||
<on-error-propagate type="APIKIT:NOT_ACCEPTABLE"> | ||
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd"> | ||
<ee:message> | ||
<ee:set-payload><![CDATA[%dw 2.0 | ||
output application/json | ||
--- | ||
{message: "Not acceptable"}]]></ee:set-payload> | ||
</ee:message> | ||
<ee:variables> | ||
<ee:set-variable variableName="httpStatus">406</ee:set-variable> | ||
</ee:variables> | ||
</ee:transform> | ||
</on-error-propagate> | ||
<on-error-propagate type="APIKIT:UNSUPPORTED_MEDIA_TYPE"> | ||
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd"> | ||
<ee:message> | ||
<ee:set-payload><![CDATA[%dw 2.0 | ||
output application/json | ||
--- | ||
{message: "Unsupported media type"}]]></ee:set-payload> | ||
</ee:message> | ||
<ee:variables> | ||
<ee:set-variable variableName="httpStatus">415</ee:set-variable> | ||
</ee:variables> | ||
</ee:transform> | ||
</on-error-propagate> | ||
<on-error-propagate type="APIKIT:NOT_IMPLEMENTED"> | ||
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd"> | ||
<ee:message> | ||
<ee:set-payload><![CDATA[%dw 2.0 | ||
output application/json | ||
--- | ||
{message: "Not Implemented"}]]></ee:set-payload> | ||
</ee:message> | ||
<ee:variables> | ||
<ee:set-variable variableName="httpStatus">501</ee:set-variable> | ||
</ee:variables> | ||
</ee:transform> | ||
</on-error-propagate> | ||
</error-handler> | ||
</flow> | ||
<flow name="test-api-console"> | ||
<http:listener config-ref="test-api-httpListenerConfig" path="/console/*"> | ||
<http:response statusCode="#[vars.httpStatus default 200]"> | ||
<http:headers>#[vars.outboundHeaders default {}]</http:headers> | ||
</http:response> | ||
<http:error-response statusCode="#[vars.httpStatus default 500]"> | ||
<http:body>#[payload]</http:body> | ||
<http:headers>#[vars.outboundHeaders default {}]</http:headers> | ||
</http:error-response> | ||
</http:listener> | ||
<apikit:console config-ref="test-api-config" /> | ||
<error-handler> | ||
<on-error-propagate type="APIKIT:NOT_FOUND"> | ||
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd"> | ||
<ee:message> | ||
<ee:set-payload><![CDATA[%dw 2.0 | ||
output application/json | ||
--- | ||
{message: "Resource not found"}]]></ee:set-payload> | ||
</ee:message> | ||
<ee:variables> | ||
<ee:set-variable variableName="httpStatus">404</ee:set-variable> | ||
</ee:variables> | ||
</ee:transform> | ||
</on-error-propagate> | ||
</error-handler> | ||
</flow> | ||
<flow name="put:\users\(userId):test-api-config"> | ||
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"> | ||
<ee:variables> | ||
<ee:set-variable variableName="userId">attributes.uriParams.'userId'</ee:set-variable> | ||
</ee:variables> | ||
</ee:transform> | ||
<logger level="INFO" message="put:\users\(userId):test-api-config" /> | ||
</flow> | ||
<flow name="get:\users:test-api-config"> | ||
<logger level="INFO" message="get:\users:test-api-config" /> | ||
</flow> | ||
<flow name="get:\users\(userId):test-api-config"> | ||
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"> | ||
<ee:variables> | ||
<ee:set-variable variableName="userId">attributes.uriParams.'userId'</ee:set-variable> | ||
</ee:variables> | ||
</ee:transform> | ||
<logger level="INFO" message="get:\users\(userId):test-api-config" /> | ||
</flow> | ||
<flow name="post:\users:test-api-config"> | ||
<logger level="INFO" message="post:\users:test-api-config" /> | ||
</flow> | ||
</mule> |