1

im developing an API using RAML + MULE AnypointStudio (APIkit) . so in my RAML file i had defined a resourse like this.

/player
    post:
        queryParameters:
            year: type: integer
            place: type: string

Then, into AnyPoint Studio, after importing my .raml file i got a flow with the post method asociated. I use the MySQL Conector to insert in a data base. the problem resides in the query:

INSERT INTO Matches (day,place,max_players)
VALUES (#[message.inboundProperties.'day'],#[message.inboundProperties'place'],
#[message.inboundProperties.'maxPlayers'])

when i call #[message.inboundProperties.day] it returns a string, but i want an integer value.

im new at MULE, so it would be great if you can explain me how.

ty

1 Answer 1

1

All query parameters are treated as Strings. You can use MEL to convert to an int though. Here's an example suing Java in a Mel expression to parse the parameter to an int.

#[Integer.parseInt(message.inboundProperties.day)]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.