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

Deprecate Valid() and add Wellformed() to replace it #400

Merged
merged 1 commit into from
May 1, 2023

Commits on May 1, 2023

  1. Deprecate Valid() and add Wellformed() to replace it

    Valid() is deprecated and only calls WellFormed(), so it will
    behave the same way between current v2.4 and upcoming v2.5 release.
    
    Projects should begin replacing calls to Valid() with calls to WellFormed().
    
    Although the old docs for Valid() correctly said it checks for well-formedness,
    this refactor was done because Valid() is not an appropriate function name.
    
    RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
    
    Wellformed() checks whether data is a well-formed encoded CBOR data item and
    that it complies with additional restrictions such as MaxNestedLevels,
    MaxArrayElements, MaxMapPairs, etc.  If there are any remaining bytes
    after the encoded CBOR data item, then ExtraneousDataError is returned.
    fxamacker committed May 1, 2023
    Configuration menu
    Copy the full SHA
    c9e9b26 View commit details
    Browse the repository at this point in the history