Skip to content

Commit 4dc1db1

Browse files
committed
fixup! show alias
1 parent 06a8e8f commit 4dc1db1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/griffe_pydantic/_internal/dynamic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _process_class(obj: type, cls: Class, *, processed: set[str], schema: bool =
8282
elif kind is Kind.FUNCTION:
8383
_process_function(getattr(obj, member.name), member, cls, processed=processed) # ty: ignore[invalid-argument-type]
8484

85-
# Process model fields that may not have been discovered by griffe
85+
# Process model fields that may not have been discovered by Griffe.
8686
if hasattr(obj, "model_fields") and isinstance(obj.model_fields, dict):
8787
for field_name, field_info in obj.model_fields.items():
8888
if field_name not in cls.all_members:

src/griffe_pydantic/_internal/static.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ def _process_attribute(attr: Attribute, cls: Class, *, processed: set[str]) -> N
203203
attr.labels.discard("instance-attribute")
204204

205205
attr.value = kwargs.get("default")
206-
constraints = {kwarg: value for kwarg, value in kwargs.items() if kwarg not in {"default", "description", "alias"}}
206+
constraints = {
207+
kwarg: value
208+
for kwarg, value in kwargs.items()
209+
if kwarg not in {"default", "description", "alias", "validation_alias", "serialization_alias"}
210+
}
207211
attr.extra[common._self_namespace]["constraints"] = constraints
208212
attr.extra[common._mkdocstrings_namespace]["template"] = "pydantic_field.html.jinja"
209213

0 commit comments

Comments
 (0)