Repository: Dorthu/openapi3

Issue:
Contact fields that should be optional are considered required, resulting in raised SpecError.
When parsing a JSON spec, if the `contact` object is specified but missing _any_ of `name`, `url`, or `email`, a `SpecError` is raised:
```
openapi3.errors.SpecError: Expected info.contact to be of type Contact, with required fields ['name', 'url', 'email']
```

As far as I can tell from research, all three of these fields are optional:
- [OpenAPI Specification v3.0.3](https://spec.openapis.org/oas/v3.0.3#contact-object) _(I linked v3.0.3, but it looks to be the same for other versions as well)_
- When visiting the online [Swagger Editor](https://editor.swagger.io/), assuming you don't have anything stored in your browser, the example spec generated only has `email: "apiteam@swagger.io"` in the `contact` object.

Discussion:

Patch:
diff --git a/openapi3/info.py b/openapi3/info.py
index 4bc332f..66ea9f7 100644
--- a/openapi3/info.py
+++ b/openapi3/info.py
@@ -31,7 +31,7 @@ class Contact(ObjectBase):
     """
 
     __slots__ = ["name", "url", "email"]
-    required_fields = ["name", "url", "email"]
+    required_fields = []
 
     def _parse_data(self):
         """


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index 0e92712..e360518 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -194,3 +194,11 @@ def with_array_example():
     Provides a spec that includes arrays as the value of examples
     """
     yield _get_parsed_yaml("example_array.yaml")
+
+
+@pytest.fixture
+def empty_contact():
+    """
+    Provides a spec with an empty contact section in info
+    """
+    yield _get_parsed_yaml("empty_contact.yaml")
diff --git a/tests/fixtures/empty_contact.yaml b/tests/fixtures/empty_contact.yaml
new file mode 100644
index 0000000..1ab3936
--- /dev/null
+++ b/tests/fixtures/empty_contact.yaml
@@ -0,0 +1,7 @@
+openapi: "3.1.0"
+info:
+  version: 1.0.0
+  title: Valid spec with valid an empty contact block
+  contact:
+    name: Example
+paths:
diff --git a/tests/parsing_test.py b/tests/parsing_test.py
index b69036a..eae6990 100644
--- a/tests/parsing_test.py
+++ b/tests/parsing_test.py
@@ -140,3 +140,11 @@ def test_example_type_array(with_array_example):
     """
     spec = OpenAPI(with_array_example, validate=True)
     assert len(spec.errors()) == 0, spec.errors()
+
+
+def test_empty_contact(empty_contact):
+    """
+    Tests that empty contact blocks are accepted
+    """
+    spec = OpenAPI(empty_contact, validate=True)
+    assert len(spec.errors()) == 0