Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package fails to Import #3

Open
deuelvogel opened this issue Apr 7, 2024 · 0 comments
Open

Package fails to Import #3

deuelvogel opened this issue Apr 7, 2024 · 0 comments

Comments

@deuelvogel
Copy link

After installing the package using pip (pip install asyncapi-schema-pydantic) and trying to import in python, we see the following error:

raise PydanticUserError(
pydantic.errors.PydanticUserError: A non-annotated attribute was detected: is_object = <asyncapi_schema_pydantic.v2_3_0.json_schema.cached_property object at 0x000002349877D310>. All model fields require a type annotation; if is_object is not meant to be a field, you may be able to resolve this error by annotating it as a ClassVar or updating model_config['ignored_types']

Full stack:

Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\Python312\Lib\site-packages\asyncapi_schema_pydantic_init_.py", line 1, in
from .v2_3_0 import *
File "C:\Program Files\Python312\Lib\site-packages\asyncapi_schema_pydantic\v2_3_0_init_.py", line 6, in
from .async_api import AsyncAPI
File "C:\Program Files\Python312\Lib\site-packages\asyncapi_schema_pydantic\v2_3_0\async_api.py", line 3, in
from .async_api_base import AsyncAPIBase
File "C:\Program Files\Python312\Lib\site-packages\asyncapi_schema_pydantic\v2_3_0\async_api_base.py", line 5, in
from .components import Components
File "C:\Program Files\Python312\Lib\site-packages\asyncapi_schema_pydantic\v2_3_0\components.py", line 5, in
from .parameter import Parameter
File "C:\Program Files\Python312\Lib\site-packages\asyncapi_schema_pydantic\v2_3_0\parameter.py", line 6, in
from .schema import Schema
File "C:\Program Files\Python312\Lib\site-packages\asyncapi_schema_pydantic\v2_3_0\schema.py", line 5, in
from .json_schema import JsonSchemaObject
File "C:\Program Files\Python312\Lib\site-packages\asyncapi_schema_pydantic\v2_3_0\json_schema.py", line 102, in
class JsonSchemaObject(BaseModel):
File "C:\Program Files\Python312\Lib\site-packages\pydantic_internal_model_construction.py", line 92, in new
private_attributes = inspect_namespace(
^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\pydantic_internal_model_construction.py", line 384, in inspect_namespace
raise PydanticUserError(
pydantic.errors.PydanticUserError: A non-annotated attribute was detected: is_object = <asyncapi_schema_pydantic.v2_3_0.json_schema.cached_property object at 0x000002349877D310>. All model fields require a type annotation; if is_object is not meant to be a field, you may be able to resolve this error by annotating it as a ClassVar or updating model_config['ignored_types'].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant