Module Bindoj_gen_config.Json_config

type json_schema
include module type of Bindoj_codec.Json.Json_config
type json_variant_style = [
  1. | `flatten
]
type json_tuple_style = [
  1. | `arr
  2. | `obj of [ `default ]
]
type json_mangling_style = [
  1. | `default
    (*

    the default mangling style mangles as the following

    type name

    snake_case to UpperCamelCase, e.g.

    • ocaml: `some_type_name`
    • typescript: `SomeTypeName`

    field name

    snake_case to lowerCamelCase, e.g.

    • ocaml: `some_field_foo`
    • json: `someFieldFoo`

    variant name

    Capitalized_snake_case to kebab-case

    • ocaml: `Some_branch_foo`
    • json: `some-branch-foo`

    when a version substring is present

    major version + minor version

    type name

    • ocaml: `version_info_v1_0`
    • typescript: `VersionInfoV1_0`

    variant/kind/enum name

    • ocaml`Version_info_v1_0`
    • json: `version-info-v1_0`

    field name

    • ocaml: `version_info_v1_0`
    • json: `versionInfoV1_0`

    major version only

    type name

    • ocaml: `version_info_v1`
    • typescript: `VersionInfoV1`

    variant/kind/enum name

    • ocaml: `Version_info_v1`
    • json: `version-info-v1`

    field name

    • ocaml: `version_info_v1`
    • json: `versionInfoV1`

    with patch number

    type name

    • ocaml: `version_info_v1_0_1`
    • typescript: `VersionInfoV1_0_1`

    variant/kind/enum name

    • ocaml: `Version_info_v1_0_1`
    • json: `version-info-v1_0_1`

    field name

    • ocaml: `version_info_v1_0_1`
    • json: `versionInfoV1_0_1`
    *)
  2. | `default_no_preserving_version_substring
    (*

    the mangling style is almost same as default, but the version substring like `v1_0` is not presrved.

    *)
  3. | `no_mangling
    (*

    do not mangle

    *)
]
type json_nested_field_style = [
  1. | `nested
    (*

    nested field stay as a nested

    *)
  2. | `spreading
    (*

    nested field's internal fields being spreading; would result in error if the field does not ultimately resolves to a Bindoj_typedesc.Type_desc.type_decl_kind.Record_decl / Bindoj_typedesc.Type_desc.type_decl_kind.Variant_decl kinded Bindoj_typedesc.Type_desc.type_decl

    *)
]
type variant_arg_name_style = [
  1. | `exactly of string
  2. | `value
    (*

    "value", the default

    *)
  3. | `arg
    (*

    "arg"

    *)
  4. | `kind_name of json_mangling_style option
    (*

    if argument is None, the exact same string of the kind field is used; otherwise, the kind name will be mangled accordingly to the supplied mangling style

    *)
]
type Bindoj_base.Typed_type_desc.config +=
  1. | Config_json_name : string -> ('pos, [ `json_name ]) Bindoj_base.Typed_type_desc.config
  2. | Config_json_name_of_variant_arg : variant_arg_name_style -> ([< `variant_constructor | `type_decl ], [ `json_name_of_variant_arg ]) Bindoj_base.Typed_type_desc.config
  3. | Config_json_variant_style : json_variant_style -> ([ `variant_constructor ], [ `json_variant_style ]) Bindoj_base.Typed_type_desc.config
  4. | Config_json_variant_discriminator : string -> ([ `type_decl ], [ `json_variant_discriminator ]) Bindoj_base.Typed_type_desc.config
  5. | Config_json_tuple_style : json_tuple_style -> ([< `variant_constructor | `coretype ], [ `json_tuple_style ]) Bindoj_base.Typed_type_desc.config
  6. | Config_json_nested_field_style : json_nested_field_style -> ([< `record_field | `variant_tuple_argument ], [ `json_nested_field_style ]) Bindoj_base.Typed_type_desc.config
  7. | Config_json_mangling_style : json_mangling_style -> ('pos, [ `json_mangling_style ]) Bindoj_base.Typed_type_desc.config
  8. | Config_json_custom_encoder : string -> ([ `coretype ], [ `json_custom_encoder ]) Bindoj_base.Typed_type_desc.config
  9. | Config_json_custom_decoder : string -> ([ `coretype ], [ `json_custom_decoder ]) Bindoj_base.Typed_type_desc.config
  10. | Config_json_custom_shape_explanation : Bindoj_runtime.json_shape_explanation -> ([ `coretype ], [ `json_custom_shape_explanation ]) Bindoj_base.Typed_type_desc.config
val tuple_index_to_field_name : int -> string
val name : string -> ([< Bindoj_base.Typed_type_desc.pos ], [ `json_name ]) Bindoj_base.Typed_type_desc.config
val name_of_variant_arg : variant_arg_name_style -> ([< `variant_constructor | `type_decl ], [ `json_name_of_variant_arg ]) Bindoj_base.Typed_type_desc.config
val get_name_of_variant_arg_opt : [< `variant_constructor | `type_decl ] Bindoj_base.Typed_type_desc.configs -> variant_arg_name_style option
val default_name_of_variant_arg : variant_arg_name_style

