Repository: Dorthu/openapi3

Issue:
[Bug] - Expects incorrect type on parameter default 
Trying to parse a spec containing a parameter component with a numeric default with incorrectly throw and states that a string default was expected.

Version: `1.7.0`

Minimal example spec:

```yaml
openapi: 3.0.0

info:
  title: Test api
  description: test
  version: 0.1.0

paths:
  /test:
    get:
      requestBody:
        content:
          application/json:
            schema:
              type: string
        required: true
      responses:
        200:
          description: A good test

components:
  parameters:
    someComponent:
      name: someComponent
      in: query
      schema:
        type: number
        minimum: 0
        default: 0
``` 

To experience the error, load the specfile with yaml and try `OpenAPI(spec)`. It should throw.
If you replace `default: 0` with `default: '0'`, it will not throw.

The given spec is valid yaml

Discussion:

Patch:
diff --git a/openapi3/schemas.py b/openapi3/schemas.py
index 0796552..d454e47 100644
--- a/openapi3/schemas.py
+++ b/openapi3/schemas.py
@@ -8,6 +8,7 @@ TYPE_LOOKUP = {
     "object": dict,
     "string": str,
     "boolean": bool,
+    "number": float,
 }
 
 


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index 7dffe2a..ffa7925 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -213,6 +213,7 @@ def with_external_docs():
 
 
 @pytest.fixture
+
 def with_openapi_310_references():
     """
     Provides a spec with OpenAPI 3.1.0 expanded Reference Objects
@@ -226,3 +227,11 @@ def with_reference_referencing_reference():
     Provides a spec with a reference that references a reference
     """
     yield _get_parsed_yaml("reference-reference-reference.yaml")
+
+
+@pytest.fixture
+def with_all_default_types():
+    """
+    Provides a spec with defaults defined in various schemas of all types
+    """
+    yield _get_parsed_yaml("with_all_default_types.yaml")
diff --git a/tests/fixtures/with_all_default_types.yaml b/tests/fixtures/with_all_default_types.yaml
new file mode 100644
index 0000000..16b36e4
--- /dev/null
+++ b/tests/fixtures/with_all_default_types.yaml
@@ -0,0 +1,55 @@
+openapi: 3.0.0
+info:
+  title: Numeric default parameter
+  version: 0.0.1
+paths:
+  /example:
+    get:
+      requestBody:
+        content:
+          application/json:
+            schema:
+              type: object
+              properties:
+                int:
+                  type: integer
+                  default: 0
+                str:
+                  type: string
+                  default: "test"
+                bool:
+                  type: boolean
+                  default: true
+                float:
+                  type: number
+                  default: 0.1
+        required: true
+      responses:
+        200:
+          description: it worked
+components:
+  parameters:
+    int:
+      name: exampleParam
+      in: query
+      schema:
+        type: integer
+        default: 0
+    str:
+      name: exampleParam2
+      in: query
+      schema:
+        type: string
+        default: "test"
+    bool:
+      name: exampleParam3
+      in: query
+      schema:
+        type: boolean
+        default: true
+    float:
+      name: exampleParam4
+      in: query
+      schema:
+        type: number
+        default: 0.1
diff --git a/tests/parsing_test.py b/tests/parsing_test.py
index 8ad8704..7cf1919 100644
--- a/tests/parsing_test.py
+++ b/tests/parsing_test.py
@@ -159,3 +159,20 @@ def test_external_docs(with_external_docs):
     assert spec.tags[0].externalDocs.url == "http://example.org/tags"
     assert spec.paths["/example"].get.externalDocs.url == "http://example.org/operation"
     assert spec.paths["/example"].get.responses['200'].content['application/json'].schema.externalDocs.url == "http://example.org/schema"
+
+
+def test_schema_default_types(with_all_default_types):
+    """
+    Tests that schemas accept defaults in their defined types
+    """
+    spec = OpenAPI(with_all_default_types)
+    assert spec.components.parameters["int"].schema.default == 0
+    assert spec.components.parameters["str"].schema.default == "test"
+    assert spec.components.parameters["bool"].schema.default == True
+    assert spec.components.parameters["float"].schema.default == 0.1
+
+    schema = spec.paths["/example"].get.requestBody.content["application/json"].schema
+    assert schema.properties["int"].default == 0
+    assert schema.properties["str"].default == "test"
+    assert schema.properties["bool"].default == True
+    assert schema.properties["float"].default == 0.1