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

Update alias documentation #3680

Closed
wants to merge 1 commit into from

Conversation

targhs
Copy link

@targhs targhs commented Jan 16, 2022

Change Summary

Add usage example for schema field customization alias

Update documentation verbose and add example for using alias

Related issue number

fix #1681

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Add usage example for schema field customization alias
@targhs
Copy link
Author

targhs commented Jan 16, 2022

As its a documentation change, test cases aren't required.

@targhs
Copy link
Author

targhs commented Jan 16, 2022

please review

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely needed, thank you.

Needs some changes:

  • needs a whole new section to describe alias
  • we need to add docs on the effect of alias with .dict() and .json()

@@ -61,7 +61,12 @@ It has the following arguments:
* `default_factory`: a zero-argument callable that will be called when a default value is needed for this field.
Among other purposes, this can be used to set dynamic default values.
It is forbidden to set both `default` and `default_factory`.
* `alias`: the public name of the field
* `alias`: the public name of the field. The name maps to a field during initialization.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will break the bullet points, we should add a whole new section (probably not in schema.py) to document alias.

@samuelcolvin
Copy link
Member

please update.

@targhs
Copy link
Author

targhs commented Apr 7, 2022

Need your input here.

  1. Needs a whole new section to describe
    If not in schema, where? It feels more natural to me if its there along with Unenforced-field-constraints and modifying-schema-in-custom-fields
  2. Gotcha

@samuelcolvin
Copy link
Member

samuelcolvin commented Aug 8, 2022

If not in schema, where?

Sorry for the slow reply, in models.md. Documentation will be rearranged in V2, but that's the best place for now.

please update.

@samuelcolvin
Copy link
Member

Notice

See twitter 🐦, I've you'd like this to be included in V1.10, please fix it and request a review TODAY.

Or if you need this in V1.10 but don't have time to complete it (or aren't the author), please comment here and on #4324.

@samuelcolvin
Copy link
Member

No reply, closing.

Let me know if you'd like me to re-open this.

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

Successfully merging this pull request may close these issues.

Alias documentation
3 participants