Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change after pydantic version upgrade #3905

Closed
matusdrobuliak66 opened this issue Feb 22, 2023 · 1 comment · Fixed by #4065
Closed

Breaking change after pydantic version upgrade #3905

matusdrobuliak66 opened this issue Feb 22, 2023 · 1 comment · Fixed by #4065
Assignees
Labels
a:models-library t:maintenance Some planned maintenance work
Milestone

Comments

@matusdrobuliak66
Copy link
Contributor

After upgrading to pydantic version 1.10.3 and higher the test__models_fit_schemas.py started to fail. The reason is that output of schema_json creation from the Pydantic model changed behavior.

{
    "anyOf": [
        {
            "additionalProperties": false,
            "properties": {
                "authors": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "email": {
                                "type": "string"
                            },
                            "affiliation": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "email"
                        ]
                    },
                    "minItems": 1
                },
                "badges": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "image": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "image",
                            "url"
                        ]
                    }
                },
                "boot-options": {
                    "type": "object",
                    "not": {
                        "additionalProperties": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "label": {
                                    "type": "string"
                                },
                                "description": {
                                    "type": "string"
                                },
                                "default": {
                                    "type": "string"
                                },
                                "items": {
                                    "type": "object",
                                    "additionalProperties": {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                            "label": {
                                                "type": "string"
                                            },
                                            "description": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "label",
                                            "description"
                                        ]
                                    }
                                }
                            },
                            "required": [
                                "label",
                                "description",
                                "default",
                                "items"
                            ]
                        },
                        "type": "object"
                    }
                },
                "contact": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "inputs": {
                    "type": "object"
                },
                "integration-version": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "outputs": {
                    "type": "object"
                },
                "thumbnail": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            },
            "required": [
                "authors",
                "boot-options",
                "contact",
                "description",
                "inputs",
                "key",
                "name",
                "outputs",
                "type",
                "version"
            ],
            "type": "object"
        },
        {
            "additionalProperties": false,
            "properties": {
                "authors": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "email": {
                                "type": "string"
                            },
                            "affiliation": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "email"
                        ]
                    },
                    "minItems": 1
                },
                "badges": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "image": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "image",
                            "url"
                        ]
                    }
                },
                "boot-options": {
                    "type": "object"
                },
                "contact": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "inputs": {
                    "type": "object",
                    "not": {
                        "additionalProperties": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "displayOrder": {
                                    "type": "number"
                                },
                                "label": {
                                    "type": "string"
                                },
                                "description": {
                                    "type": "string"
                                },
                                "type": {
                                    "type": "string"
                                },
                                "contentSchema": {
                                    "type": "object"
                                },
                                "fileToKeyMap": {
                                    "type": "object",
                                    "additionalProperties": {
                                        "type": "string"
                                    }
                                },
                                "unit": {
                                    "type": "string"
                                },
                                "defaultValue": {
                                    "type": [
                                        "boolean",
                                        "integer",
                                        "number",
                                        "string"
                                    ]
                                },
                                "widget": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "type": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "anyOf": [
                                                {
                                                    "additionalProperties": false,
                                                    "properties": {
                                                        "minHeight": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "required": [
                                                        "minHeight"
                                                    ],
                                                    "type": "object"
                                                },
                                                {
                                                    "additionalProperties": false,
                                                    "properties": {
                                                        "structure": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "additionalProperties": false,
                                                                "properties": {
                                                                    "key": {
                                                                        "type": [
                                                                            "boolean",
                                                                            "number",
                                                                            "string"
                                                                        ]
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    }
                                                                },
                                                                "required": [
                                                                    "key",
                                                                    "label"
                                                                ]
                                                            },
                                                            "minItems": 1
                                                        }
                                                    },
                                                    "required": [
                                                        "structure"
                                                    ],
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "type",
                                        "details"
                                    ]
                                }
                            },
                            "required": [
                                "label",
                                "description",
                                "type"
                            ]
                        },
                        "type": "object"
                    }
                },
                "integration-version": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "outputs": {
                    "type": "object"
                },
                "thumbnail": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            },
            "required": [
                "authors",
                "contact",
                "description",
                "inputs",
                "key",
                "name",
                "outputs",
                "type",
                "version"
            ],
            "type": "object"
        },
        {
            "additionalProperties": false,
            "properties": {
                "authors": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "email": {
                                "type": "string"
                            },
                            "affiliation": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "email"
                        ]
                    },
                    "minItems": 1
                },
                "badges": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "image": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "image",
                            "url"
                        ]
                    }
                },
                "boot-options": {
                    "type": "object"
                },
                "contact": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "inputs": {
                    "type": "object"
                },
                "integration-version": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "outputs": {
                    "type": "object",
                    "not": {
                        "additionalProperties": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "displayOrder": {
                                    "type": "number"
                                },
                                "label": {
                                    "type": "string"
                                },
                                "description": {
                                    "type": "string"
                                },
                                "type": {
                                    "type": "string"
                                },
                                "contentSchema": {
                                    "type": "object"
                                },
                                "fileToKeyMap": {
                                    "type": "object",
                                    "additionalProperties": {
                                        "type": "string"
                                    }
                                },
                                "unit": {
                                    "type": "string"
                                },
                                "widget": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "type": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "anyOf": [
                                                {
                                                    "additionalProperties": false,
                                                    "properties": {
                                                        "minHeight": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "required": [
                                                        "minHeight"
                                                    ],
                                                    "type": "object"
                                                },
                                                {
                                                    "additionalProperties": false,
                                                    "properties": {
                                                        "structure": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "additionalProperties": false,
                                                                "properties": {
                                                                    "key": {
                                                                        "type": [
                                                                            "boolean",
                                                                            "number",
                                                                            "string"
                                                                        ]
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    }
                                                                },
                                                                "required": [
                                                                    "key",
                                                                    "label"
                                                                ]
                                                            },
                                                            "minItems": 1
                                                        }
                                                    },
                                                    "required": [
                                                        "structure"
                                                    ],
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "type",
                                        "details"
                                    ]
                                }
                            },
                            "required": [
                                "label",
                                "description",
                                "type"
                            ]
                        },
                        "type": "object"
                    }
                },
                "thumbnail": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            },
            "required": [
                "authors",
                "contact",
                "description",
                "inputs",
                "key",
                "name",
                "outputs",
                "type",
                "version"
            ],
            "type": "object"
        }
    ]
}

@matusdrobuliak66 matusdrobuliak66 added t:maintenance Some planned maintenance work a:models-library labels Feb 22, 2023
@matusdrobuliak66 matusdrobuliak66 self-assigned this Feb 22, 2023
@pcrespov
Copy link
Member

pcrespov commented Mar 1, 2023

@matusdrobuliak66 NOTE that this issue should be solved before addressing ITISFoundation/osparc-issues#877

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:models-library t:maintenance Some planned maintenance work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants