CLASS ltcl_json_writer DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.

  PRIVATE SECTION.
    CONSTANTS:
      schema_id TYPE string VALUE 'schema/id.json'.

    DATA:
      cut            TYPE REF TO zcl_aff_writer_json_schema,
      test_generator TYPE REF TO zcl_aff_generator.

    METHODS: use_ddic_info_for_element FOR TESTING RAISING cx_static_check,
      value_mapping FOR TESTING RAISING cx_static_check,
      no_formatting FOR TESTING RAISING cx_static_check,
      name_mapping FOR TESTING RAISING cx_static_check,
      date_time_element FOR TESTING RAISING cx_static_check,
      structure_in_table FOR TESTING RAISING cx_static_check,
      nested_table FOR TESTING RAISING cx_static_check,
      use_ddic_info_for_max_length FOR TESTING RAISING cx_static_check,
      max_length FOR TESTING RAISING cx_static_check,
      number_max_value FOR TESTING RAISING cx_static_check,
      enum_element FOR TESTING RAISING cx_static_check,
      date_time_from_abap_to_json FOR TESTING RAISING cx_static_check,
      validate_invalid_json_schema FOR TESTING RAISING cx_static_check,
      validate_valid_json_schema FOR TESTING RAISING cx_static_check,
      setup.

ENDCLASS.

CLASS zcl_aff_writer_json_schema DEFINITION LOCAL FRIENDS ltcl_json_writer.

CLASS ltcl_json_writer IMPLEMENTATION.

  METHOD setup.
    cut = NEW zcl_aff_writer_json_schema( schema_id ).
    test_generator = NEW zcl_aff_generator( cut ).
  ENDMETHOD.

  METHOD enum_element.
*  base type / base structure/ ohne (integer)
*  ABAP enums are not supported and hence treated as string with maxLength 30
    TYPES:
      BEGIN OF ENUM category,
        general ##NEEDED,
        classic_badi ##NEEDED,
      END OF ENUM category.

    DATA(act_schema) = test_generator->generate_type( VALUE category( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "string",` )
( `    "maxLength": 30` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD date_time_element.
    DATA(act_schema) = test_generator->generate_type( VALUE d( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "string",` )
( `    "format" :"date-time"` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD use_ddic_info_for_element.
    DATA(act_schema) = test_generator->generate_type( VALUE abap_language_version( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "description": "ABAP Language Version",` )
( `    "type": "string",` )
( `    "enum": [` )
( `      "standardAbap",` )
( `      "abapForKeyUsers",` )
( `      "abapForCloudDevelopment"` )
( `    ],` )
( `    "enumDescriptions": [` )
( `      "StandardABAP",` )
( `      "ABAP for Key Users",` )
( `      "ABAP for Cloud Development"` )
( `    ]` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD use_ddic_info_for_max_length.
    DATA(act_schema) = test_generator->generate_type( VALUE sysuuid_c36( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "description": "16 byte UUID in 36 chars according to RFC4122",` )
( `    "type": "string",` )
( `    "maxLength": 36` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD no_formatting.
    TYPES:
      BEGIN OF my_structure,
        my_first_element TYPE string,
      END OF my_structure.
    cut->zif_aff_writer~set_formatting_option( zif_aff_writer=>formatting_option-no_formatting ).

    DATA(act_schema) = test_generator->generate_type( VALUE my_structure( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "object",` )
( `    "properties": {` )
( `        "MY_FIRST_ELEMENT": {` )
( `            "type": "string"` )
( `        }` )
( `    },` )
( `    "additionalProperties": false` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD value_mapping.
    TYPES:
      BEGIN OF my_structure,
        my_first_element TYPE i,
      END OF my_structure.
    cut->zif_aff_writer~set_abap_value_mappings( VALUE #(
      ( abap_element = 'MY_FIRST_ELEMENT' target_type = zif_aff_writer=>type_info-string
        value_mappings = VALUE #( ( abap = '1' json = 'firstEnum' ) ( abap = '2' json = 'secondEnum' ) ) )
    ) ).

    DATA(act_schema) = test_generator->generate_type( VALUE my_structure( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "object",` )
( `    "properties": {` )
( `        "myFirstElement": {` )
( `            "type": "string",` )
( `            "enum": [` )
( `              "firstEnum",` )
( `              "secondEnum"` )
( `            ],` )
( `            "enumDescriptions": [` )
( `              "firstEnum",` )
( `              "secondEnum"` )
( `            ]` )
( `        }` )
( `    },` )
( `    "additionalProperties": false` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD name_mapping.
    TYPES:
      BEGIN OF my_structure,
        my_first_element TYPE string,
      END OF my_structure.
    cut->zif_aff_writer~set_name_mappings( VALUE #( ( abap = 'MY_FIRST_ELEMENT' json = 'elementFirst' ) ) ).

    DATA(act_schema) = test_generator->generate_type( VALUE my_structure( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "object",` )
( `    "properties": {` )
( `        "elementFirst": {` )
( `            "type": "string"` )
( `        }` )
( `    },` )
( `    "additionalProperties": false` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD structure_in_table.
    TYPES:
      BEGIN OF my_structure,
        my_element TYPE string,
      END OF my_structure,
      my_table TYPE STANDARD TABLE OF my_structure WITH DEFAULT KEY.

    DATA(act_schema) = test_generator->generate_type( VALUE my_table( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "array",` )
( `    "items": {` )
( `        "type": "object",` )
( `        "properties": {` )
( `            "myElement": {` )
( `                "type": "string"` )
( `            }` )
( `        },` )
( `        "additionalProperties": false` )
( `    }` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD nested_table.
    TYPES:
      nested_table TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
      first_table  TYPE STANDARD TABLE OF nested_table WITH DEFAULT KEY.

    DATA(act_schema) = test_generator->generate_type( VALUE first_table( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "array",` )
( `    "items": {` )
( `        "type": "array",` )
( `        "items": {` )
( `            "type": "string"` )
( `        }` )
( `    }` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD max_length.
    TYPES:
      BEGIN OF component_description,
        name         TYPE c LENGTH 30,
        description  TYPE c LENGTH 60,
        numeric_text TYPE n LENGTH 10,
      END OF component_description.
    DATA(act_schema) = test_generator->generate_type( VALUE component_description( ) ).

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "object",` )
( `    "properties": {` )
( `        "name": {` )
( `            "type": "string",` )
( `            "maxLength": 30` )
( `        },` )
( `        "description": {` )
( `            "type": "string",` )
( `            "maxLength": 60` )
( `        },` )
( `        "numericText": {` )
( `            "type": "string",` )
( `            "maxLength": 10,` )
( `            "pattern": "^[0-9]+$" ` )
( `        }` )
( `    },` )
( `    "additionalProperties": false` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.

  METHOD number_max_value.
    TYPES:
      BEGIN OF component_description,
        integer    TYPE i, "-2147483648 to +2147483647 for i
        integer8   TYPE int8, "-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 for int8
        decfloat16 TYPE decfloat16, "1E385(1E-16 - 1) to -1E-383, 0, +1E-383 to 1E385(1 - 1E-16) for decfloat16
        decfloat34 TYPE decfloat34, "1E6145(1E-34 - 1) to -1E-6143, 0, +1E-6143 to 1E6145(1 - 1E-34) for decfloat34
        ftype      TYPE f, "2.2250738585072014E-308 to 1.7976931348623157E+308, positive as well as negative
        packed     TYPE p LENGTH 14 DECIMALS 2, "length multiplied by 2 minus 1 digits and can have a maximum of 14 decimal places
        integer2   TYPE int2,
      END OF component_description.
    DATA(act_schema) = test_generator->generate_type( VALUE component_description( ) ).


    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "object",` )
( `    "properties": {` )
( `        "integer": {` )
( `            "type": "integer",` )
( `            "minimum": -2147483648,` )
( `            "maximum": 2147483647` )
( `        },` )
( `        "integer8": {` )
( `            "type": "integer",` )
( `            "minimum": -9223372036854775808,` )
( `            "maximum": 9223372036854775807` )
( `        },` )
( `        "decfloat16": {` )
( `            "type": "number",` )
( `            "minimum": -9.999999999999999e384,` )
( `            "maximum": 9.999999999999999e384` )
( `        },` )
( `        "decfloat34": {` )
( `            "type": "number",` )
( `            "minimum": -9.999999999999999999999999999999999e6144,` )
( `            "maximum": 9.999999999999999999999999999999999e6144` )
( `        },` )
( `        "ftype": {` )
( `            "type": "number",` )
( `            "minimum": -1.7976931348623157e308,` )
( `            "maximum": 1.7976931348623157e308` )
( `        },` )
( `        "packed": {` )
( `            "type": "number",` )
( `            "minimum": -9999999999999999999999999.99,` )
( `            "maximum": 9999999999999999999999999.99,` )
( `            "multipleOf": 0.01` )
( `        },` )
( `        "integer2": {` )
( `            "description": "2ByteSignedInteger",` )
( `            "type": "integer",` )
( `            "minimum": -32768,` )
( `            "maximum": 32767` )
( `        }` )
( `    },` )
( `    "additionalProperties": false` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
  ENDMETHOD.


  METHOD date_time_from_abap_to_json.
    DATA(abap_date) = `"20121221"`.
    DATA(element_description) = CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( VALUE d( ) ) ).
    DATA(exp_json) = `2012-12-21`.
    DATA(act_json) = cut->date_time_from_abap_to_json(
      date_time_abap      = abap_date
      element_description = element_description ).
    cl_abap_unit_assert=>assert_equals( exp = exp_json act = act_json ).

    DATA(abap_date_year) = `"2012"`.
    exp_json = `2012`.
    act_json = cut->date_time_from_abap_to_json(
      date_time_abap      = abap_date_year
      element_description = element_description ).
    cl_abap_unit_assert=>assert_equals( exp = exp_json act = act_json ).

    DATA(abap_date_year_month) = `"201212"`.
    exp_json = `2012-12`.
    act_json = cut->date_time_from_abap_to_json(
      date_time_abap      = abap_date_year_month
      element_description = element_description ).
    cl_abap_unit_assert=>assert_equals( exp = exp_json act = act_json ).

    DATA(abap_time) = `"201500"`.
    element_description = CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( VALUE t( ) ) ).
    exp_json = `20:15:00`.
    act_json = cut->date_time_from_abap_to_json(
      date_time_abap      = abap_time
      element_description = element_description ).
    cl_abap_unit_assert=>assert_equals( exp = exp_json act = act_json ).

    DATA(abap_time_incomplete) = `"2015"`.
    act_json = cut->date_time_from_abap_to_json(
      date_time_abap      = abap_time_incomplete
      element_description = element_description ).
    cl_abap_unit_assert=>assert_equals( exp = exp_json act = act_json ).

    DATA(abap_utclong) = `"2012-12-21T23:59:59.9999999"`.
    element_description = CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( VALUE utclong( ) ) ).
    exp_json = `2012-12-21T23:59:59+00:00`.
    act_json = cut->date_time_from_abap_to_json(
      date_time_abap      = abap_utclong
      element_description = element_description ).
    cl_abap_unit_assert=>assert_equals( exp = exp_json act = act_json ).
  ENDMETHOD.

  METHOD validate_invalid_json_schema.
    DATA(invalid_json_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "object",` )
( `    "properties": {` )
( `        "name": {` )
( `            "type": "string",` )
( `            "maxLength": 30` )
( `        }` ) "<---- , is missing
( `        "description": {` )
( `            "type": "string",` )
( `            "maxLength": 60` )
( `        }` )
( `    }` )
( `}` ) ).

    DATA(log) = cut->zif_aff_writer~get_log( ).
    DATA(is_valid) = cut->zif_aff_writer~validate( source = invalid_json_schema log = log ).

    cl_abap_unit_assert=>assert_false( is_valid ).
    cl_abap_unit_assert=>assert_true( log->has_messages( ) ).
  ENDMETHOD.

  METHOD validate_valid_json_schema.
    DATA(invalid_json_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "object",` )
( `    "properties": {` )
( `        "name": {` )
( `            "type": "string",` )
( `            "maxLength": 30` )
( `        },` )
( `        "description": {` )
( `            "type": "string",` )
( `            "maxLength": 60` )
( `        }` )
( `    }` )
( `}` ) ).

    DATA(log) = cut->zif_aff_writer~get_log( ).
    DATA(is_valid) = cut->zif_aff_writer~validate( source = invalid_json_schema log = log ).

    cl_abap_unit_assert=>assert_true( is_valid ).
    cl_abap_unit_assert=>assert_false( log->has_messages( ) ).
  ENDMETHOD.

ENDCLASS.

CLASS ltcl_json_writer_abap_doc DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
  PRIVATE SECTION.
    CONSTANTS:
        schema_id TYPE string VALUE 'schema/id.json'.
    DATA cut TYPE REF TO zcl_aff_writer_json_schema.
    DATA test_generator TYPE REF TO zcl_aff_generator.
    DATA log TYPE REF TO zif_aff_log.

    METHODS setup.

    METHODS: structure_with_different_enum FOR TESTING RAISING cx_static_check,
      standard_table FOR TESTING RAISING cx_static_check,
      nested_structure FOR TESTING RAISING cx_static_check,
      simple_structure FOR TESTING RAISING cx_static_check,
      string_element FOR TESTING RAISING cx_static_check,
      simple_structure_dollar FOR TESTING RAISING cx_static_check,
      complex_type_with_enum FOR TESTING RAISING cx_static_check,
      number_element FOR TESTING RAISING cx_static_check,
      date_time_element FOR TESTING RAISING cx_static_check,
      nested_nested_structure FOR TESTING RAISING cx_static_check,
      table_in_nested_stru_with_ad FOR TESTING RAISING cx_static_check,
      nestes_table_with_ad FOR TESTING RAISING cx_static_check,
      format_version FOR TESTING RAISING cx_static_check,
      structure_with_table FOR TESTING RAISING cx_static_check,
      numerical_text_field FOR TESTING RAISING cx_static_check,
      structure_with_numbers FOR TESTING RAISING cx_static_check,
      structure_different_default FOR TESTING RAISING cx_static_check,
      nested_struc_with_default FOR TESTING RAISING cx_static_check,
      simple_table_with_callbackclas FOR TESTING RAISING cx_static_check,
      struct_with_table_callback FOR TESTING RAISING cx_static_check,
      element_with_callbackclas FOR TESTING RAISING cx_static_check,
      element_in_structure_callback FOR TESTING RAISING cx_static_check,
      table_of_struc_with_callback FOR TESTING RAISING cx_static_check,
      table_with_call_of_struc FOR TESTING RAISING cx_static_check,
      nested_table_with_callback FOR TESTING RAISING cx_static_check,
      struc_with_struc_callback FOR TESTING RAISING cx_static_check,
      structure_with_wrong_enum_link FOR TESTING RAISING cx_static_check,
      structure_with_wrong_default FOR TESTING RAISING cx_static_check,
      structure_with_wrong_callback FOR TESTING RAISING cx_static_check,
      hashed_table FOR TESTING RAISING cx_static_check,
      structure_with_tables FOR TESTING RAISING cx_static_check,
      structure_no_title_descr FOR TESTING RAISING cx_static_check,
      element_no_title_descr FOR TESTING RAISING cx_static_check,
      table_no_title_descr FOR TESTING RAISING cx_static_check,
      title_and_desc_escaped FOR TESTING RAISING cx_static_check,
      number_element_default FOR TESTING RAISING cx_static_check,
      unknown_annotation FOR TESTING RAISING cx_static_check,
      unknown_abap_doc_tag FOR TESTING RAISING cx_static_check,
      type_of_enumtype_and_co_differ FOR TESTING RAISING cx_static_check,
      structure_with_include FOR TESTING RAISING cx_static_check,
      description_too_long FOR TESTING RAISING cx_static_check,
      structure_with_default_problem FOR TESTING RAISING cx_static_check,
      get_extrema FOR TESTING RAISING cx_static_check,
      calculate_max_length FOR TESTING RAISING cx_static_check,
      struc_with_own_enum_values FOR TESTING RAISING cx_static_check.


ENDCLASS.


CLASS zcl_aff_writer_json_schema DEFINITION LOCAL FRIENDS ltcl_json_writer_abap_doc.
CLASS ltcl_json_writer_abap_doc IMPLEMENTATION.

  METHOD setup.
    cut = NEW zcl_aff_writer_json_schema( schema_id ).
    test_generator = NEW zcl_aff_generator( cut ).
  ENDMETHOD.

  METHOD number_element_default.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>default_link( ) ).
*expect error /no output (type of type and constant has to be the same)

    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "description": "Default type does not match constant type",` )
( `    "type": "integer",` )
( `    "minimum": -2147483648,` )
( `    "maximum": 2147483647` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 122
                                                                                           attr1 = `CO_TEST`
                                                                                           attr2 = `DEFAULT_LINK` )
                                                             exp_component_name = `DEFAULT_LINK`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
  ENDMETHOD.

  METHOD type_of_enumtype_and_co_differ.
    TRY.
        test_generator->generate_type( VALUE zcl_aff_test_types=>enum( ) ).
        cl_abap_unit_assert=>fail( ).
      CATCH zcx_aff_tools INTO DATA(ex).
        cl_abap_unit_assert=>assert_equals( exp = 'CO_ENUM' act = ex->if_t100_dyn_msg~msgv1 ).
        cl_abap_unit_assert=>assert_equals( exp = 'ENUM' act = ex->if_t100_dyn_msg~msgv2 ).
        cl_abap_unit_assert=>assert_equals( exp = 'ZAFF_TOOLS' act = ex->if_t100_message~t100key-msgid ).
        cl_abap_unit_assert=>assert_equals( exp = 122 act = ex->if_t100_message~t100key-msgno ).
    ENDTRY.
  ENDMETHOD.

  METHOD unknown_annotation.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>unknown_annotation( ) ).

    "expected: no title or description
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "type": "string"` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 108
                                                                                           attr1 = `$hiddenabc` )
                                                             exp_component_name = `UNKNOWN_ANNOTATION`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
  ENDMETHOD.

  METHOD unknown_abap_doc_tag.
    "description is not found
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>description_not_found( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "title",` )
( `    "description": "description <p class=\"shorttext2\">Title</p>",` )  "The escape changes description
( `    "type": "string"` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

  METHOD title_and_desc_escaped.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>num_text1( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "Test title \"\\",` )
( `    "description": "Test description \"\\",` )
( `    "type": "string",` )
( `    "maxLength": 4, ` )
( `    "pattern": "^[0-9]+$"` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

  METHOD format_version.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>ty_format_version( ) ).
    DATA(exp_schema) = VALUE string_table(
( `   {` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `     "title": "Constant With Field Format Version",` )
( `     "description": "Constant with field format_version",` )
( `     "type": "object",` )
( `     "properties": {` )
( `       "formatVersion": {` )
( `         "title": "ABAP File Format Version",` )
( `         "description": "The ABAP file format version",` )
( `         "type": "string",` )
( `         "const": "1"` )
( `       },` )
( `       "field1": {` )
( `         "title": "Other Field",` )
( `         "description": "Other field",` )
( `         "type": "integer",` )
( `         "minimum": -2147483648,` )
( `         "maximum": 2147483647` )
( `       }` )
( `     },` )
( `     "additionalProperties": false` )
( `   }` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD number_element.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>integer( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "myInteger",` )
( `    "description": "A simple Integer",` )
( `    "type": "integer",` )
( `    "minimum": -2147483648,` )
( `    "maximum": 2147483647` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD string_element.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>mystring( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "myStringName",` )
( `    "description": "This is a string",` )
( `    "type": "string",` )
( `    "maxLength": 3` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD date_time_element.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>my_date( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "Date",` )
( `    "description": "This is a date",` )
( `    "type": "string",` )
( `    "format" :"date-time"` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD simple_structure.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>my_structure( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "mySimpleStructure",` )
( `    "description": "This is a simple structure",` )
( `    "type": "object",` )
( `    "properties": {` )
( `        "myFirstElement": {` )
( `            "title": "First Element",` )
( `            "description": "This is the first element",` )
( `            "type": "string",` )
( `            "minLength": 4` )
( `        },` )
( `        "mySecondElement": {` )
( `            "title": "Second Element",` )
( `            "description": "This is the second element",` )
( `            "type": "integer",` )
( `            "minimum": -2147483648,` )
( `            "maximum": 2147483647` )
( `        }` )
( `    },` )
( `    "additionalProperties": false` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD simple_structure_dollar.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>my_structure2( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "mySimpleStructure",` )
( `    "description": "This is a $ simple st",` )
( `    "type": "object",` )
( `    "properties": {` )
( `        "myFirstElement": {` )
( `            "title": "First Element",` )
( `            "description": "This is the first element",` )
( `            "type": "string",` )
( `            "maxLength": 3` )
( `        },` )
( `        "mySecondElement": {` )
( `            "title": "Second Element",` )
( `            "description": "This is the second element",` )
( `            "type": "integer",` )
( `            "minimum": -2147483648,` )
( `            "maximum": 2147483647` )
( `        }` )
( `    },` )
( `    "additionalProperties": false,` )
( `    "required": [` )
( `      "myFirstElement" ` )
( `    ]` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 108
                                                                                           attr1 = `$ructure` )
                                                             exp_component_name = `MY_STRUCTURE2`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
  ENDMETHOD.


  METHOD nested_structure.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>my_structure3( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "myStructure",` )
( `    "description": "This is a complex structure",` )
( `    "type": "object",` )
( `    "properties": {` )
( `        "nestedStruc": {` )
( `            "title": "nestedStruc",` )
( `            "description": "This is the nested structure",` )
( `            "type": "object",` )
( `            "properties": {` )
( `                "myElement": {` )
( `                    "title": "myElementComponente",` )
( `                    "description": "This is a string element",` )
( `                    "type": "string"` )
( `                }` )
( `            },` )
( `            "additionalProperties": false` )
( `        },` )
( `        "myElement": {` )
( `          "title": "My Element",` )
( `          "description": "This is my element",` )
( `          "type": "string"` )
( `       }` )
( `    },` )
( `    "additionalProperties": false,` )
( `    "required": [ ` )
( `      "myElement" ` )
( `    ]` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD standard_table.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>my_standard_table( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "A Standard Table",` )
( `    "description": "A standard table of myString",` )
( `    "type": "array",` )
( `    "items": {` )
( `        "title": "myStringName",` )
( `        "description": "This is a string",` )
( `        "type": "string",` )
( `        "maxLength": 3` )
( `    }` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

  METHOD hashed_table.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>my_hashed_table( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "A Hashed Table",` )
( `    "description": "A hashed table of my_structure",` )
( `    "type": "array",` )
( `    "uniqueItems" : true,` )
( `    "items": {` )
( `        "title": "mySimpleStructure",` )
( `        "description": "This is a simple structure",` )
( `        "type": "object",` )
( `        "properties": {` )
( `            "myFirstElement": {` )
( `                "title": "First Element",` )
( `                "description": "This is the first element",` )
( `                "type": "string",` )
( `                "minLength": 4` )
( `            }, ` )
( `            "mySecondElement": {` )
( `                "title": "Second Element",` )
( `                "description": "This is the second element",` )
( `                "type": "integer",` )
( `                "minimum": -2147483648,` )
( `                "maximum": 2147483647` )
( `            } ` )
( `        },` )
( `        "additionalProperties": false` )
( `    }` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

  METHOD structure_with_tables.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>my_structure_with_tables( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "A Structure With Tables",` )
( `    "description": "A structure with different table types",` )
( `    "type": "object",` )
( `    "properties": {` )
( `        "firstTable": {` )
( `            "title": "First Table",` )
( `            "description": "First table",` )
( `            "type": "array",` )
( `            "uniqueItems": true,` )
( `            "items": {` )
( `                "title": "mySimpleStructure",` )
( `                "description": "This is a simple structure",` )
( `                "type": "object",` )
( `                "properties": {` )
( `                    "myFirstElement": {` )
( `                        "title": "First Element",` )
( `                        "description": "This is the first element",` )
( `                        "type": "string",` )
( `                        "minLength": 4` )
( `                    }, ` )
( `                    "mySecondElement": {` )
( `                        "title": "Second Element",` )
( `                        "description": "This is the second element",` )
( `                        "type": "integer",` )
( `                        "minimum": -2147483648,` )
( `                        "maximum": 2147483647` )
( `                    } ` )
( `                },` )
( `                "additionalProperties": false` )
( `            }` )
( `        },` )
( `        "secondTable": {` )
( `            "title": "Second Table",` )
( `            "description": "Second table",` )
( `            "type": "array",` )
( `            "items": {` )
( `                "title": "mySimpleStructure",` )
( `                "description": "This is a simple structure",` )
( `                "type": "object",` )
( `                "properties": {` )
( `                    "myFirstElement": {` )
( `                        "title": "First Element",` )
( `                        "description": "This is the first element",` )
( `                        "type": "string",` )
( `                        "minLength": 4` )
( `                    }, ` )
( `                    "mySecondElement": {` )
( `                        "title": "Second Element",` )
( `                        "description": "This is the second element",` )
( `                        "type": "integer",` )
( `                        "minimum": -2147483648,` )
( `                        "maximum": 2147483647` )
( `                    } ` )
( `                },` )
( `                "additionalProperties": false` )
( `            }` )
( `        }` )
( `    },` )
( `    "additionalProperties": false` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD structure_with_different_enum.
    DATA(test) = VALUE zcl_aff_test_types=>structure_with_different_enum( ).
    test_generator->generate_type( test ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 127 )
                                                             exp_component_name = `STRUCTURE_WITH_DIFFERENT_ENUM-ENUM_WITHOUT_ALL`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
  ENDMETHOD.


  METHOD complex_type_with_enum.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>ty_class_properties( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |   "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |   "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |   "$id": "{ schema_id }",| )
( `   "title": "Class Properties",` )
( `   "description": "Class properties",` )
( `   "type": "object",` )
( `   "properties": {` )
( `     "header": {` )
( `       "title": "Header",` )
( `       "description": "The header for an ABAP main object",` )
( `       "type": "object",` )
( `       "properties": {` )
( `         "description": {` )
( `           "title": "Description",` )
( `           "description": "Description of the ABAP object",` )
( `           "type": "string"` )
( `       },` )
( `       "originalLanguage": {` )
( `         "title": "Original Language",` )
( `         "description": "Original language of the ABAP object",` )
( `         "type": "string",` )
( `         "minLength": 2,` )
( `         "maxLength": 2,` )
( `         "pattern": "^[a-z]+$"` )
( `         },` )
( `         "abapLanguageVersion": {` )
( `           "title": "ABAP Language Version",` )
( `           "description": "ABAP language version",` )
( `           "type": "string",` )
( `           "enum": [` )
( `             "standard",` )
( `             "cloudDevelopment"` )
( `           ],` )
( `           "enumTitles": [` )
( `             "Standard",` )
( `             "ABAP Cloud Development"` )
( `           ],` )
( `           "enumDescriptions": [` )
( `             "Standard",` )
( `             "ABAP cloud development"` )
( `           ]` )
( `        }` )
( `       },` )
( `       "additionalProperties": false` )
( `     },` )
( `     "classCategory": {` )
( `       "title": "Class Category",` )
( `       "description": "Class category",` )
( `       "type": "string",` )
( `       "enum": [` )
( `         "general",` )
( `         "exitClass"` )
( `       ],` )
( `       "enumTitles": [ ` )
( `         "General",` )
( `         "Exit Class"` )
( `       ],` )
( `       "enumDescriptions": [ ` )
( `         "General",` )
( `         "Exit class"` )
( `       ]` )
( `     }` )
( `   },` )
( `    "additionalProperties": false` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD nested_nested_structure.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>list( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "outerStructure", ` )
( `    "description": "ABAP Doc Comment TYPES list first level", ` )
( `    "type": "object", ` )
( `    "properties": { ` )
( `      "field1": { ` )
( `        "title": "Outer Element 1",  ` )
( `        "description": "ABAP Doc field1", ` )
( `        "type": "integer",` )
( `        "minimum": -2147483648, ` )
( `        "maximum": 2147483647 ` )
( `      }, ` )
( `      "field2": { ` )
( `         "title": "Outer Element 2", ` )
( `         "description": "ABAP Doc field2", ` )
( `         "type": "string", ` )
( `         "maxLength": 2 ` )
( `      }, ` )
( `      "list1": { ` )
( `         "title": "middleStructure", ` )
( `        "description": "ABAP Doc list second level", ` )
( `        "type": "object", ` )
( `        "properties": { ` )
( `          "elementOfList1": { ` )
( `             "title": "Middle Element", ` )
( `            "description": "ABAP Doc second level", ` )
( `            "type": "integer", ` )
( `            "minimum": -2147483648, ` )
( `            "maximum": 2147483647 ` )
( `          }, ` )
( `           "list2": { ` )
( `            "title": "innerStructure", ` )
( `            "description": "ABAP Doc third level", ` )
( `            "type": "object", ` )
( `            "properties": { ` )
( `              "elementOfList2": { ` )
( `                "title": "Inner Element", ` )
( `                "description": "ABAP Doc third level", ` )
( `                "type": "string" ` )
( `              } ` )
( `             }, ` )
( `            "additionalProperties": false, ` )
( `            "required": [ ` )
( `              "elementOfList2"` )
( `            ] ` )
( `          } ` )
( `        }, ` )
( `         "additionalProperties": false, ` )
( `         "required": [ ` )
( `           "elementOfList1" ` )
( `         ] ` )
( `      }, ` )
( `      "field3": { ` )
( `        "title": "Outer Element 3", ` )
( `         "description": "ABAP Doc field3",` )
( `        "type": "string", ` )
( `        "maxLength": 2 ` )
( `      } ` )
( `     }, ` )
( `    "additionalProperties": false, ` )
( `    "required": [` )
( `      "field2",` )
( `      "list1",` )
( `      "field3"` )
( `    ] ` )
( `  } ` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD table_in_nested_stru_with_ad.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>outer_struc( ) ).
    DATA(exp_schema) = VALUE string_table(
    ( ` { ` )
    ( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
    ( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
    ( |    "$id": "{ schema_id }",| )
    ( `    "title": "outerStructure", ` )
    ( `    "description": "ABAP Doc Comment TYPES list first level", ` )
    ( `    "type": "object", ` )
    ( `    "properties": { ` )
    ( `      "field1": { ` )
    ( `        "title": "Outer Element1",  ` )
    ( `        "description": "ABAP Doc field1 first level", ` )
    ( `        "type": "integer",` )
    ( `        "minimum": -2147483648, ` )
    ( `        "maximum": 2147483647 ` )
    ( `      }, ` )
    ( `      "innerStruc": { ` )
    ( `         "title": "Inner Structure 1", ` )
    ( `         "description": "Inner structure", ` )
    ( `         "type": "object", ` )
    ( `         "properties": { ` )
    ( `            "elementOfInnerStruc": { ` )
    ( `              "title": "Inner Element", ` )
    ( `              "description": "ABAP Doc element second level", ` )
    ( `              "type": "integer",` )
    ( `              "minimum": -2147483648, ` )
    ( `              "maximum": 2147483647 ` )
    ( `             }, ` )
    ( `             "innerTableVar": { ` )
    ( `              "title": "inner Table", ` )
    ( `              "description": "ABAP Doc element second level", ` )
    ( `              "type": "array", ` )
    ( `                "items": { ` )
    ( `                 "type": "string" ` )
    ( `                } ` )
    ( `              } ` )
    ( `          }, ` )
    ( `          "additionalProperties": false, ` )
    ( `          "required": [` )
    ( `            "elementOfInnerStruc",` )
    ( `            "innerTableVar"` )
    ( `          ] ` )
    ( `      }, ` )
    ( `      "field2": { ` )
    ( `        "title": "Outer Element2", ` )
    ( `        "description": "ABAP Doc field2 first level",` )
    ( `        "type": "string", ` )
    ( `        "maxLength": 2 ` )
    ( `      } ` )
    ( `    }, ` )
    ( `    "additionalProperties": false, ` )
    ( `    "required": [` )
    ( `      "field2"` )
    ( `    ] ` )
    ( `  } ` )
    ( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD nestes_table_with_ad.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>first_table( ) ).
    DATA(exp_schema) = VALUE string_table(
( ` { ` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "Outer Table", ` )
( `    "description": "This is the outer table", ` )
( `    "type": "array", ` )
( `    "items": { ` )
( `      "title": "Inner Table", ` )
( `      "description": "This is the inner Table", ` )
( `      "type": "array", ` )
( `      "items": { ` )
( `        "type": "string" ` )
( `      } ` )
( `    } ` )
( `  } ` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD structure_with_wrong_enum_link.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_with_wrong_link( ) ).
    DATA(exp_schema) = VALUE string_table(
( ` { ` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "Structure with Wrong Link", ` )
( `    "description": "This is a structure with wrong enum_values link", ` )
( `    "type": "object", ` )
( `    "properties": { ` )
( `      "elementOne": { ` )
( `        "title": "First Element",  ` )
( `        "description": "First element", ` )
( `        "type": "string"` )
( `      }, ` )
( `      "elementTwo": { ` )
( `        "title": "Second Element",  ` )
( `        "description": "Second element", ` )
( `        "type": "string",` )
( `        "maxLength": 2, ` )
( `        "pattern": "^[0-9]+$" ` )
( `      } ` )
( `    }, ` )
( `    "additionalProperties": false ` )
( `  } ` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 104
                                                                                           attr1 = `ZCL_AFF_TEST_TYPES=>ENUM_VALUES_WRONG` )
                                                             exp_component_name = `STRUCTURE_WITH_WRONG_LINK-ELEMENT_TWO`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
  ENDMETHOD.


  METHOD structure_with_table.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_with_doc_outside( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{ ` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "Structure With ABAP Doc Outside",` )
( `    "description": "Structure with ABAP Doc outside",` )
( `    "type": "object",` )
( `    "properties": {` )
( `      "table1": {` )
( `        "title": "Table1",` )
( `        "description": "Table1",` )
( `        "type": "array",` )
( `        "items": {` )
( `          "type": "string"` )
( `        }` )
( `      },` )
( `      "structure": {` )
( `        "title": "Structure",` )
( `        "description": "Structure",` )
( `        "type": "object",` )
( `        "properties": {` )
( `          "field": {` )
( `            "title": "Field",` )
( `            "description": "Field",` )
( `            "type": "integer",` )
( `            "minimum": -2147483648,` )
( `            "maximum": 2147483647` )
( `          }` )
( `        },` )
( `        "additionalProperties": false` )
( `      },` )
( `      "table2": {` )
( `        "title": "Table2",` )
( `        "description": "Table2",` )
( `        "type": "array",` )
( `        "items": {` )
( `          "type": "string"` )
( `        }` )
( `      }` )
( `    },` )
( `    "additionalProperties": false, ` )
( `    "required": [ ` )
( `      "table1" ` )
( `    ] ` )
( `  }` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD numerical_text_field.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>num_text( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "Numerical Text Field",` )
( `    "description": "A numerical text field of length 4",` )
( `    "type": "string",` )
( `    "maxLength": 4, ` )
( `    "pattern": "^[0-9]+$"` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD structure_with_numbers.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_with_numbers( ) ).
    DATA(exp_schema) = VALUE string_table(
    ( `{ ` )
    ( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
    ( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
    ( |    "$id": "{ schema_id }",| )
    ( `    "title": "Structure With Number Types",` )
    ( `    "description": "This is a structure with different number types",` )
    ( `    "type": "object",` )
    ( `    "properties": {` )
    ( `      "integer": {` )
    ( `        "title": "Integer With Maximum",` )
    ( `        "description": "Integer with maximum",` )
    ( `        "type": "integer",` )
    ( `        "minimum":-2147483648 ,` )
    ( `        "maximum":10` )
    ( `      },` )
    ( `      "float": {` )
    ( `        "title": "Float With Minimum And Exclusive Maximum",` )
    ( `        "description": "Float with minimum and exclusive maximum",` )
    ( `        "type": "number",` )
    ( `        "minimum": -0.42,` )
    ( `        "exclusiveMaximum": 100.9` )
    ( `      },` )
    ( `      "packedWithMultiple": {` )
    ( `        "title": "Packed Number With Given Multiple",` )
    ( `        "description": "Packed number with given multiple",` )
    ( `        "type": "number",` )
    ( `        "exclusiveMinimum": 0,` )
    ( `        "maximum": 99999.90,` )
    ( `        "multipleOf": 0.1 ` )
    ( `      },` )
    ( `      "packedWithoutMultiple": {` )
    ( `        "title": "Packed Number With No Given Multiple",` )
    ( `        "description": "Packed number with no given multiple",` )
    ( `        "type": "number",` )
    ( `        "exclusiveMinimum": 0,` )
    ( `        "maximum": 999999.9,` )
    ( `        "multipleOf": 0.1 ` )
    ( `      },` )
    ( `      "integerOut": {` )
    ( `        "title": "Integer Defined Outside",` )
    ( `        "description": "Integer defined outside and ABAP Doc number annotation outside",` )
    ( `        "type": "integer",` )
    ( `        "minimum": -25,` )
    ( `        "maximum": 2147483647` )
    ( `      },` )
    ( `      "integerOutWithDoc": {` )
    ( `        "title": "Integer Defined Outside",` )
    ( `        "description": "Integer defined outside but with ABAP Doc number annotation here",` )
    ( `        "type": "integer",` )
    ( `        "minimum": -2147483648,` )
    ( `        "maximum": 42 ` )
    ( `      }` )
    ( `    },` )
    ( `    "additionalProperties": false ` )
    ( `  }` )
    ( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD structure_different_default.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_different_default( ) ).
    DATA(exp_schema) = VALUE string_table(
( `    { ` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "Structure With Default", ` )
( `    "description": "Structure to test default checks in simple transformation", ` )
( `    "type": "object", ` )
( `    "properties": { ` )
( `      "fourByteInt": { ` )
( `        "title": "Four Byte Integer", ` )
( `        "description": "Four byte integer", ` )
( `        "type": "integer", ` )
( `        "minimum": -2147483648, ` )
( `        "maximum": 2147483647 , ` )
( `        "default": 5 ` )
( `      }, ` )
( `      "eightByteInt": { ` )
( `        "title": "Eight Byte Integer", ` )
( `        "description": "Eight byte integer", ` )
( `        "type": "integer", ` )
( `        "minimum": -9223372036854775808, ` )
( `        "maximum": 9223372036854775807 , ` )
( `        "default": 55 ` )
( `       }, ` )
( `      "binFloat": { ` )
( `        "title": "Binary Floating Point Number", ` )
( `        "description": "Binary floating point number", ` )
( `        "type": "number", ` )
( `        "minimum": -1.7976931348623157e308, ` )
( `        "maximum": 1.7976931348623157e308, ` )
( `        "default": 4.3 ` )
( `      }, ` )
( `      "byteLike": { ` )
( `        "title": "Byte Like", ` )
( `        "description": "Byte like", ` )
( `        "type": "string", ` )
( `        "maxLength": 4, ` )
( `        "default": "FFFF" ` )
( `      }, ` )
( `      "byteLike2": { ` )
( `        "title": "Byte Like2", ` )
( `        "description": "Byte like2", ` )
( `        "type": "string", ` )
( `        "default": "FF00FF"` )
( `       }, ` )
( `      "decimalFloat16": { ` )
( `        "title": "Decimal Floating Point Number", ` )
( `        "description": "Decimal floating point number with 16 places", ` )
( `        "type": "number", ` )
( `        "minimum": -9.999999999999999e384, ` )
( `        "maximum": 9.999999999999999e384, ` )
( `        "default": 25.26 ` )
( `      }, ` )
( `      "decimalFloat34": { ` )
( `        "title": "Decimal Floating Point Number", ` )
( `        "description": "Decimal floating point number with 34 places", ` )
( `        "type": "number", ` )
( `        "minimum": -9.999999999999999999999999999999999e6144, ` )
( `        "maximum": 9.999999999999999999999999999999999e6144, ` )
( `        "default": 123.05 ` )
( `      }, ` )
( `      "packedNumber": { ` )
( `        "title": "Packed Number", ` )
( `        "description": "Packed number", ` )
( `        "type": "number", ` )
( `        "minimum": -999.99, ` )
( `        "maximum": 999.99 , ` )
( `        "multipleOf": 0.01, ` )
( `        "default": 123.45 ` )
( `      }, ` )
( `      "numericText": { ` )
( `        "title": "Numeric Text Field", ` )
( `        "description": "Numeric text field", ` )
( `        "type": "string", ` )
( `        "maxLength": 4, ` )
( `        "pattern": "^[0-9]+$", ` )
( `        "default": "1067" ` )
( `      }, ` )
( `      "characterText": { ` )
( `        "title": "Character Text", ` )
( `        "description": "Character text", ` )
( `        "type": "string", ` )
( `        "maxLength": 5, ` )
( `        "default": "abcde" ` )
( `      }, ` )
( `      "stringText": { ` )
( `        "title": "String Text", ` )
( `        "description": "String text", ` )
( `        "type": "string", ` )
( `        "default": "Default text" ` )
( `      }, ` )
( `      "dateField": { ` )
( `        "title": "Date", ` )
( `        "description": "Date", ` )
( `        "type": "string", ` )
( `        "format": "date-time", ` )
( `        "default": "1972-04-01" ` )
( `      }, ` )
( `      "timeField": { ` )
( `        "title": "Time", ` )
( `        "description": "Time", ` )
( `        "type": "string", ` )
( `        "format": "date-time", ` )
( `        "default": "20:15:00" ` )
( `      }, ` )
( `      "dateTimeField": { ` )
( `        "title": "Date Time", ` )
( `        "description": "Date time: No support", ` )
( `        "type": "string", ` )
( `        "format": "date-time" ` )
( `      }, ` )
( `      "boolTrue": { ` )
( `        "title": "Boolean", ` )
( `        "description": "Boolean with default abap_true", ` )
( `        "type": "boolean", ` )
( `        "default": true ` )
( `      }, ` )
( `      "boolFalse": { ` )
( `        "title": "Boolean", ` )
( `        "description": "Boolean with default abap_false", ` )
( `        "type": "boolean", ` )
( `        "default": false ` )
( `      }, ` )
( `      "enumType": { ` )
( `        "title": "Enum Type", ` )
( `        "description": "Enum type", ` )
( `        "type": "string", ` )
( `        "enum": [ ` )
( `          "general", ` )
( `          "exitClass" ` )
( `        ], ` )
( `        "enumTitles": [ ` )
( `          "General", ` )
( `          "Exit Class" ` )
( `        ], ` )
( `        "enumDescriptions": [ ` )
( `          "General", ` )
( `          "Exit class" ` )
( `        ], ` )
( `        "default": "exitClass" ` )
( `      } ` )
( `    }, ` )
( `    "additionalProperties": false ` )
( `  } ` )
( ) ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 117
                                                                                           attr1 = `UTCLONG` )
                                                             exp_component_name = `STRUCTURE_DIFFERENT_DEFAULT-DATE_TIME_FIELD`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
  ENDMETHOD.

  METHOD structure_with_default_problem.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_with_default_problem( ) ).
    DATA(exp_schema) = VALUE string_table(
( `    { ` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `     "title": "Structure With Default",` )
( `     "description": "Structure with default",` )
( `     "type": "object",` )
( `     "properties": {` )
( `       "integer": {` )
( `         "title": "Integer",` )
( `         "description": "Integer",` )
( `         "type": "integer",` )
( `         "minimum": -2147483648,` )
( `         "maximum": 2147483647,` )
( `         "default": 5` )
( `       },` )
( `       "stringElement": {` )
( `         "title": "String Element",` )
( `         "description": "String element with default value",` )
( `         "type": "string",` )
( `         "default": "DefaultString"` )
( `       },` )
( `       "enumRequired": {` )
( `         "title": "Enum Value",` )
( `         "description": "Enum value with default",` )
( `         "type": "string",` )
( `         "enum": [` )
( `           "general",` )
( `           "exitClass"` )
( `         ],` )
( `         "enumTitles": [` )
( `           "General",` )
( `           "Exit Class"` )
( `         ],` )
( `         "enumDescriptions": [` )
( `           "General",` )
( `           "Exit class"` )
( `         ],` )
( `         "default": "exitClass"` )
( `       },` )
( `       "enumShowAlways": {` )
( `         "title": "Enum Value",` )
( `         "description": "Enum value with default",` )
( `         "type": "string",` )
( `         "enum": [` )
( `           "general",` )
( `           "exitClass"` )
( `         ],` )
( `         "enumTitles": [` )
( `           "General",` )
( `           "Exit Class"` )
( `         ],` )
( `         "enumDescriptions": [` )
( `           "General",` )
( `           "Exit class"` )
( `         ],` )
( `         "default": "exitClass"` )
( `       }` )
( `     },` )
( `     "additionalProperties": false,` )
( `     "required": [` )
( `       "integer",` )
( `       "enumRequired"` )
( `     ]` )
( `   }` )
( ) ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 126 )
                                                             exp_component_name = `STRUCTURE_WITH_DEFAULT_PROBLEM-INTEGER`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 126 )
                                                             exp_component_name = `STRUCTURE_WITH_DEFAULT_PROBLEM-ENUM_REQUIRED`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).


  ENDMETHOD.


  METHOD nested_struc_with_default.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>nested_struc_with_default( ) ).
    DATA(exp_schema) = VALUE string_table(
( `    { ` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `     "title": "Nested Structure", ` )
( `     "description": "Nested structure", ` )
( `     "type": "object", ` )
( `     "properties": { ` )
( `       "outerComponent": { ` )
( `         "title": "Outer Component", ` )
( `         "description": "Outer component", ` )
( `         "type": "integer", ` )
( `         "minimum": -2147483648, ` )
( `         "maximum": 2147483647 , ` )
( `         "default": 10 ` )
( `       }, ` )
( `       "middleStruc": { ` )
( `         "title": "Middle Structure", ` )
( `         "description": "Middle structure", ` )
( `         "type": "object", ` )
( `         "properties": { ` )
( `           "middleComponent": { ` )
( `             "title": "Middle Component", ` )
( `             "description": "Middle component", ` )
( `             "type": "string", ` )
( `             "maxLength": 4, ` )
( `             "default": "abcd" ` )
( `           }, ` )
( `           "innerStruc": { ` )
( `             "title": "Inner Structure", ` )
( `             "description": "Inner structure", ` )
( `             "type": "object", ` )
( `             "properties": { ` )
( `               "innerComponent": { ` )
( `                 "title": "Inner Component", ` )
( `                 "description": "Inner component", ` )
( `                 "type": "string", ` )
( `                 "default": "Default Value" ` )
( `               } ` )
( `             }, ` )
( `             "additionalProperties": false ` )
( `           } ` )
( `         }, ` )
( `         "additionalProperties": false ` )
( `       } ` )
( `     }, ` )
( `     "additionalProperties": false ` )
( `   } ` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

  METHOD structure_with_wrong_default.
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_with_wrong_default( ) ).
    DATA(exp_schema) = VALUE string_table(
    ( `   { ` )
    ( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
    ( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
    ( |    "$id": "{ schema_id }",| )
    ( `     "title": "Structure With Wrong Default", ` )
    ( `     "description": "Structure with wrong default", ` )
    ( `     "type": "object", ` )
    ( `     "properties": { ` )
    ( `       "elementOne": { ` )
    ( `         "title": "First Element",` )
    ( `         "description": "First element", ` )
    ( `         "type": "string", ` )
    ( `         "enum": [ ` )
    ( `           "general", ` )
    ( `           "classicBadi" ` )
    ( `         ], ` )
    ( `         "enumTitles": [ ` )
    ( `           "generalCategory", ` )
    ( `           "" ` )
    ( `         ], ` )
    ( `         "enumDescriptions": [ ` )
    ( `           "General interface", ` )
    ( `           "Interface definition of a classic BAdI" ` )
    ( `         ] ` )
    ( `       }, ` )
    ( `       "elementTwo": { ` )
    ( `         "title": "Second Element", ` )
    ( `         "description": "Second element", ` )
    ( `         "type": "string", ` )
    ( `         "enum": [ ` )
    ( `           "general", ` )
    ( `           "classicBadi" ` )
    ( `         ], ` )
    ( `         "enumTitles": [ ` )
    ( `           "generalCategory", ` )
    ( `           "" ` )
    ( `         ], ` )
    ( `         "enumDescriptions": [ ` )
    ( `           "General interface", ` )
    ( `           "Interface definition of a classic BAdI" ` )
    ( `         ] ` )
    ( `       } ` )
    ( `     }, ` )
    ( `     "additionalProperties": false ` )
    ( `   } ` )
    ( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 105
                                                                                           attr1 = `WRONG_COMPONENT`
                                                                                           attr2 = `ENUM_VALUES` )
                                                             exp_component_name = `STRUCTURE_WITH_WRONG_DEFAULT-ELEMENT_ONE`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 111
                                                                                           attr1 = zcl_aff_abap_doc_parser=>abap_doc_annotation-default )
                                                             exp_component_name = `STRUCTURE_WITH_WRONG_DEFAULT-ELEMENT_TWO`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Title` )
                                                             exp_component_name = `ENUM_VALUES-CLASSIC_BADI`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD element_with_callbackclas.
    zcl_aff_test_types=>subschema = VALUE string_table(
  ( `"title": "myStringName",` )
  ( `"description": "This is a String",` )
  ( `"type": "string",` )
  ( `"maxLength": 3` ) ).

    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>simple_callback( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "myStringName",` )
( `    "description": "This is a String",` )
( `    "type": "string",` )
( `    "maxLength": 3` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD simple_table_with_callbackclas.
    zcl_aff_test_types=>subschema = VALUE string_table(
  ( `"title": "my_table",` )
  ( `"description": "A standard table of strings",` )
  ( `"type": "array",` )
  ( `"items": {` )
  ( `  "title": "myStringName",` )
  ( `  "description": "This is a String",` )
  ( `  "type": "string",` )
  ( `  "maxLength": 3` )
  ( `}` ) ).

    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>table_callback( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "my_table",` )
( `    "description": "A standard table of strings",` )
( `    "type": "array",` )
( `    "items": {` )
( `        "title": "myStringName",` )
( `        "description": "This is a String",` )
( `        "type": "string",` )
( `        "maxLength": 3` )
( `    }` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD table_with_call_of_struc.
    zcl_aff_test_types=>subschema = VALUE string_table(
  ( `"title": "my_table_callback",` )
  ( `"description": "A standard table of my_structure",` )
  ( `"type": "array",` )
  ( `"items": {` )
  ( `  "title": "mySimpleStructureWithFallback",` )
  ( `  "description": "This is a simple structure",` )
  ( `  "type": "object",` )
  ( `  "properties": {` )
  ( `    "myFirstElement": {` )
  ( `    "title": "myStringName",` )
  ( `    "description": "This is a String",` )
  ( `    "type": "string",` )
  ( `    "minLength": 2` )
  ( `  },` )
  ( `  "mySecondElement": {` )
  ( `    "title": "mySecondElement",` )
  ( `    "description": "This is the second element",` )
  ( `    "type": "integer",` )
  ( `    "minimum": -2147483648,` )
  ( `    "maximum": 2147483647` )
  ( `    }` )
  ( `  },` )
  ( `  "additionalProperties": false` )
  ( `}` ) ).

    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>table_callback( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "my_table_callback",` )
( `    "description": "A standard table of my_structure",` )
( `    "type": "array",` )
( `    "items": {` )
( `        "title": "mySimpleStructureWithFallback",` )
( `        "description": "This is a simple structure",` )
( `        "type": "object",` )
( `        "properties": {` )
( `            "myFirstElement": {` )
( `                "title": "myStringName",` )
( `                "description": "This is a String",` )
( `                "type": "string",` )
( `                "minLength": 2` )
( `            },` )
( `            "mySecondElement": {` )
( `                "title": "mySecondElement",` )
( `                "description": "This is the second element",` )
( `                "type": "integer",` )
( `                "minimum": -2147483648,` )
( `                "maximum": 2147483647` )
( `            }` )
( `        },` )
( `        "additionalProperties": false` )
( `    }` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD nested_table_with_callback.
    zcl_aff_test_types=>subschema = VALUE string_table(
( `"title": "my_table_of_table_callback", ` )
( `"description": "A standard table of my_table", ` )
( `"type": "array", ` )
( `"items": { ` )
( `  "title": "nestedTable", ` )
( `  "description": "This is the inner Table", ` )
( `  "type": "array", ` )
( `  "items": { ` )
( `    "title": "string", ` )
( `    "description": "string", ` )
( `    "type": "string" ` )
( `    } ` )
( `  } ` ) ).
    DATA(act_schema_co) = test_generator->generate_type( VALUE zcl_aff_test_types=>table_call_of_table( ) ).
    DATA(exp_schema) = VALUE string_table(
( ` { ` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( `    "$schema": "https://json-schema.org/draft/2020-12/schema", ` )
( `    "$id": "schema/id.json", ` )
( `    "title": "my_table_of_table_callback", ` )
( `    "description": "A standard table of my_table", ` )
( `    "type": "array", ` )
( `    "items": { ` )
( `      "title": "nestedTable", ` )
( `      "description": "This is the inner Table", ` )
( `      "type": "array", ` )
( `      "items": { ` )
( `        "title": "string", ` )
( `        "description": "string", ` )
( `        "type": "string" ` )
( `      } ` )
( `    } ` )
( `  } ` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema_co exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD table_of_struc_with_callback.
    zcl_aff_test_types=>subschema = VALUE string_table(
  ( `"title": "myStructureFall",` )
  ( `"description": "myStructure",` )
  ( `"type": "object",` )
  ( `"properties": {` )
  ( `  "myElement": {` )
  ( `    "title": "myElement",` )
  ( `    "description": "myElement",` )
  ( `    "type": "string"` )
  ( `  }` )
  ( `}` ) ).

    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>table_of_struc_with_callback( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "my_table",` )
( `    "description": "A standard table of my_structure_with_callback",` )
( `    "type": "array",` )
( `    "items": {` )
( `        "title": "myStructureFall",` )
( `        "description": "myStructure",` )
( `        "type": "object",` )
( `        "properties": {` )
( `            "myElement": {` )
( `                "title": "myElement",` )
( `                "description": "myElement",` )
( `                "type": "string"` )
( `            }` )
( `        }` )
( `    }` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD struct_with_table_callback.
    zcl_aff_test_types=>subschema = VALUE string_table(
  ( `"elementTableCallback": {` )
  ( `  "title": "myTableWithCallback",` )
  ( `  "description": "A standard table of strings",` )
  ( `  "type": "array",` )
  ( `  "items": {` )
  ( `    "title": "myStringName",` )
  ( `    "description": "This is a String",` )
  ( `    "type": "string",` )
  ( `    "maxLength": 3` )
  ( `  }` )
  ( `}` ) ).

    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>struc_of_table_with_callback( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "mySimpleStructure",` )
( `    "description": "This is a simple structure",` )
( `    "type": "object",` )
( `    "properties": {` )
( `        "elementTableCallback": {` )
( `            "title": "myTableWithCallback",` )
( `            "description": "A standard table of strings",` )
( `            "type": "array",` )
( `            "items": {` )
( `                "title": "myStringName",` )
( `                "description": "This is a String",` )
( `                "type": "string",` )
( `                "maxLength": 3` )
( `            }` )
( `        },` )
( `        "mySecondElement": {` )
( `            "title": "Second Element",` )
( `            "description": "This is the second element",` )
( `            "type": "integer",` )
( `            "minimum": -2147483648,` )
( `            "maximum": 2147483647` )
( `        }` )
( `    },` )
( `    "additionalProperties": false,` )
( `    "required": [ ` )
( `     "elementTableCallback" ` )
( `  ]` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

  METHOD struc_with_struc_callback.
    zcl_aff_test_types=>subschema = VALUE string_table(
  ( `"elementStructureCallback": {` )
  ( `  "title": "myStrucWithCallback",` )
  ( `  "description": "A simple structure",` )
  ( `  "type": "object",` )
  ( `  "properties": {` )
  ( `    "myElement": {` )
  ( `      "title": "element",` )
  ( `      "description": "This is a integer",` )
  ( `      "type": "integer",` )
  ( `      "minimum": -2147483648,` )
  ( `      "maximum": 2147483647` )
  ( `    }` )
  ( `  },` )
  ( `  "additionalProperties": false` )
  ( `}` ) ).

    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>struc_in_struc_with_callback( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "mySimpleStructure",` )
( `    "description": "This is a simple structure",` )
( `    "type": "object",` )
( `    "properties": {` )
( `        "myFirstElement": {` )
( `            "title": "First Element",` )
( `            "description": "This is the first element",` )
( `            "type": "string"` )
( `        },` )
( `        "elementStructureCallback": {` )
( `            "title": "myStrucWithCallback",` )
( `            "description": "A simple structure",` )
( `            "type": "object",` )
( `            "properties": {` )
( `                "myElement": {` )
( `                    "title": "element",` )
( `                    "description": "This is a integer",` )
( `                    "type": "integer",` )
( `                    "minimum": -2147483648,` )
( `                    "maximum": 2147483647` )
( `                }` )
( `            },` )
( `            "additionalProperties": false` )
( `         },` )
( `        "myThirdElement": {` )
( `            "title": "Third Element",` )
( `            "description": "This is the third element",` )
( `            "type": "integer",` )
( `            "minimum": -2147483648,` )
( `            "maximum": 2147483647` )
( `        }` )
( `    },` )
( `    "additionalProperties": false,` )
( `    "required": [ ` )
( `     "elementStructureCallback" ` )
( `  ]` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD element_in_structure_callback.
    zcl_aff_test_types=>subschema = VALUE string_table(
  ( `"elementCallback": {` )
  ( `  "title": "myStringName",` )
  ( `  "description": "This is a String",` )
  ( `  "type": "string",` )
  ( `  "minLength": 2` )
  ( `}` ) ).

    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_with_elem_callback( ) ).
    DATA(exp_schema) = VALUE string_table(
( `{` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `    "title": "Simple Structure",` )
( `    "description": "This is a simple structure",` )
( `    "type": "object",` )
( `    "properties": {` )
( `        "elementCallback": {` )
( `            "title": "myStringName",` )
( `            "description": "This is a String",` )
( `            "type": "string",` )
( `            "minLength": 2` )
( `        },` )
( `        "mySecondElement": {` )
( `            "title": "Second Element",` )
( `            "description": "This is the second element",` )
( `            "type": "integer",` )
( `            "minimum": -2147483648,` )
( `            "maximum": 2147483647` )
( `        }` )
( `    },` )
( `    "additionalProperties": false,` )
( `    "required": [` )
( `      "elementCallback"` )
( `    ]` )
( `}` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.


  METHOD structure_with_wrong_callback.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_with_wrong_callback( ) ).
    DATA(exp_schema) = VALUE string_table(
( `   { ` )
( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
( |    "$id": "{ schema_id }",| )
( `     "title": "Structure With Wrong Callback", ` )
( `     "description": "Structure with wrong callback", ` )
( `     "type": "object", ` )
( `     "properties": { ` )
( `       "myFirstElement": { ` )
( `         "title": "First Element", ` )
( `         "description": "This is the first element", ` )
( `         "type": "string", ` )
( `         "minLength": 2 ` )
( `       }, ` )
( `       "mySecondElement": { ` )
( `         "title": "Second Element",` )
( `         "description": "This is the second element",` )
( `         "type": "integer", ` )
( `         "minimum": -2147483648, ` )
( `         "maximum": 4 ` )
( `       } ` )
( `     }, ` )
( `     "additionalProperties": false, ` )
( `     "required": [` )
( `       "myFirstElement"` )
( `     ] ` )
( `   } ` )
( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 106 )
                                                             exp_component_name = `STRUCTURE_WITH_WRONG_CALLBACK-MY_FIRST_ELEMENT`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 109
                                                                                           attr1 = zcl_aff_abap_doc_parser=>abap_doc_annotation-callback_class )
                                                             exp_component_name = `STRUCTURE_WITH_WRONG_CALLBACK-MY_SECOND_ELEMENT`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
  ENDMETHOD.

  METHOD structure_no_title_descr.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_no_title_descr( ) ).
    DATA(exp_schema) = VALUE string_table(
  ( `   { ` )
  ( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
  ( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
  ( |    "$id": "{ schema_id }",| )
  ( `    "type": "object", ` )
  ( `    "properties": { ` )
  ( `      "field1": { ` )
  ( `        "description": "Only description",` )
  ( `        "type": "string" ` )
  ( `    }, ` )
  ( `    "innerStruc": { ` )
  ( `      "title": "Only Title",` )
  ( `       "type": "object", ` )
  ( `       "properties": { ` )
  ( `         "innerField": { ` )
  ( `           "title": "Inner Field",` )
  ( `           "description": "Inner field",` )
  ( `           "type": "integer", ` )
  ( `           "minimum": -2147483648, ` )
  ( `           "maximum": 2147483647 ` )
  ( `         } ` )
  ( `       }, ` )
  ( `       "additionalProperties": false ` )
  ( `     }, ` )
  ( `     "innerTable": { ` )
  ( `       "type": "array", ` )
  ( `       "items": { ` )
  ( `         "type": "string" ` )
  ( `       } ` )
  ( `     } ` )
  ( `   }, ` )
  ( `   "additionalProperties": false ` )
  ( ` } ` )
  ( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Title` )
                                                             exp_component_name = `STRUCTURE_NO_TITLE_DESCR`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Description` )
                                                             exp_component_name = `STRUCTURE_NO_TITLE_DESCR`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Title` )
                                                             exp_component_name = `STRUCTURE_NO_TITLE_DESCR-FIELD1`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Description` )
                                                             exp_component_name = `STRUCTURE_NO_TITLE_DESCR-INNER_STRUC`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                               msgno = 119
                                                                                               attr1 = `Title` )
                                                             exp_component_name = `STRUCTURE_NO_TITLE_DESCR-INNER_TABLE`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Description` )
                                                             exp_component_name = `STRUCTURE_NO_TITLE_DESCR-INNER_TABLE`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

  METHOD element_no_title_descr.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>element_no_title_descr( ) ).
    DATA(exp_schema) = VALUE string_table(
    ( `   { ` )
    ( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
    ( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
    ( |    "$id": "{ schema_id }",| )
    ( `    "type": "string" ` )
    ( ` } ` )
    ( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Title` )
                                                             exp_component_name = `ELEMENT_NO_TITLE_DESCR`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Description` )
                                                             exp_component_name = `ELEMENT_NO_TITLE_DESCR`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

  METHOD table_no_title_descr.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>table_no_title_descr( ) ).
    DATA(exp_schema) = VALUE string_table(
    ( `   { ` )
    ( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
    ( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
    ( |    "$id": "{ schema_id }",| )
    ( `    "type": "array", ` )
    ( `    "items": {` )
    ( `      "type": "string" ` )
    ( `    } ` )
    ( ` } ` )
    ( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Title` )
                                                             exp_component_name = `TABLE_NO_TITLE_DESCR`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Description` )
                                                             exp_component_name = `TABLE_NO_TITLE_DESCR`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

  METHOD structure_with_include.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>structure_with_include( ) ).
    DATA(exp_schema) = VALUE string_table(
    ( `   { ` )
    ( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
    ( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
    ( |    "$id": "{ schema_id }",| )
    ( `    "title": "Structure With Include", ` )
    ( `    "description": "Structure with include", ` )
    ( `    "type": "object", ` )
    ( `    "properties": { ` )
    ( `      "firstElement": { ` )
    ( `        "title": "First Element In Include",` )
    ( `        "type": "string" ` )
    ( `      }, ` )
    ( `      "secondElement": { ` )
    ( `        "title": "mySimpleStructure",` )
    ( `        "description": "This is a simple structure",` )
    ( `         "type": "object", ` )
    ( `         "properties": {` )
    ( `           "myFirstElement": {` )
    ( `              "title": "First Element",` )
    ( `              "description": "This is the first element",` )
    ( `              "type": "string",` )
    ( `              "minLength": 4` )
    ( `            },` )
    ( `            "mySecondElement": {` )
    ( `              "title": "Second Element",` )
    ( `              "description": "This is the second element",` )
    ( `              "type": "integer",` )
    ( `              "minimum": -2147483648,` )
    ( `              "maximum": 2147483647` )
    ( `            }` )
    ( `         },` )
    ( `         "additionalProperties": false` )
    ( `      },` )
    ( `      "thirdElement": {` )
    ( `        "title": "Third Element In Include",` )
    ( `        "description": "Third element in include",` )
    ( `        "type": "integer",` )
    ( `        "minimum": -2147483648,` )
    ( `        "maximum": 2147483647,` )
    ( `        "default": 10` )
    ( `      },` )
    ( `      "otherElement": { ` )
    ( `        "description": "Other element",` )
    ( `        "type": "integer",` )
    ( `        "minimum": -2147483648,` )
    ( `        "maximum": 2147483647` )
    ( `      },` )
    ( `      "otherStructure": { ` )
    ( `        "title": "Other structure",` )
    ( `        "description": "Other Structure",` )
    ( `        "type": "object", ` )
    ( `         "properties": {` )
    ( `           "myFirstElement": {` )
    ( `             "title": "First Element",` )
    ( `             "description": "This is the first element",` )
    ( `             "type": "string",` )
    ( `             "minLength": 4` )
    ( `           },` )
    ( `           "mySecondElement": {` )
    ( `             "title": "Second Element",` )
    ( `             "description": "This is the second element",` )
    ( `             "type": "integer",` )
    ( `             "minimum": -2147483648,` )
    ( `             "maximum": 2147483647` )
    ( `           }` )
    ( `         },` )
    ( `        "additionalProperties": false` )
    ( `      }` )
    ( `   }, ` )
    ( `   "additionalProperties": false, ` )
    ( `   "required": [` )
    ( `     "firstElement",` )
    ( `     "otherElement"` )
    ( `   ]` )
    ( ` } ` )
    ( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Title` )
                                                             exp_component_name = `STRUCTURE_WITH_INCLUDE-OTHER_ELEMENT`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 119
                                                                                           attr1 = `Description` )
                                                             exp_component_name = `TY_INCLUDE_TYPE-FIRST_ELEMENT`
                                                             exp_type           = zif_aff_log=>c_message_type-info ).

  ENDMETHOD.

  METHOD description_too_long.
    test_generator->generate_type( VALUE zcl_aff_test_types=>type_with_long_description( ) ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_contains_msg( log                = log
                                                             exp_message        = VALUE #( msgid = 'ZAFF_TOOLS'
                                                                                           msgno = 125
                                                                                           attr1 = zcl_aff_writer_json_schema=>c_max_length_of_description )
                                                             exp_component_name = `TYPE_WITH_LONG_DESCRIPTION`
                                                             exp_type           = zif_aff_log=>c_message_type-warning ).
  ENDMETHOD.

  METHOD get_extrema.
    DATA: integer    TYPE i, "-2147483648 to +2147483647 for i
          decfloat16 TYPE decfloat16, "1E385(1E-16 - 1) to -1E-383, 0, +1E-383 to 1E385(1 - 1E-16) for decfloat16
          ftype      TYPE f, "2.2250738585072014E-308 to 1.7976931348623157E+308, positive as well as negative
          packed     TYPE p LENGTH 14 DECIMALS 2, "length multiplied by 2 minus 1 digits and can have a maximum of 14 decimal places
          integer1   TYPE int1.
    DATA table_of_descriptions TYPE STANDARD TABLE OF REF TO cl_abap_elemdescr WITH DEFAULT KEY.
    TYPES: BEGIN OF line_of_table,
             min TYPE string,
             max TYPE string,
           END OF line_of_table.
    DATA table_of_expected TYPE STANDARD TABLE OF line_of_table WITH DEFAULT KEY.
    INSERT CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( integer ) ) INTO TABLE table_of_descriptions.
    INSERT VALUE #( min = `-2147483648` max = `2147483647` ) INTO TABLE table_of_expected.

    INSERT CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( decfloat16 ) ) INTO TABLE table_of_descriptions.
    INSERT VALUE #( min = `-9.999999999999999e384` max = `9.999999999999999e384` ) INTO TABLE table_of_expected.

    INSERT CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( ftype ) ) INTO TABLE table_of_descriptions.
    INSERT VALUE #( min = `-1.7976931348623157e308` max = `1.7976931348623157e308` ) INTO TABLE table_of_expected.

    INSERT CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( packed ) ) INTO TABLE table_of_descriptions.
    INSERT VALUE #( min = `-9999999999999999999999999.99` max = `9999999999999999999999999.99` ) INTO TABLE table_of_expected.

    INSERT CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( integer1 ) ) INTO TABLE table_of_descriptions.
    INSERT VALUE #( min = `0` max = `255` ) INTO TABLE table_of_expected.

    LOOP AT table_of_descriptions ASSIGNING FIELD-SYMBOL(<description>).
      DATA(table_index) = sy-tabix.
      cut->get_extrema(
        EXPORTING
          element_description = <description>
        IMPORTING
          max                 = DATA(max)
          min                 = DATA(min) ).
      cl_abap_unit_assert=>assert_equals( exp = table_of_expected[ table_index ]-min act = min ).
      cl_abap_unit_assert=>assert_equals( exp = table_of_expected[ table_index ]-max act = max ).
    ENDLOOP.
  ENDMETHOD.

  METHOD calculate_max_length.
    DATA c_length_30 TYPE c LENGTH 30.
    DATA(max_length) = cut->get_max_length(
      element_description = CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( c_length_30 ) ) ).
    cl_abap_unit_assert=>assert_equals( exp = 30 act = max_length ).

    DATA c_length_60 TYPE c LENGTH 60.
    max_length = cut->get_max_length(
      element_description = CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( c_length_60 ) ) ).
    cl_abap_unit_assert=>assert_equals( exp = 60 act = max_length ).

    DATA n_length_10 TYPE n LENGTH 10.
    max_length = cut->get_max_length(
      element_description = CAST cl_abap_elemdescr( cl_abap_typedescr=>describe_by_data( n_length_10 ) ) ).
    cl_abap_unit_assert=>assert_equals( exp = 10 act = max_length ).
  ENDMETHOD.

  METHOD struc_with_own_enum_values.
    DATA(act_schema) = test_generator->generate_type( VALUE zcl_aff_test_types=>struc_with_own_enum_values( ) ).
    DATA(exp_schema) = VALUE string_table(
    ( `   { ` )
    ( |    "$comment": "This file is autogenerated, do not edit manually, see { zcl_aff_writer_json_schema=>c_link_to_repository } for more information.", | )
    ( |    "$schema": "{ zcl_aff_writer_json_schema=>c_schema_specification }",| )
    ( |    "$id": "{ schema_id }",| )
    ( `    "title": "Structure With Overwritten Enum Values", ` )
    ( `    "description": "Structure with overwritten enum values", ` )
    ( `    "type": "object", ` )
    ( `    "properties": { ` )
    ( `      "enumComponent": { ` )
    ( `        "title": "Enum Component",` )
    ( `        "description": "Enum component",` )
    ( `        "type": "string", ` )
    ( `         "enum": [ ` )
    ( `           "AAAA", ` )
    ( `           "BBBB" ` )
    ( `         ], ` )
    ( `         "enumTitles": [ ` )
    ( `           "Option 1", ` )
    ( `           "Option 2" ` )
    ( `         ], ` )
    ( `         "enumDescriptions": [ ` )
    ( `           "Option 1", ` )
    ( `           "Option 2" ` )
    ( `         ] ` )
    ( `      } ` )
    ( `   }, ` )
    ( `   "additionalProperties": false, ` )
    ( `   "required": [` )
    ( `     "enumComponent"` )
    ( `   ]` )
    ( ` } ` )
    ( ) ).
    zcl_aff_tools_unit_test_helper=>assert_equals_ignore_spaces( act_data = act_schema exp_data = exp_schema ).
    log = cut->zif_aff_writer~get_log( ).
    zcl_aff_tools_unit_test_helper=>assert_log_has_no_message( log = log message_severity_threshold = zif_aff_log=>c_message_type-info ).
  ENDMETHOD.

ENDCLASS.
