Repository: sanic-org/sanic-ext (python)

Issue:
[Bug] Static and Class methods are added to the example request bodies
**Describe the bug**
Class / static methods are included in the example request body.

**To Reproduce**
Create a dataclass add a class/static method to it and set it to a requestbody with `@openapi.body({"application/json": Class})`

**Expected behavior**
We pass an instance of a class so class and static methods should not be in the documentation. 

**Environment (please complete the following information):**
 - OS: Pop OS 22.04
 - Browser curl
 - Version 22.3.1

Pull request:
Proper check of Pydantic properties on OAS
Closes #80 

Patch:
diff --git a/sanic_ext/extensions/openapi/types.py b/sanic_ext/extensions/openapi/types.py
index 191132d..76a9c70 100644
--- a/sanic_ext/extensions/openapi/types.py
+++ b/sanic_ext/extensions/openapi/types.py
@@ -2,7 +2,7 @@ import json
 import uuid
 from datetime import date, datetime, time
 from enum import Enum
-from inspect import getmembers, isfunction
+from inspect import getmembers, isfunction, ismethod
 from typing import (
     Any,
     Dict,
@@ -312,7 +312,7 @@ def _properties(value: object) -> Dict:
         fields = {
             x: val
             for x, v in getmembers(value, _is_property)
-            if (val := _extract(v))
+            if (val := _extract(v)) and x in value.__dict__
         }
     except AttributeError:
         fields = {}
@@ -333,4 +333,4 @@ def _extract(item):
 
 
 def _is_property(item):
-    return not isfunction(item)
+    return not isfunction(item) and not ismethod(item)
diff --git a/setup.cfg b/setup.cfg
index f75f88a..c1fd63b 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
 [metadata]
 name = sanic-ext
-version = 22.6.0
+version = 22.6.1
 url = http://github.com/sanic-org/sanic-ext/
 license = MIT
 author = Sanic Community


Test patch:
diff --git a/tests/extensions/openapi/test_schema.py b/tests/extensions/openapi/test_schema.py
index c6033a7..079f86b 100644
--- a/tests/extensions/openapi/test_schema.py
+++ b/tests/extensions/openapi/test_schema.py
@@ -12,16 +12,26 @@ def test_schema_list():
         list1: List[int]
         list2: list[int]
 
-        def no_show(self) -> None:
-            ...
-
         @property
         def show(self) -> bool:
             return True
 
+        def no_show_method(self) -> None:
+            ...
+
+        @classmethod
+        def no_show_classmethod(self) -> None:
+            ...
+
+        @staticmethod
+        def no_show_staticmethod() -> None:
+            ...
+
     schema = Schema.make(Foo)
     serialized = schema.serialize()
-    assert "no_show" not in serialized
+    assert "no_show_method" not in serialized
+    assert "no_show_classmethod" not in serialized
+    assert "no_show_staticmethod" not in serialized
     assert serialized == {
         "type": "object",
         "properties": {