cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TesDA
Responsive Resident
Responsive Resident

Parse JSON Schema Validation Failed

I'm trying to parse JSON using the Generate from Sample. What am I doing wrong?

 

This is the error:

"message""Invalid type. Expected Integer but got Null."

 

Here is the sample I gave it:

{"count":7816,
"next":"https://someplace.com/api/v1/somewhere/?_limit=4000&_offset=4000&include_custom_fields=False&jurisdi...",
"previous":null,
"results":[
{
"id":"jshdfkjhsf76243hkjhr",
"jurisdiction":{
"id":"akjhfkjhaf98734987kshdf",
"name":"ABCDEF",
"slug":"pcaob-rolling"},
"organization_person":{
"id":"kajhdjkhsf987247",
"custom_fields":{},
"person":{
"id":"kajhsd98724kh",
"username":"76543","first_name":"Nate",
"last_name":"Allan",
"email":"Nate.Allen@summer.com"}},
"is_primary":false,
"status":"active",
"in_compliance":false,
"start_date":"1991-01-01",
"end_date":"1992-12-31",
"extended_date":"1993-12-31",
"earned":5765.0,
"applied":5740.0,
"overall_deficit":1000.0,
"overall_applied":5740.0,
"carry_over":0.0,
"license_id":"",
"latest_annual_period":{
"id":"ksjhdfkjh8972346",
"in_compliance":false,
"start_date":"1994-01-01",
"end_date":"1995-12-31",
"extended_date":"1996-12-31",
"earned":0.0,
"applied":0.0,
"overall_applied":0,
"overall_deficit":1000.0,
"carry_over":0.0}}]}

 

This is what it generated:

 

{
    "type""object",
    "properties": {
        "count": {
            "type""integer"
        },
        "next": {
            "type""string"
        },
        "previous": {},
        "results": {
            "type""array",
            "items": {
                "type""object",
                "properties": {
                    "id": {
                        "type""string"
                    },
                    "jurisdiction": {
                        "type""object",
                        "properties": {
                            "id": {
                                "type""string"
                            },
                            "name": {
                                "type""string"
                            },
                            "slug": {
                                "type""string"
                            }
                        }
                    },
                    "organization_person": {
                        "type""object",
                        "properties": {
                            "id": {
                                "type""string"
                            },
                            "custom_fields": {
                                "type""object",
                                "properties": {}
                            },
                            "person": {
                                "type""object",
                                "properties": {
                                    "id": {
                                        "type""string"
                                    },
                                    "username": {
                                        "type""string"
                                    },
                                    "first_name": {
                                        "type""string"
                                    },
                                    "last_name": {
                                        "type""string"
                                    },
                                    "email": {
                                        "type""string"
                                    }
                                }
                            }
                        }
                    },
                    "is_primary": {
                        "type""boolean"
                    },
                    "status": {
                        "type""string"
                    },
                    "in_compliance": {
                        "type""boolean"
                    },
                    "start_date": {
                        "type""string"
                    },
                    "end_date": {
                        "type""string"
                    },
                    "extended_date": {
                        "type""string"
                    },
                    "earned": {
                        "type""integer"
                    },
                    "applied": {
                        "type""integer"
                    },
                    "overall_deficit": {
                        "type""integer"
                    },
                    "overall_applied": {
                        "type""integer"
                    },
                    "carry_over": {
                        "type""integer"
                    },
                    "license_id": {
                        "type""string"
                    },
                    "latest_annual_period": {
                        "type""object",
                        "properties": {
                            "id": {
                                "type""string"
                            },
                            "in_compliance": {
                                "type""boolean"
                            },
                            "start_date": {
                                "type""string"
                            },
                            "end_date": {
                                "type""string"
                            },
                            "extended_date": {
                                "type""string"
                            },
                            "earned": {
                                "type""integer"
                            },
                            "applied": {
                                "type""integer"
                            },
                            "overall_applied": {
                                "type""integer"
                            },
                            "overall_deficit": {
                                "type""integer"
                            },
                            "carry_over": {
                                "type""integer"
                            }
                        }
                    }
                },
                "required": [
                    "id",
                    "jurisdiction",
                    "organization_person",
                    "is_primary",
                    "status",
                    "in_compliance",
                    "start_date",
                    "end_date",
                    "extended_date",
                    "earned",
                    "applied",
                    "overall_deficit",
                    "overall_applied",
                    "carry_over",
                    "license_id",
                    "latest_annual_period"
                ]
            }
        }
    }
}
1 ACCEPTED SOLUTION

Accepted Solutions
TesDA
Responsive Resident
Responsive Resident

Interestingly that didn't work, what did work was -

 

 
  "type": ["number","null"]
 

View solution in original post

3 REPLIES 3
abm
Super User III
Super User III

Hi @TesDA 

 

You have the following required fields.

 
Looks like you are getting null for some of the integer values here. Try the following:
{
  "type": ["integer","null"]
}


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
TesDA
Responsive Resident
Responsive Resident

Interestingly that didn't work, what did work was -

 

 
  "type": ["number","null"]
 

View solution in original post

abm
Super User III
Super User III

Hi @TesDA 

 

Thats interesting. So in the sample JSON data I couldn't see "number" as type? 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (1,921)