Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 7.13
Sv translation
languageru

Код возврата: «400» 400.

Блок кода
languagetext
titleФормат ответа в случае неправильной версии API (JSON Scheme) REST API
collapsetrue
{
    "properties": {
        "error": {
            "description": "Контейнер ошибки",
            "properties":  {
                "code":       {
                    "description": "Общее описание ошибки",
                    "type":        "string",
                    "value":       "unsupported_version"
                },
                "meta": {
                    "description": "Дополнительные данные об ошибке",
                    "type":        "object",
                    "properties":  {
                        "supported_versions": {
                            "description": "Массив поддерживаемых версий",
                            "type":        "array",
                            "items": {
                                "description": "Поддерживаемая версия",
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }
}
Блок кода
languagetext
titleФормат ответа в случае ошибки валидации запроса (JSON Scheme) REST API
collapsetrue
{
    "properties": {
        "error": {
            "description": "Контейнер ошибки",
            "properties":  {
                "code":       {
                    "description": "Общее описание ошибки",
                    "type":        "string",
                    "value":       "validation"
                },
                "meta": {
                    "description": "Дополнительные данные об ошибке",
                    "type":        "object",
                    "properties":  {
                        "validation": {
                            "description": "Название полей модели",
                            "type":        "object",
                            "properties":  {
                                "field":     {
                                    "description": "Поле модели",
                                    "type":        "array",
                                    "items":       {
                                        "description": "Ошибка",
                                        "type":        "string",
                                        "values": [
                                            "not_unique_field",
                                            "too_short",
                                            "too_long",
                                            "wrong_length",
                                            "repeat_exactly",
                                            "required",
                                            "not_exist_in_list",
                                            "invalid",
                                            "contains_child",
                                            "contains_items",
                                            "parent_own_child",
                                            "unique",
                                            "not_valid_json",
                                            "invalid_cron_format",
                                            "read_only",
                                            "parent_self_set_current",
                                            "empty"
                                        ]
                                    }
                                },

                                "sub_model": {
                                    "description": "Название вложенной модели",
                                    "type":        "object",
                                    "$ref":       "#/properties/error/properties/meta/properties/validation"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Блок кода
languagetext
titleПример ошибки при указании неправильной версии REST API
collapsetrue
 {
    "error": {
        "code": "unsupported_version",
        "meta": {
            "supported_versions": ["2", "3"]
        }
    }
}
Блок кода
languagetext
titleПример ошибки проверки на уникальность имени эталонной выгрузки REST API
collapsetrue
{
    "error": {
        "code": "validation",
        "meta": {
            "validation":    {
                "DISPLAY_NAME": ["unique"]
            },
            "unique_models": [
                {
                    "FINGERPRINT_ID": "0123456789ABCDEF",
                    "DISPLAY_NAME":   "test"
                }
            ]
        }
    }
}
Sv translation
languageen

The return code is " 400".

expand

{

expand
Блок кода
language
text
titleError format in case of incorrect version of API (JSON Scheme)
collapsetrue
{

    "properties": {


        "error": {


            "description": "Error container",


            "properties":  {


                "code":       {


                    "description": "General description of error",


                    "type":        "string",


                    "value":       "unsupported_version"


                },


                "meta": {


                    "description": "Additional information on error",


                    "type":        "object",


                    "properties":  {


                        "supported_versions": {


                            "description": "Array of supported versions",


                            "type":        "array",


                            "items": {


                                "description": "Supported version",


                                "type": "string"


                            }


                        }


                    }


                }


            }


        }


    }

}



}
expand
Блок кода
languagetext
titleResponse format in case of request validation error (JSON Scheme)
collapsetrue
{


    "properties": {


        "error": {


            "description": "Error container",


            "properties":  {


                "code":       {


                    "description": "General description of error",


                    "type":        "string",


                    "value":       "validation"


                },


                "meta": {


                    "description": "Additional information on error",


                    "type":        "object",


                    "properties":  {


                        "validation": {


                            "description": "Names of model fields",


                            "type":        "object",


                            "properties":  {


                                "field":     {


                                    "description": "Model field",


                                    "type":        "array",


                                    "items":       {


                                        "description": "Error",


                                        "type":        "string",


                                        "values": [


                                            "not_unique_field",


                                            "too_short",


                                            "too_long",


                                            "wrong_length",


                                            "repeat_exactly",


                                            "required",


                                            "not_exist_in_list",


                                            "invalid",


                                            "contains_child",


                                            "contains_items",


                                            "parent_own_child",


                                            "unique",


                                            "not_valid_json",


                                            "invalid_cron_format",


                                            "read_only",


                                            "parent_self_set_current",


                                            "empty"


                                        ]


                                    }


                                },


                                "sub_model": {


                                    "description": "Name of nested model",


                                    "type":        "object",


                                    "$ref":       "#/properties/error/properties/meta/properties/validation"


                                }


                            }


                        }


                    }


                }


            }


        }


    }

}



}

{

expand
Блок кода
languagetext
titleExample of error when incorrect version is specified
collapsetrue
{

    "error": {


        "code": "unsupported_version",


        "meta": {


            "supported_versions": ["2", "3"]


        }


    }

}



}
Блок кода
languagetext
titleExample of error when checking uniqueness of a sample unloading name
collapsetrue
{


    "error": {


        "code": "validation",


        "meta": {


            "validation":    {


                "DISPLAY_NAME": ["unique"]


            },


            "unique_models": [


                {


                    "FINGERPRINT_ID": "0123456789ABCDEF",


                    "DISPLAY_NAME":   "test"


                }


            ]


        }


    }


}