Skip to content

Conversation

@jy95
Copy link
Member

@jy95 jy95 commented Apr 1, 2020

Fixes #90

@SourceCodeOER SourceCodeOER deleted a comment from github-actions bot Apr 1, 2020
@github-actions
Copy link

github-actions bot commented Apr 1, 2020

Non breaking changes found between the two specifications:

{
    "breakingDifferencesFound": false,
    "nonBreakingDifferences": [
        {
            "type": "non-breaking",
            "action": "add",
            "code": "request.body.scope.add",
            "destinationSpecEntityDetails": [
                {
                    "location": "paths./api/create_exercise.post.requestBody.content.application/json.schema",
                    "value": {
                        "allOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "A Super Exercise",
                                        "minLength": 3,
                                        "maxLength": 100,
                                        "description": "The title of this exercise"
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 5000,
                                        "example": "...",
                                        "description": "The preamble of this exercise",
                                        "default": ""
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "description": "A Tag ID ( already existent in database )"
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "text": {
                                                            "type": "string",
                                                            "example": "easy",
                                                            "minLength": 1,
                                                            "maxLength": 100,
                                                            "description": "The text of this Tag"
                                                        },
                                                        "category_id": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "example": 42,
                                                            "description": "the category id to which this tag is related"
                                                        }
                                                    },
                                                    "required": [
                                                        "text",
                                                        "category_id"
                                                    ]
                                                }
                                            ]
                                        },
                                        "description": "Mixed array that contains existent tag(s) or not",
                                        "uniqueItems": true,
                                        "minItems": 3,
                                        "maxItems": 25
                                    },
                                    "url": {
                                        "type": "string",
                                        "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                        "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                        "nullable": true,
                                        "description": "If not null, the link to the exercise on a plateform"
                                    },
                                    "state": {
                                        "type": "string",
                                        "enum": [
                                            "DRAFT",
                                            "PENDING",
                                            "VALIDATED",
                                            "NOT_VALIDATED",
                                            "ARCHIVED"
                                        ],
                                        "example": "PENDING",
                                        "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                    }
                                },
                                "required": [
                                    "tags"
                                ]
                            }
                        ]
                    }
                }
            ],
            "entity": "request.body.scope",
            "source": "json-schema-diff",
            "sourceSpecEntityDetails": [
                {
                    "location": "paths./api/create_exercise.post.requestBody.content.application/json.schema",
                    "value": {
                        "allOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "A Super Exercise",
                                        "minLength": 3,
                                        "maxLength": 100,
                                        "description": "The title of this exercise"
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 5000,
                                        "example": "...",
                                        "description": "The preamble of this exercise",
                                        "default": ""
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "description": "A Tag ID ( already existent in database )"
                                                },
                                                {
                                                    "allOf": [
                                                        {
                                                            "type": "object",
                                                            "properties": {
                                                                "text": {
                                                                    "type": "string",
                                                                    "example": "easy",
                                                                    "minLength": 1,
                                                                    "maxLength": 100,
                                                                    "description": "The text of this Tag"
                                                                },
                                                                "category_id": {
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "example": 42,
                                                                    "description": "the category id to which this tag is related"
                                                                }
                                                            },
                                                            "required": [
                                                                "text",
                                                                "category_id"
                                                            ]
                                                        },
                                                        {
                                                            "type": "object",
                                                            "properties": {
                                                                "state": {
                                                                    "type": "string",
                                                                    "enum": [
                                                                        "NOT_VALIDATED",
                                                                        "VALIDATED",
                                                                        "DEPRECATED",
                                                                        "PENDING"
                                                                    ],
                                                                    "example": "DEPRECATED",
                                                                    "description": "Status of the tag into the system. Currently, 4 states are possibles :  \n\n1. NOT_VALIDATED : When a tag is officially not recognized    \n2. PENDING : The default state ( for example when an exercise is inserted into the system)     \n3. DEPRECATED : When a tag should not be used anymore   \n4. VALIDATED : When a tag is officially recognized  \n"
                                                                }
                                                            }
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "description": "Mixed array that contains existent tag(s) or not",
                                        "uniqueItems": true,
                                        "minItems": 3,
                                        "maxItems": 25
                                    },
                                    "url": {
                                        "type": "string",
                                        "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                        "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                        "nullable": true,
                                        "description": "If not null, the link to the exercise on a plateform"
                                    },
                                    "state": {
                                        "type": "string",
                                        "enum": [
                                            "DRAFT",
                                            "PENDING",
                                            "VALIDATED",
                                            "NOT_VALIDATED",
                                            "ARCHIVED"
                                        ],
                                        "example": "PENDING",
                                        "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                    }
                                },
                                "required": [
                                    "tags"
                                ]
                            }
                        ]
                    }
                }
            ],
            "details": {
                "differenceSchema": {
                    "type": "object",
                    "properties": {
                        "description": {
                            "type": "string"
                        },
                        "state": {
                            "type": "string"
                        },
                        "tags": {
                            "type": "array",
                            "items": {
                                "type": [
                                    "integer",
                                    "object"
                                ],
                                "properties": {
                                    "text": {
                                        "type": "string"
                                    },
                                    "category_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "text",
                                    "category_id"
                                ]
                            },
                            "maxItems": 25,
                            "minItems": 3,
                            "not": {
                                "type": "array",
                                "items": {
                                    "type": [
                                        "integer",
                                        "object"
                                    ],
                                    "properties": {
                                        "category_id": {
                                            "type": "integer"
                                        },
                                        "state": {
                                            "type": "string"
                                        },
                                        "text": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "category_id",
                                        "text"
                                    ]
                                }
                            }
                        },
                        "title": {
                            "type": "string"
                        },
                        "url": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "tags",
                        "title"
                    ]
                }
            }
        },
        {
            "type": "non-breaking",
            "action": "add",
            "code": "request.body.scope.add",
            "destinationSpecEntityDetails": [
                {
                    "location": "paths./api/exercises/{id}.put.requestBody.content.application/json.schema",
                    "value": {
                        "allOf": [
                            {
                                "allOf": [
                                    {
                                        "allOf": [
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "title": {
                                                        "type": "string",
                                                        "example": "A Super Exercise",
                                                        "minLength": 3,
                                                        "maxLength": 100,
                                                        "description": "The title of this exercise"
                                                    },
                                                    "description": {
                                                        "type": "string",
                                                        "maxLength": 5000,
                                                        "example": "...",
                                                        "description": "The preamble of this exercise",
                                                        "default": ""
                                                    }
                                                },
                                                "required": [
                                                    "title"
                                                ]
                                            },
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "tags": {
                                                        "type": "array",
                                                        "items": {
                                                            "oneOf": [
                                                                {
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "description": "A Tag ID ( already existent in database )"
                                                                },
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "text": {
                                                                            "type": "string",
                                                                            "example": "easy",
                                                                            "minLength": 1,
                                                                            "maxLength": 100,
                                                                            "description": "The text of this Tag"
                                                                        },
                                                                        "category_id": {
                                                                            "type": "integer",
                                                                            "minimum": 0,
                                                                            "example": 42,
                                                                            "description": "the category id to which this tag is related"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "text",
                                                                        "category_id"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        "description": "Mixed array that contains existent tag(s) or not",
                                                        "uniqueItems": true,
                                                        "minItems": 3,
                                                        "maxItems": 25
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                                        "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                                        "nullable": true,
                                                        "description": "If not null, the link to the exercise on a plateform"
                                                    },
                                                    "state": {
                                                        "type": "string",
                                                        "enum": [
                                                            "DRAFT",
                                                            "PENDING",
                                                            "VALIDATED",
                                                            "NOT_VALIDATED",
                                                            "ARCHIVED"
                                                        ],
                                                        "example": "PENDING",
                                                        "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                                    }
                                                },
                                                "required": [
                                                    "tags"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "version": {
                                                "type": "integer",
                                                "description": "The version of this exercise (optimistic lock)",
                                                "minimum": 0,
                                                "example": 42
                                            }
                                        },
                                        "required": [
                                            "version"
                                        ]
                                    }
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "removePreviousFile": {
                                        "type": "boolean",
                                        "default": false,
                                        "example": true,
                                        "description": "If set to true, the API will delete the previous file when updating the exercise"
                                    }
                                }
                            }
                        ]
                    }
                }
            ],
            "entity": "request.body.scope",
            "source": "json-schema-diff",
            "sourceSpecEntityDetails": [
                {
                    "location": "paths./api/exercises/{id}.put.requestBody.content.application/json.schema",
                    "value": {
                        "allOf": [
                            {
                                "allOf": [
                                    {
                                        "allOf": [
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "title": {
                                                        "type": "string",
                                                        "example": "A Super Exercise",
                                                        "minLength": 3,
                                                        "maxLength": 100,
                                                        "description": "The title of this exercise"
                                                    },
                                                    "description": {
                                                        "type": "string",
                                                        "maxLength": 5000,
                                                        "example": "...",
                                                        "description": "The preamble of this exercise",
                                                        "default": ""
                                                    }
                                                },
                                                "required": [
                                                    "title"
                                                ]
                                            },
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "tags": {
                                                        "type": "array",
                                                        "items": {
                                                            "oneOf": [
                                                                {
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "description": "A Tag ID ( already existent in database )"
                                                                },
                                                                {
                                                                    "allOf": [
                                                                        {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "text": {
                                                                                    "type": "string",
                                                                                    "example": "easy",
                                                                                    "minLength": 1,
                                                                                    "maxLength": 100,
                                                                                    "description": "The text of this Tag"
                                                                                },
                                                                                "category_id": {
                                                                                    "type": "integer",
                                                                                    "minimum": 0,
                                                                                    "example": 42,
                                                                                    "description": "the category id to which this tag is related"
                                                                                }
                                                                            },
                                                                            "required": [
                                                                                "text",
                                                                                "category_id"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "state": {
                                                                                    "type": "string",
                                                                                    "enum": [
                                                                                        "NOT_VALIDATED",
                                                                                        "VALIDATED",
                                                                                        "DEPRECATED",
                                                                                        "PENDING"
                                                                                    ],
                                                                                    "example": "DEPRECATED",
                                                                                    "description": "Status of the tag into the system. Currently, 4 states are possibles :  \n\n1. NOT_VALIDATED : When a tag is officially not recognized    \n2. PENDING : The default state ( for example when an exercise is inserted into the system)     \n3. DEPRECATED : When a tag should not be used anymore   \n4. VALIDATED : When a tag is officially recognized  \n"
                                                                                }
                                                                            }
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        "description": "Mixed array that contains existent tag(s) or not",
                                                        "uniqueItems": true,
                                                        "minItems": 3,
                                                        "maxItems": 25
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                                        "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                                        "nullable": true,
                                                        "description": "If not null, the link to the exercise on a plateform"
                                                    },
                                                    "state": {
                                                        "type": "string",
                                                        "enum": [
                                                            "DRAFT",
                                                            "PENDING",
                                                            "VALIDATED",
                                                            "NOT_VALIDATED",
                                                            "ARCHIVED"
                                                        ],
                                                        "example": "PENDING",
                                                        "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                                    }
                                                },
                                                "required": [
                                                    "tags"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "version": {
                                                "type": "integer",
                                                "description": "The version of this exercise (optimistic lock)",
                                                "minimum": 0,
                                                "example": 42
                                            }
                                        },
                                        "required": [
                                            "version"
                                        ]
                                    }
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "removePreviousFile": {
                                        "type": "boolean",
                                        "default": false,
                                        "example": true,
                                        "description": "If set to true, the API will delete the previous file when updating the exercise"
                                    }
                                }
                            }
                        ]
                    }
                }
            ],
            "details": {
                "differenceSchema": {
                    "type": "object",
                    "properties": {
                        "description": {
                            "type": "string"
                        },
                        "removePreviousFile": {
                            "type": "boolean"
                        },
                        "state": {
                            "type": "string"
                        },
                        "tags": {
                            "type": "array",
                            "items": {
                                "type": [
                                    "integer",
                                    "object"
                                ],
                                "properties": {
                                    "text": {
                                        "type": "string"
                                    },
                                    "category_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "text",
                                    "category_id"
                                ]
                            },
                            "maxItems": 25,
                            "minItems": 3,
                            "not": {
                                "type": "array",
                                "items": {
                                    "type": [
                                        "integer",
                                        "object"
                                    ],
                                    "properties": {
                                        "category_id": {
                                            "type": "integer"
                                        },
                                        "state": {
                                            "type": "string"
                                        },
                                        "text": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "category_id",
                                        "text"
                                    ]
                                }
                            }
                        },
                        "title": {
                            "type": "string"
                        },
                        "url": {
                            "type": "string"
                        },
                        "version": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "tags",
                        "title",
                        "version"
                    ]
                }
            }
        },
        {
            "type": "non-breaking",
            "action": "add",
            "code": "request.body.scope.add",
            "destinationSpecEntityDetails": [
                {
                    "location": "paths./api/bulk/create_exercises.post.requestBody.content.application/json.schema",
                    "value": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "allOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "title": {
                                            "type": "string",
                                            "example": "A Super Exercise",
                                            "minLength": 3,
                                            "maxLength": 100,
                                            "description": "The title of this exercise"
                                        },
                                        "description": {
                                            "type": "string",
                                            "maxLength": 5000,
                                            "example": "...",
                                            "description": "The preamble of this exercise",
                                            "default": ""
                                        }
                                    },
                                    "required": [
                                        "title"
                                    ]
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "tags": {
                                            "type": "array",
                                            "items": {
                                                "oneOf": [
                                                    {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "description": "A Tag ID ( already existent in database )"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "properties": {
                                                            "text": {
                                                                "type": "string",
                                                                "example": "easy",
                                                                "minLength": 1,
                                                                "maxLength": 100,
                                                                "description": "The text of this Tag"
                                                            },
                                                            "category_id": {
                                                                "type": "integer",
                                                                "minimum": 0,
                                                                "example": 42,
                                                                "description": "the category id to which this tag is related"
                                                            }
                                                        },
                                                        "required": [
                                                            "text",
                                                            "category_id"
                                                        ]
                                                    }
                                                ]
                                            },
                                            "description": "Mixed array that contains existent tag(s) or not",
                                            "uniqueItems": true,
                                            "minItems": 3,
                                            "maxItems": 25
                                        },
                                        "url": {
                                            "type": "string",
                                            "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                            "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                            "nullable": true,
                                            "description": "If not null, the link to the exercise on a plateform"
                                        },
                                        "state": {
                                            "type": "string",
                                            "enum": [
                                                "DRAFT",
                                                "PENDING",
                                                "VALIDATED",
                                                "NOT_VALIDATED",
                                                "ARCHIVED"
                                            ],
                                            "example": "PENDING",
                                            "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                        }
                                    },
                                    "required": [
                                        "tags"
                                    ]
                                }
                            ]
                        }
                    }
                }
            ],
            "entity": "request.body.scope",
            "source": "json-schema-diff",
            "sourceSpecEntityDetails": [
                {
                    "location": "paths./api/bulk/create_exercises.post.requestBody.content.application/json.schema",
                    "value": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "allOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "title": {
                                            "type": "string",
                                            "example": "A Super Exercise",
                                            "minLength": 3,
                                            "maxLength": 100,
                                            "description": "The title of this exercise"
                                        },
                                        "description": {
                                            "type": "string",
                                            "maxLength": 5000,
                                            "example": "...",
                                            "description": "The preamble of this exercise",
                                            "default": ""
                                        }
                                    },
                                    "required": [
                                        "title"
                                    ]
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "tags": {
                                            "type": "array",
                                            "items": {
                                                "oneOf": [
                                                    {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "description": "A Tag ID ( already existent in database )"
                                                    },
                                                    {
                                                        "allOf": [
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "text": {
                                                                        "type": "string",
                                                                        "example": "easy",
                                                                        "minLength": 1,
                                                                        "maxLength": 100,
                                                                        "description": "The text of this Tag"
                                                                    },
                                                                    "category_id": {
                                                                        "type": "integer",
                                                                        "minimum": 0,
                                                                        "example": 42,
                                                                        "description": "the category id to which this tag is related"
                                                                    }
                                                                },
                                                                "required": [
                                                                    "text",
                                                                    "category_id"
                                                                ]
                                                            },
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "state": {
                                                                        "type": "string",
                                                                        "enum": [
                                                                            "NOT_VALIDATED",
                                                                            "VALIDATED",
                                                                            "DEPRECATED",
                                                                            "PENDING"
                                                                        ],
                                                                        "example": "DEPRECATED",
                                                                        "description": "Status of the tag into the system. Currently, 4 states are possibles :  \n\n1. NOT_VALIDATED : When a tag is officially not recognized    \n2. PENDING : The default state ( for example when an exercise is inserted into the system)     \n3. DEPRECATED : When a tag should not be used anymore   \n4. VALIDATED : When a tag is officially recognized  \n"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            "description": "Mixed array that contains existent tag(s) or not",
                                            "uniqueItems": true,
                                            "minItems": 3,
                                            "maxItems": 25
                                        },
                                        "url": {
                                            "type": "string",
                                            "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                            "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                            "nullable": true,
                                            "description": "If not null, the link to the exercise on a plateform"
                                        },
                                        "state": {
                                            "type": "string",
                                            "enum": [
                                                "DRAFT",
                                                "PENDING",
                                                "VALIDATED",
                                                "NOT_VALIDATED",
                                                "ARCHIVED"
                                            ],
                                            "example": "PENDING",
                                            "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                        }
                                    },
                                    "required": [
                                        "tags"
                                    ]
                                }
                            ]
                        }
                    }
                }
            ],
            "details": {
                "differenceSchema": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "description": {
                                "type": "string"
                            },
                            "state": {
                                "type": "string"
                            },
                            "tags": {
                                "type": "array",
                                "items": {
                                    "type": [
                                        "integer",
                                        "object"
                                    ],
                                    "properties": {
                                        "text": {
                                            "type": "string"
                                        },
                                        "category_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "text",
                                        "category_id"
                                    ]
                                },
                                "maxItems": 25,
                                "minItems": 3
                            },
                            "title": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "tags",
                            "title"
                        ]
                    },
                    "minItems": 1,
                    "not": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "description": {
                                    "type": "string"
                                },
                                "state": {
                                    "type": "string"
                                },
                                "tags": {
                                    "type": "array",
                                    "items": {
                                        "type": [
                                            "integer",
                                            "object"
                                        ],
                                        "properties": {
                                            "category_id": {
                                                "type": "integer"
                                            },
                                            "state": {
                                                "type": "string"
                                            },
                                            "text": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "category_id",
                                            "text"
                                        ]
                                    },
                                    "maxItems": 25,
                                    "minItems": 3
                                },
                                "title": {
                                    "type": "string"
                                },
                                "url": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "tags",
                                "title"
                            ]
                        }
                    }
                }
            }
        }
    ],
    "unclassifiedDifferences": []
}

