diff --git a/pydantic/main.py b/pydantic/main.py
--- a/pydantic/main.py
+++ b/pydantic/main.py
@@ -184,6 +184,7 @@ def inherit_config(self_config: 'ConfigType', parent_config: 'ConfigType', **nam
     namespace['json_encoders'] = {
         **getattr(parent_config, 'json_encoders', {}),
         **getattr(self_config, 'json_encoders', {}),
+        **namespace.get('json_encoders', {}),
     }
 
     return type('Config', base_classes, namespace)

diff --git a/tests/test_main.py b/tests/test_main.py
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -1723,6 +1723,13 @@ class Model(Base, extra='allow'):
     assert Model.__fields__['b'].alias == 'B'  # alias_generator still works
 
 
+def test_class_kwargs_config_json_encoders():
+    class Model(BaseModel, json_encoders={int: str}):
+        pass
+
+    assert Model.__config__.json_encoders == {int: str}
+
+
 def test_class_kwargs_config_and_attr_conflict():
 
     with pytest.raises(

`inherit_config` overwrites `json_encoders` from class creation arguments
### Checks

* [x] I added a descriptive title to this issue
* [x] I have searched (google, github) for similar issues and couldn't find anything
* [x] I have read and followed [the docs](https://pydantic-docs.helpmanual.io/) and still think this is a bug

<!-- Sorry to sound so draconian, but every second saved replying to issues is time spend improving pydantic :-) -->

# Bug

Output of `python -c "import pydantic.utils; print(pydantic.utils.version_info())"`:
```
             pydantic version: 1.8.1
            pydantic compiled: False
                 install path: [...]/lib/python3.9/site-packages/pydantic
               python version: 3.9.2 (default, Feb 21 2021, 06:38:26)  [Clang 7.1.0 (tags/RELEASE_710/final)]
                     platform: macOS-10.14.6-x86_64-i386-64bit
     optional deps. installed: ['typing-extensions']
```
<!-- or if you're using pydantic prior to v1.3, manually include: OS, python version and pydantic version -->

<!-- Please read the [docs](https://pydantic-docs.helpmanual.io/) and search through issues to
confirm your bug hasn't already been reported. -->

<!-- Where possible please include a self-contained code snippet describing your bug: -->

```py
import pydantic

class Foo(pydantic.BaseModel):
    class Config:
        json_encoders = {int: str}

print('Foo json_encoders:', Foo.__config__.json_encoders)


class Bar(pydantic.BaseModel, json_encoders={int: str}):
    pass

print('Bar json_encoders:', Bar.__config__.json_encoders)
```

Output:

```
Foo json_encoders: {<class 'int'>: <class 'str'>}
Bar json_encoders: {}
```

Culprit:

https://github.com/samuelcolvin/pydantic/blob/62bb2ad4921016df51abf3922c3fe51113b08939/pydantic/main.py#L184-L187
`inherit_config` overwrites `json_encoders` from class creation arguments
### Checks

* [x] I added a descriptive title to this issue
* [x] I have searched (google, github) for similar issues and couldn't find anything
* [x] I have read and followed [the docs](https://pydantic-docs.helpmanual.io/) and still think this is a bug

<!-- Sorry to sound so draconian, but every second saved replying to issues is time spend improving pydantic :-) -->

# Bug

Output of `python -c "import pydantic.utils; print(pydantic.utils.version_info())"`:
```
             pydantic version: 1.8.1
            pydantic compiled: False
                 install path: [...]/lib/python3.9/site-packages/pydantic
               python version: 3.9.2 (default, Feb 21 2021, 06:38:26)  [Clang 7.1.0 (tags/RELEASE_710/final)]
                     platform: macOS-10.14.6-x86_64-i386-64bit
     optional deps. installed: ['typing-extensions']
```
<!-- or if you're using pydantic prior to v1.3, manually include: OS, python version and pydantic version -->

<!-- Please read the [docs](https://pydantic-docs.helpmanual.io/) and search through issues to
confirm your bug hasn't already been reported. -->

<!-- Where possible please include a self-contained code snippet describing your bug: -->

```py
import pydantic

class Foo(pydantic.BaseModel):
    class Config:
        json_encoders = {int: str}

print('Foo json_encoders:', Foo.__config__.json_encoders)


class Bar(pydantic.BaseModel, json_encoders={int: str}):
    pass

print('Bar json_encoders:', Bar.__config__.json_encoders)
```

Output:

```
Foo json_encoders: {<class 'int'>: <class 'str'>}
Bar json_encoders: {}
```

Culprit:

https://github.com/samuelcolvin/pydantic/blob/62bb2ad4921016df51abf3922c3fe51113b08939/pydantic/main.py#L184-L187

tests/test_main.py::test_class_kwargs_config_json_encoders
tests/test_main.py::test_success tests/test_main.py::test_ultra_simple_missing tests/test_main.py::test_ultra_simple_failed tests/test_main.py::test_ultra_simple_repr tests/test_main.py::test_default_factory_field tests/test_main.py::test_default_factory_no_type_field tests/test_main.py::test_comparing tests/test_main.py::test_nullable_strings_success tests/test_main.py::test_nullable_strings_fails tests/test_main.py::test_recursion tests/test_main.py::test_recursion_fails tests/test_main.py::test_not_required tests/test_main.py::test_infer_type tests/test_main.py::test_allow_extra tests/test_main.py::test_forbidden_extra_success tests/test_main.py::test_forbidden_extra_fails tests/test_main.py::test_disallow_mutation tests/test_main.py::test_extra_allowed tests/test_main.py::test_extra_ignored tests/test_main.py::test_set_attr tests/test_main.py::test_set_attr_invalid tests/test_main.py::test_any tests/test_main.py::test_alias tests/test_main.py::test_population_by_field_name tests/test_main.py::test_field_order tests/test_main.py::test_required tests/test_main.py::test_mutability tests/test_main.py::test_immutability[False-False] tests/test_main.py::test_immutability[False-True] tests/test_main.py::test_immutability[True-True] tests/test_main.py::test_not_frozen_are_not_hashable tests/test_main.py::test_with_declared_hash tests/test_main.py::test_frozen_with_hashable_fields_are_hashable tests/test_main.py::test_frozen_with_unhashable_fields_are_not_hashable tests/test_main.py::test_hash_function_give_different_result_for_different_object tests/test_main.py::test_const_validates tests/test_main.py::test_const_uses_default tests/test_main.py::test_const_validates_after_type_validators tests/test_main.py::test_const_with_wrong_value tests/test_main.py::test_const_with_validator tests/test_main.py::test_const_list tests/test_main.py::test_const_list_with_wrong_value tests/test_main.py::test_const_validation_json_serializable tests/test_main.py::test_validating_assignment_pass tests/test_main.py::test_validating_assignment_fail tests/test_main.py::test_validating_assignment_pre_root_validator_fail tests/test_main.py::test_validating_assignment_post_root_validator_fail tests/test_main.py::test_root_validator_many_values_change tests/test_main.py::test_enum_values tests/test_main.py::test_literal_enum_values tests/test_main.py::test_enum_raw tests/test_main.py::test_set_tuple_values tests/test_main.py::test_default_copy tests/test_main.py::test_arbitrary_type_allowed_validation_success tests/test_main.py::test_arbitrary_type_allowed_validation_fails tests/test_main.py::test_arbitrary_types_not_allowed tests/test_main.py::test_type_type_validation_success tests/test_main.py::test_type_type_subclass_validation_success tests/test_main.py::test_type_type_validation_fails_for_instance tests/test_main.py::test_type_type_validation_fails_for_basic_type tests/test_main.py::test_bare_type_type_validation_success tests/test_main.py::test_bare_type_type_validation_fails tests/test_main.py::test_annotation_field_name_shadows_attribute tests/test_main.py::test_value_field_name_shadows_attribute tests/test_main.py::test_class_var tests/test_main.py::test_fields_set tests/test_main.py::test_exclude_unset_dict tests/test_main.py::test_exclude_unset_recursive tests/test_main.py::test_dict_exclude_unset_populated_by_alias tests/test_main.py::test_dict_exclude_unset_populated_by_alias_with_extra tests/test_main.py::test_exclude_defaults tests/test_main.py::test_dir_fields tests/test_main.py::test_dict_with_extra_keys tests/test_main.py::test_root tests/test_main.py::test_root_list tests/test_main.py::test_root_nested tests/test_main.py::test_encode_nested_root tests/test_main.py::test_root_failed tests/test_main.py::test_root_undefined_failed tests/test_main.py::test_parse_root_as_mapping tests/test_main.py::test_parse_obj_non_mapping_root tests/test_main.py::test_parse_obj_nested_root tests/test_main.py::test_untouched_types tests/test_main.py::test_custom_types_fail_without_keep_untouched tests/test_main.py::test_model_iteration tests/test_main.py::test_model_export_nested_list[excluding tests/test_main.py::test_model_export_nested_list[should tests/test_main.py::test_model_export_nested_list[using tests/test_main.py::test_model_export_dict_exclusion[excluding tests/test_main.py::test_model_export_dict_exclusion[using tests/test_main.py::test_model_export_dict_exclusion[exclude tests/test_main.py::test_model_exclude_config_field_merging tests/test_main.py::test_model_export_exclusion_with_fields_and_config[None-expected0-kinds0] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[None-expected0-kinds1] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[None-expected0-kinds2] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[None-expected0-kinds3] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[None-expected0-kinds4] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[None-expected0-kinds5] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[None-expected0-kinds6] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude1-expected1-kinds0] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude1-expected1-kinds1] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude1-expected1-kinds2] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude1-expected1-kinds3] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude1-expected1-kinds4] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude1-expected1-kinds5] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude1-expected1-kinds6] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude2-expected2-kinds0] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude2-expected2-kinds1] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude2-expected2-kinds2] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude2-expected2-kinds3] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude2-expected2-kinds4] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude2-expected2-kinds5] tests/test_main.py::test_model_export_exclusion_with_fields_and_config[exclude2-expected2-kinds6] tests/test_main.py::test_model_export_exclusion_inheritance tests/test_main.py::test_model_export_with_true_instead_of_ellipsis tests/test_main.py::test_model_export_inclusion tests/test_main.py::test_model_export_inclusion_inheritance tests/test_main.py::test_custom_init_subclass_params tests/test_main.py::test_update_forward_refs_does_not_modify_module_dict tests/test_main.py::test_two_defaults tests/test_main.py::test_default_factory tests/test_main.py::test_default_factory_called_once tests/test_main.py::test_default_factory_called_once_2 tests/test_main.py::test_default_factory_validate_children tests/test_main.py::test_default_factory_parse tests/test_main.py::test_none_min_max_items tests/test_main.py::test_reuse_same_field tests/test_main.py::test_base_config_type_hinting tests/test_main.py::test_allow_mutation_field tests/test_main.py::test_inherited_model_field_copy tests/test_main.py::test_inherited_model_field_untouched tests/test_main.py::test_mapping_retains_type_subclass tests/test_main.py::test_mapping_retains_type_defaultdict tests/test_main.py::test_mapping_retains_type_fallback_error tests/test_main.py::test_typing_coercion_dict tests/test_main.py::test_typing_coercion_defaultdict tests/test_main.py::test_class_kwargs_config tests/test_main.py::test_class_kwargs_config_and_attr_conflict tests/test_main.py::test_class_kwargs_custom_config