Repository: Algebra8/pyopenapi3

Issue:
Allow Free-Form Objects
Consider the following example:

```
definitions:
  Pet:
    type: object
    properties:
      tags:
        type: object
        description: Custom tags
```

According to [Open API 3 specs on data types](https://swagger.io/docs/specification/data-models/data-types/#object), "a free-form object (arbitrary property/value pairs) is defined as: `type: object`. This is equivalent to `type: object, additionalProperties: true` and `type: object, additionalProperties: {}`."

Free form objects should be allowed.

Discussion:

Patch:
diff --git a/src/pyopenapi3/schemas.py b/src/pyopenapi3/schemas.py
index 141822f..daa78f6 100644
--- a/src/pyopenapi3/schemas.py
+++ b/src/pyopenapi3/schemas.py
@@ -164,7 +164,9 @@ class DTSchema(SchemaObject):
 class ObjectsDTSchema(DTSchema):
 
     type: str = Field('object', const=True)
-    properties: Dict[str, Union[ReferenceObject, SchemaObject]]
+
+    # Optional to allow Free-Form objects. See issue-82.
+    properties: Optional[Dict[str, Union[ReferenceObject, SchemaObject]]]
 
 
 class PrimitiveDTSchema(DTSchema):


Test patch:
diff --git a/tests/test_schemas.py b/tests/test_schemas.py
new file mode 100644
index 0000000..19c5977
--- /dev/null
+++ b/tests/test_schemas.py
@@ -0,0 +1,7 @@
+from pyopenapi3.schemas import ObjectsDTSchema
+
+
+def test_free_form_object():
+    o = ObjectsDTSchema()
+
+    assert o.dict() == {"type": "object"}