@codecov
Copy link

codecov bot commented Apr 1, 2020

Codecov Report

Merging #91 into master will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #91   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           69        69           
  Lines         1202      1223   +21     
  Branches       178       185    +7     
=========================================
+ Hits          1202      1223   +21     
Impacted Files Coverage Δ
controllers/_common/utlis_fct.js 100.00% <100.00%> (ø)
controllers/exercises/updateExercise.js 100.00% <100.00%> (ø)
middlewares/rules/bulk.js 100.00% <100.00%> (ø)
middlewares/rules/common_sub_middlewares/index.js 100.00% <100.00%> (ø)
middlewares/rules/exercises.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc7552d...00e7941. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Apr 1, 2020

Non breaking changes found between the two specifications:

{
    "breakingDifferencesFound": false,
    "nonBreakingDifferences": [
        {
            "type": "non-breaking",
            "action": "add",
            "code": "request.body.scope.add",
            "destinationSpecEntityDetails": [
                {
                    "location": "paths./api/create_exercise.post.requestBody.content.application/json.schema",
                    "value": {
                        "allOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "A Super Exercise",
                                        "minLength": 3,
                                        "maxLength": 100,
                                        "description": "The title of this exercise"
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 5000,
                                        "example": "...",
                                        "description": "The preamble of this exercise",
                                        "default": ""
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "description": "A Tag ID ( already existent in database )"
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "text": {
                                                            "type": "string",
                                                            "example": "easy",
                                                            "minLength": 1,
                                                            "maxLength": 100,
                                                            "description": "The text of this Tag"
                                                        },
                                                        "category_id": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "example": 42,
                                                            "description": "the category id to which this tag is related"
                                                        }
                                                    },
                                                    "required": [
                                                        "text",
                                                        "category_id"
                                                    ]
                                                }
                                            ]
                                        },
                                        "description": "Mixed array that contains existent tag(s) or not",
                                        "uniqueItems": true,
                                        "minItems": 3,
                                        "maxItems": 25
                                    },
                                    "url": {
                                        "type": "string",
                                        "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                        "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                        "nullable": true,
                                        "description": "If not null, the link to the exercise on a plateform"
                                    },
                                    "state": {
                                        "type": "string",
                                        "enum": [
                                            "DRAFT",
                                            "PENDING",
                                            "VALIDATED",
                                            "NOT_VALIDATED",
                                            "ARCHIVED"
                                        ],
                                        "example": "PENDING",
                                        "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                    }
                                },
                                "required": [
                                    "tags"
                                ]
                            }
                        ]
                    }
                }
            ],
            "entity": "request.body.scope",
            "source": "json-schema-diff",
            "sourceSpecEntityDetails": [
                {
                    "location": "paths./api/create_exercise.post.requestBody.content.application/json.schema",
                    "value": {
                        "allOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "A Super Exercise",
                                        "minLength": 3,
                                        "maxLength": 100,
                                        "description": "The title of this exercise"
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 5000,
                                        "example": "...",
                                        "description": "The preamble of this exercise",
                                        "default": ""
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "description": "A Tag ID ( already existent in database )"
                                                },
                                                {
                                                    "allOf": [
                                                        {
                                                            "type": "object",
                                                            "properties": {
                                                                "text": {
                                                                    "type": "string",
                                                                    "example": "easy",
                                                                    "minLength": 1,
                                                                    "maxLength": 100,
                                                                    "description": "The text of this Tag"
                                                                },
                                                                "category_id": {
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "example": 42,
                                                                    "description": "the category id to which this tag is related"
                                                                }
                                                            },
                                                            "required": [
                                                                "text",
                                                                "category_id"
                                                            ]
                                                        },
                                                        {
                                                            "type": "object",
                                                            "properties": {
                                                                "state": {
                                                                    "type": "string",
                                                                    "enum": [
                                                                        "NOT_VALIDATED",
                                                                        "VALIDATED",
                                                                        "DEPRECATED",
                                                                        "PENDING"
                                                                    ],
                                                                    "example": "DEPRECATED",
                                                                    "description": "Status of the tag into the system. Currently, 4 states are possibles :  \n\n1. NOT_VALIDATED : When a tag is officially not recognized    \n2. PENDING : The default state ( for example when an exercise is inserted into the system)     \n3. DEPRECATED : When a tag should not be used anymore   \n4. VALIDATED : When a tag is officially recognized  \n"
                                                                }
                                                            }
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "description": "Mixed array that contains existent tag(s) or not",
                                        "uniqueItems": true,
                                        "minItems": 3,
                                        "maxItems": 25
                                    },
                                    "url": {
                                        "type": "string",
                                        "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                        "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                        "nullable": true,
                                        "description": "If not null, the link to the exercise on a plateform"
                                    },
                                    "state": {
                                        "type": "string",
                                        "enum": [
                                            "DRAFT",
                                            "PENDING",
                                            "VALIDATED",
                                            "NOT_VALIDATED",
                                            "ARCHIVED"
                                        ],
                                        "example": "PENDING",
                                        "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                    }
                                },
                                "required": [
                                    "tags"
                                ]
                            }
                        ]
                    }
                }
            ],
            "details": {
                "differenceSchema": {
                    "type": "object",
                    "properties": {
                        "description": {
                            "type": "string"
                        },
                        "state": {
                            "type": "string"
                        },
                        "tags": {
                            "type": "array",
                            "items": {
                                "type": [
                                    "integer",
                                    "object"
                                ],
                                "properties": {
                                    "text": {
                                        "type": "string"
                                    },
                                    "category_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "text",
                                    "category_id"
                                ]
                            },
                            "maxItems": 25,
                            "minItems": 3,
                            "not": {
                                "type": "array",
                                "items": {
                                    "type": [
                                        "integer",
                                        "object"
                                    ],
                                    "properties": {
                                        "category_id": {
                                            "type": "integer"
                                        },
                                        "state": {
                                            "type": "string"
                                        },
                                        "text": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "category_id",
                                        "text"
                                    ]
                                }
                            }
                        },
                        "title": {
                            "type": "string"
                        },
                        "url": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "tags",
                        "title"
                    ]
                }
            }
        },
        {
            "type": "non-breaking",
            "action": "add",
            "code": "request.body.scope.add",
            "destinationSpecEntityDetails": [
                {
                    "location": "paths./api/exercises/{id}.put.requestBody.content.application/json.schema",
                    "value": {
                        "allOf": [
                            {
                                "allOf": [
                                    {
                                        "allOf": [
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "title": {
                                                        "type": "string",
                                                        "example": "A Super Exercise",
                                                        "minLength": 3,
                                                        "maxLength": 100,
                                                        "description": "The title of this exercise"
                                                    },
                                                    "description": {
                                                        "type": "string",
                                                        "maxLength": 5000,
                                                        "example": "...",
                                                        "description": "The preamble of this exercise",
                                                        "default": ""
                                                    }
                                                },
                                                "required": [
                                                    "title"
                                                ]
                                            },
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "tags": {
                                                        "type": "array",
                                                        "items": {
                                                            "oneOf": [
                                                                {
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "description": "A Tag ID ( already existent in database )"
                                                                },
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "text": {
                                                                            "type": "string",
                                                                            "example": "easy",
                                                                            "minLength": 1,
                                                                            "maxLength": 100,
                                                                            "description": "The text of this Tag"
                                                                        },
                                                                        "category_id": {
                                                                            "type": "integer",
                                                                            "minimum": 0,
                                                                            "example": 42,
                                                                            "description": "the category id to which this tag is related"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "text",
                                                                        "category_id"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        "description": "Mixed array that contains existent tag(s) or not",
                                                        "uniqueItems": true,
                                                        "minItems": 3,
                                                        "maxItems": 25
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                                        "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                                        "nullable": true,
                                                        "description": "If not null, the link to the exercise on a plateform"
                                                    },
                                                    "state": {
                                                        "type": "string",
                                                        "enum": [
                                                            "DRAFT",
                                                            "PENDING",
                                                            "VALIDATED",
                                                            "NOT_VALIDATED",
                                                            "ARCHIVED"
                                                        ],
                                                        "example": "PENDING",
                                                        "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                                    }
                                                },
                                                "required": [
                                                    "tags"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "version": {
                                                "type": "integer",
                                                "description": "The version of this exercise (optimistic lock)",
                                                "minimum": 0,
                                                "example": 42
                                            }
                                        },
                                        "required": [
                                            "version"
                                        ]
                                    }
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "removePreviousFile": {
                                        "type": "boolean",
                                        "default": false,
                                        "example": true,
                                        "description": "If set to true, the API will delete the previous file when updating the exercise"
                                    }
                                }
                            }
                        ]
                    }
                }
            ],
            "entity": "request.body.scope",
            "source": "json-schema-diff",
            "sourceSpecEntityDetails": [
                {
                    "location": "paths./api/exercises/{id}.put.requestBody.content.application/json.schema",
                    "value": {
                        "allOf": [
                            {
                                "allOf": [
                                    {
                                        "allOf": [
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "title": {
                                                        "type": "string",
                                                        "example": "A Super Exercise",
                                                        "minLength": 3,
                                                        "maxLength": 100,
                                                        "description": "The title of this exercise"
                                                    },
                                                    "description": {
                                                        "type": "string",
                                                        "maxLength": 5000,
                                                        "example": "...",
                                                        "description": "The preamble of this exercise",
                                                        "default": ""
                                                    }
                                                },
                                                "required": [
                                                    "title"
                                                ]
                                            },
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "tags": {
                                                        "type": "array",
                                                        "items": {
                                                            "oneOf": [
                                                                {
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "description": "A Tag ID ( already existent in database )"
                                                                },
                                                                {
                                                                    "allOf": [
                                                                        {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "text": {
                                                                                    "type": "string",
                                                                                    "example": "easy",
                                                                                    "minLength": 1,
                                                                                    "maxLength": 100,
                                                                                    "description": "The text of this Tag"
                                                                                },
                                                                                "category_id": {
                                                                                    "type": "integer",
                                                                                    "minimum": 0,
                                                                                    "example": 42,
                                                                                    "description": "the category id to which this tag is related"
                                                                                }
                                                                            },
                                                                            "required": [
                                                                                "text",
                                                                                "category_id"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "state": {
                                                                                    "type": "string",
                                                                                    "enum": [
                                                                                        "NOT_VALIDATED",
                                                                                        "VALIDATED",
                                                                                        "DEPRECATED",
                                                                                        "PENDING"
                                                                                    ],
                                                                                    "example": "DEPRECATED",
                                                                                    "description": "Status of the tag into the system. Currently, 4 states are possibles :  \n\n1. NOT_VALIDATED : When a tag is officially not recognized    \n2. PENDING : The default state ( for example when an exercise is inserted into the system)     \n3. DEPRECATED : When a tag should not be used anymore   \n4. VALIDATED : When a tag is officially recognized  \n"
                                                                                }
                                                                            }
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        "description": "Mixed array that contains existent tag(s) or not",
                                                        "uniqueItems": true,
                                                        "minItems": 3,
                                                        "maxItems": 25
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                                        "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                                        "nullable": true,
                                                        "description": "If not null, the link to the exercise on a plateform"
                                                    },
                                                    "state": {
                                                        "type": "string",
                                                        "enum": [
                                                            "DRAFT",
                                                            "PENDING",
                                                            "VALIDATED",
                                                            "NOT_VALIDATED",
                                                            "ARCHIVED"
                                                        ],
                                                        "example": "PENDING",
                                                        "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                                    }
                                                },
                                                "required": [
                                                    "tags"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "version": {
                                                "type": "integer",
                                                "description": "The version of this exercise (optimistic lock)",
                                                "minimum": 0,
                                                "example": 42
                                            }
                                        },
                                        "required": [
                                            "version"
                                        ]
                                    }
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "removePreviousFile": {
                                        "type": "boolean",
                                        "default": false,
                                        "example": true,
                                        "description": "If set to true, the API will delete the previous file when updating the exercise"
                                    }
                                }
                            }
                        ]
                    }
                }
            ],
            "details": {
                "differenceSchema": {
                    "type": "object",
                    "properties": {
                        "description": {
                            "type": "string"
                        },
                        "removePreviousFile": {
                            "type": "boolean"
                        },
                        "state": {
                            "type": "string"
                        },
                        "tags": {
                            "type": "array",
                            "items": {
                                "type": [
                                    "integer",
                                    "object"
                                ],
                                "properties": {
                                    "text": {
                                        "type": "string"
                                    },
                                    "category_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "text",
                                    "category_id"
                                ]
                            },
                            "maxItems": 25,
                            "minItems": 3,
                            "not": {
                                "type": "array",
                                "items": {
                                    "type": [
                                        "integer",
                                        "object"
                                    ],
                                    "properties": {
                                        "category_id": {
                                            "type": "integer"
                                        },
                                        "state": {
                                            "type": "string"
                                        },
                                        "text": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "category_id",
                                        "text"
                                    ]
                                }
                            }
                        },
                        "title": {
                            "type": "string"
                        },
                        "url": {
                            "type": "string"
                        },
                        "version": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "tags",
                        "title",
                        "version"
                    ]
                }
            }
        },
        {
            "type": "non-breaking",
            "action": "add",
            "code": "request.body.scope.add",
            "destinationSpecEntityDetails": [
                {
                    "location": "paths./api/bulk/create_exercises.post.requestBody.content.application/json.schema",
                    "value": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "allOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "title": {
                                            "type": "string",
                                            "example": "A Super Exercise",
                                            "minLength": 3,
                                            "maxLength": 100,
                                            "description": "The title of this exercise"
                                        },
                                        "description": {
                                            "type": "string",
                                            "maxLength": 5000,
                                            "example": "...",
                                            "description": "The preamble of this exercise",
                                            "default": ""
                                        }
                                    },
                                    "required": [
                                        "title"
                                    ]
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "tags": {
                                            "type": "array",
                                            "items": {
                                                "oneOf": [
                                                    {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "description": "A Tag ID ( already existent in database )"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "properties": {
                                                            "text": {
                                                                "type": "string",
                                                                "example": "easy",
                                                                "minLength": 1,
                                                                "maxLength": 100,
                                                                "description": "The text of this Tag"
                                                            },
                                                            "category_id": {
                                                                "type": "integer",
                                                                "minimum": 0,
                                                                "example": 42,
                                                                "description": "the category id to which this tag is related"
                                                            }
                                                        },
                                                        "required": [
                                                            "text",
                                                            "category_id"
                                                        ]
                                                    }
                                                ]
                                            },
                                            "description": "Mixed array that contains existent tag(s) or not",
                                            "uniqueItems": true,
                                            "minItems": 3,
                                            "maxItems": 25
                                        },
                                        "url": {
                                            "type": "string",
                                            "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                            "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                            "nullable": true,
                                            "description": "If not null, the link to the exercise on a plateform"
                                        },
                                        "state": {
                                            "type": "string",
                                            "enum": [
                                                "DRAFT",
                                                "PENDING",
                                                "VALIDATED",
                                                "NOT_VALIDATED",
                                                "ARCHIVED"
                                            ],
                                            "example": "PENDING",
                                            "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                        }
                                    },
                                    "required": [
                                        "tags"
                                    ]
                                }
                            ]
                        }
                    }
                }
            ],
            "entity": "request.body.scope",
            "source": "json-schema-diff",
            "sourceSpecEntityDetails": [
                {
                    "location": "paths./api/bulk/create_exercises.post.requestBody.content.application/json.schema",
                    "value": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "allOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "title": {
                                            "type": "string",
                                            "example": "A Super Exercise",
                                            "minLength": 3,
                                            "maxLength": 100,
                                            "description": "The title of this exercise"
                                        },
                                        "description": {
                                            "type": "string",
                                            "maxLength": 5000,
                                            "example": "...",
                                            "description": "The preamble of this exercise",
                                            "default": ""
                                        }
                                    },
                                    "required": [
                                        "title"
                                    ]
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "tags": {
                                            "type": "array",
                                            "items": {
                                                "oneOf": [
                                                    {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "description": "A Tag ID ( already existent in database )"
                                                    },
                                                    {
                                                        "allOf": [
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "text": {
                                                                        "type": "string",
                                                                        "example": "easy",
                                                                        "minLength": 1,
                                                                        "maxLength": 100,
                                                                        "description": "The text of this Tag"
                                                                    },
                                                                    "category_id": {
                                                                        "type": "integer",
                                                                        "minimum": 0,
                                                                        "example": 42,
                                                                        "description": "the category id to which this tag is related"
                                                                    }
                                                                },
                                                                "required": [
                                                                    "text",
                                                                    "category_id"
                                                                ]
                                                            },
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "state": {
                                                                        "type": "string",
                                                                        "enum": [
                                                                            "NOT_VALIDATED",
                                                                            "VALIDATED",
                                                                            "DEPRECATED",
                                                                            "PENDING"
                                                                        ],
                                                                        "example": "DEPRECATED",
                                                                        "description": "Status of the tag into the system. Currently, 4 states are possibles :  \n\n1. NOT_VALIDATED : When a tag is officially not recognized    \n2. PENDING : The default state ( for example when an exercise is inserted into the system)     \n3. DEPRECATED : When a tag should not be used anymore   \n4. VALIDATED : When a tag is officially recognized  \n"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            "description": "Mixed array that contains existent tag(s) or not",
                                            "uniqueItems": true,
                                            "minItems": 3,
                                            "maxItems": 25
                                        },
                                        "url": {
                                            "type": "string",
                                            "pattern": "^https?:\\/\\/[^\\s$.?#].[^\\s]*$",
                                            "example": "https://inginious.info.ucl.ac.be/course/LEPL1402/Streams",
                                            "nullable": true,
                                            "description": "If not null, the link to the exercise on a plateform"
                                        },
                                        "state": {
                                            "type": "string",
                                            "enum": [
                                                "DRAFT",
                                                "PENDING",
                                                "VALIDATED",
                                                "NOT_VALIDATED",
                                                "ARCHIVED"
                                            ],
                                            "example": "PENDING",
                                            "description": "Status of the exercise into the system. Currently, 5 states are possibles :\n\n1. DRAFT : The default state (for example when an exercise is inserted into the system)\n2. PENDING : When an exercise is ready for review\n3. VALIDATED : When an exercise is validated by an admin\n4. NOT_VALIDATED : When an exercise is refused by an admin\n5. ARCHIVED : When an exercise is archived / soft deleted\n"
                                        }
                                    },
                                    "required": [
                                        "tags"
                                    ]
                                }
                            ]
                        }
                    }
                }
            ],
            "details": {
                "differenceSchema": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "description": {
                                "type": "string"
                            },
                            "state": {
                                "type": "string"
                            },
                            "tags": {
                                "type": "array",
                                "items": {
                                    "type": [
                                        "integer",
                                        "object"
                                    ],
                                    "properties": {
                                        "text": {
                                            "type": "string"
                                        },
                                        "category_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "text",
                                        "category_id"
                                    ]
                                },
                                "maxItems": 25,
                                "minItems": 3
                            },
                            "title": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "tags",
                            "title"
                        ]
                    },
                    "minItems": 1,
                    "not": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "description": {
                                    "type": "string"
                                },
                                "state": {
                                    "type": "string"
                                },
                                "tags": {
                                    "type": "array",
                                    "items": {
                                        "type": [
                                            "integer",
                                            "object"
                                        ],
                                        "properties": {
                                            "category_id": {
                                                "type": "integer"
                                            },
                                            "state": {
                                                "type": "string"
                                            },
                                            "text": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "category_id",
                                            "text"
                                        ]
                                    },
                                    "maxItems": 25,
                                    "minItems": 3
                                },
                                "title": {
                                    "type": "string"
                                },
                                "url": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "tags",
                                "title"
                            ]
                        }
                    }
                }
            }
        }
    ],
    "unclassifiedDifferences": []
}

@jy95 jy95 requested a review from dewita April 1, 2020 11:23
@jy95 jy95 merged commit 253326a into master Apr 1, 2020
@jy95 jy95 deleted the add-tag-state-when-importing branch April 1, 2020 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(*) : Add tag state when creating/updating exercise(s) ( ONLY FOR ADMIN )

3 participants