cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sunchit
Frequent Visitor

Support of single arrays missing in microsoft flow

Hi,

 

I am integrating my web api with flow, I used swagger 2.0 complaint json for creating a custom connector.

The custom connector was successfully created and wanted to make a post call.

The body of my post call is something like this

{
"name": "",
"id": "",
"category": {
"id": "",
"name": ""
},
"status": "",
"photoUrls": [
""
],
"tags": [
{
"id": "",
"name": ""
}
]

The PhotoUrls is an one-D array.The json body is successfully parsed a custom connector is created.

The UI provides me to enter only one value in the array of photoUrls.I am unable to add another element inside the array.

 

Moreover when i provide values  in PhotoUrls tab as csv, it concatenates them and embed it as a single entry in the array.

Please guide me on this?

If you look at the request generated from the call, it has single entry in the photoUrls array with concatenated values provided in the PhotoUrls field.If you look at the request generated from the call, it has single entry in the photoUrls array with concatenated values provided in the PhotoUrls field.In photoUrls, values are provided as CSVIn photoUrls, values are provided as CSVUI generated from the JSON for adding a petUI generated from the JSON for adding a pet

 

Is there any specific delimiter that needs to be provided for supporting arrays in the body request?

 

The call is while adding a new pet in the petstore.

*********************************************************************************************************************************************************

Following is th JSON used.

 http://petstore.swagger.io/v2/swagger.json

 

Spoiler
{
"swagger": "2.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host": "petstore.swagger.io",
"basePath": "/v2",
"tags": [
{
"name": "pet",
"description": "Everything about your Pets",
"externalDocs": {
"description": "Find out more",
"url": "http://swagger.io"
}
},
{
"name": "store",
"description": "Access to Petstore orders"
},
{
"name": "user",
"description": "Operations about user",
"externalDocs": {
"description": "Find out more about our store",
"url": "http://swagger.io"
}
}
],
"schemes": [
"http"
],
"paths": {
"/pet": {
"post": {
"tags": [
"pet"
],
"summary": "Add a new pet to the store",
"description": "",
"operationId": "addPet",
"consumes": [
"application/json",
"application/xml"
],
"produces": [
"application/xml",
"application/json"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "Pet object that needs to be added to the store",
"required": true,
"schema": {
"$ref": "#/definitions/Pet"
}
}
],
"responses": {
"405": {
"description": "Invalid input"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
]
}
}
},
"securityDefinitions": {
"petstore_auth": {
"type": "oauth2",
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"flow": "implicit",
"scopes": {
"write:pets": "modify pets in your account",
"read:pets": "read your pets"
}
},
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "header"
}
},
"definitions": {
"Order": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"petId": {
"type": "integer",
"format": "int64"
},
"quantity": {
"type": "integer",
"format": "int32"
},
"shipDate": {
"type": "string",
"format": "date-time"
},
"status": {
"type": "string",
"description": "Order Status",
"enum": [
"placed",
"approved",
"delivered"
]
},
"complete": {
"type": "boolean",
"default": false
}
},
"xml": {
"name": "Order"
}
},
"Category": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
},
"xml": {
"name": "Category"
}
},
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"username": {
"type": "string"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"email": {
"type": "string"
},
"password": {
"type": "string"
},
"phone": {
"type": "string"
},
"userStatus": {
"type": "integer",
"format": "int32",
"description": "User Status"
}
},
"xml": {
"name": "User"
}
},
"Tag": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
},
"xml": {
"name": "Tag"
}
},
"Pet": {
"type": "object",
"required": [
"name",
"photoUrls"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"category": {
"$ref": "#/definitions/Category"
},
"name": {
"type": "string",
"example": "doggie"
},
"photoUrls": {
"type": "array",
"xml": {
"name": "photoUrl",
"wrapped": true
},
"items": {
"type": "string"
}
},
"tags": {
"type": "array",
"xml": {
"name": "tag",
"wrapped": true
},
"items": {
"$ref": "#/definitions/Tag"
}
},
"status": {
"type": "string",
"description": "pet status in the store",
"enum": [
"available",
"pending",
"sold"
]
}
},
"xml": {
"name": "Pet"
}
},
"ApiResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"type": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
},
"externalDocs": {
"description": "Find out more about Swagger",
"url": "http://swagger.io"
}
}
4 REPLIES 4
v-yamao-msft
Community Support
Community Support

Hi Sunchit,

 

I am trying to involve someone who is familiar with this issue to take a further investigation on it.


I will back once I got any response.

 

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Any update

Hi Sunchit,

 

Applogize for late response. I haven't got any updates on my side.

 

I will keep an eye on this issue and back to you once I got a response.

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Sunchit, our apologies for the delayed response, and thank you for providing the detailed snapshots.

 

I think the trouble you are hitting is that your set of array items are getting interpreted as a single array item because they are all enclosed in double quotes as a single string, like so:

{
    "name": "ABCD",
    "photoUrls": ["photo1,photo2"]
}

 

If you alter this to enclose each array item in a its own set of quotes, like this:

{
    "name": "ABCD",
    "photoUrls": ["photo1", "photo2"]
}

..Then your array should be read as containing the number of items that you expect. Please let us know if you continue having trouble after this has been changed!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (38,457)