default : `value . The default field name for the argument of a variant constructor. Use Json_config.name_of_variant_arg for variant_constructor .. (`tuple_like ..) to override.

val default_variant_style : json_variant_style
val variant_style : json_variant_style -> ([ `variant_constructor ], [ `json_variant_style ]) Bindoj_base.Typed_type_desc.config
val get_variant_style : [ `variant_constructor ] Bindoj_base.Typed_type_desc.configs -> json_variant_style
val default_variant_discriminator : string
val variant_discriminator : string -> ([ `type_decl ], [ `json_variant_discriminator ]) Bindoj_base.Typed_type_desc.config
val get_variant_discriminator : [ `type_decl ] Bindoj_base.Typed_type_desc.configs -> string
val default_tuple_style : json_tuple_style
val tuple_style : json_tuple_style -> ([< `variant_constructor | `coretype ], [ `json_tuple_style ]) Bindoj_base.Typed_type_desc.config
val get_tuple_style : [< `coretype | `variant_constructor ] Bindoj_base.Typed_type_desc.configs -> json_tuple_style
val default_nested_field_style : json_nested_field_style

default : `nested

val nested_field_style : json_nested_field_style -> ([< `record_field | `variant_tuple_argument ], [ `json_nested_field_style ]) Bindoj_base.Typed_type_desc.config
val get_nested_field_style : [< `record_field | `variant_tuple_argument ] Bindoj_base.Typed_type_desc.configs -> json_nested_field_style
val default_mangling_style : json_mangling_style

default : `default true

val mangling_style : json_mangling_style -> ([< Bindoj_base.Typed_type_desc.pos ], [ `json_mangling_style ]) Bindoj_base.Typed_type_desc.config
val no_mangling : ([< Bindoj_base.Typed_type_desc.pos ], [ `json_mangling_style ]) Bindoj_base.Typed_type_desc.config
val default_mangling : ([< Bindoj_base.Typed_type_desc.pos ], [ `json_mangling_style ]) Bindoj_base.Typed_type_desc.config
val default_mangling_no_preserving_version_substring : ([< Bindoj_base.Typed_type_desc.pos ], [ `json_mangling_style ]) Bindoj_base.Typed_type_desc.config
val mangled : [ `type_name | `field_name | `discriminator_value | `string_enum_case ] -> json_mangling_style -> string -> string
val get_mangled_name_of_type : ?inherited:json_mangling_style -> Bindoj_base.Typed_type_desc.type_decl -> string * json_mangling_style
val get_mangled_name_of_field : ?inherited:json_mangling_style -> Bindoj_base.Typed_type_desc.record_field -> string * json_mangling_style
val get_mangled_name_of_discriminator' : ?inherited:json_mangling_style -> [ `variant_constructor ] Bindoj_base.Typed_type_desc.configs -> string -> string * json_mangling_style
val get_mangled_name_of_discriminator : ?inherited:json_mangling_style -> Bindoj_base.Typed_type_desc.variant_constructor -> string * json_mangling_style
val get_mangled_name_of_discriminator_field' : ?inherited:json_mangling_style -> [ `type_decl ] Bindoj_base.Typed_type_desc.configs -> string
val get_mangled_name_of_discriminator_field : ?inherited:json_mangling_style -> Bindoj_base.Typed_type_desc.type_decl -> string
val get_mangled_name_of_variant_arg' : ?inherited:json_mangling_style -> [ `type_decl ] Bindoj_base.Typed_type_desc.configs -> [ `variant_constructor ] Bindoj_base.Typed_type_desc.configs -> string -> string
val get_mangled_name_of_variant_arg : ?inherited:json_mangling_style -> [ `type_decl ] Bindoj_base.Typed_type_desc.configs -> Bindoj_base.Typed_type_desc.variant_constructor -> string
val get_mangled_name_of_string_enum_case : ?inherited:json_mangling_style -> Bindoj_base.Typed_type_desc.Coretype.string_enum_case -> string
val custom_encoder : string -> ([ `coretype ], [ `json_custom_encoder ]) Bindoj_base.Typed_type_desc.config
val get_custom_encoder : [ `coretype ] Bindoj_base.Typed_type_desc.configs -> string option
val custom_decoder : string -> ([ `coretype ], [ `json_custom_decoder ]) Bindoj_base.Typed_type_desc.config
val get_custom_decoder : [ `coretype ] Bindoj_base.Typed_type_desc.configs -> string option
val custom_shape_explanation : Bindoj_runtime.json_shape_explanation -> ([ `coretype ], [ `json_custom_shape_explanation ]) Bindoj_base.Typed_type_desc.config
val get_custom_shape_explanation : [ `coretype ] Bindoj_base.Typed_type_desc.configs -> Bindoj_runtime.json_shape_explanation option
val check_field_name_collision : Bindoj_base.Typed_type_desc.type_decl -> bool
val custom_json_schema : Bindoj_openapi.V3.Schema_object.t -> ([ `coretype ], [ `foreign_type_expression ]) Bindoj_typedesc.Type_desc.config