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

Allow tuples to be converted to JsonNode by % in json.nim as discussed in #24082 . #24089

Open
wants to merge 6 commits into
base: devel
Choose a base branch
from

Commits on Sep 9, 2024

  1. allow tuples as input for %

    Allow tuples as input for `%`, but disallow them in the generic type of the `%` proc that accepts openArrays.
    Additionally addedthe isNamedTuple(T) proc. Can instead also be imported from std/typetraits, but ig dependencies should be kept to a minimum.
    siriuslee69 authored Sep 9, 2024
    Configuration menu
    Copy the full SHA
    4eca659 View commit details
    Browse the repository at this point in the history
  2. 1 Configuration menu
    Copy the full SHA
    d625d01 View commit details
    Browse the repository at this point in the history
  3. added some info the proc %

    added additional conversion info to the proc, copied it straight from an earlier issue
    siriuslee69 authored Sep 9, 2024
    Configuration menu
    Copy the full SHA
    8a38030 View commit details
    Browse the repository at this point in the history
  4. replaced toJson(v, opt) with %v

    Forgot to change parts of the copied code from jsonutils.
    siriuslee69 authored Sep 9, 2024
    Configuration menu
    Copy the full SHA
    cedc683 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7b5b3c5 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. split overloaded proc % for tuple and object in json.nim

    Something like proc myproc[T: object|tuple](o:T): void = ...
    might not accept the tuple properly even though it's supposed to, such that:
    myproc(mytup) doesn't work. 
    Idk if that was the actual problem here, but just to be sure, I changed the respective functions.
    siriuslee69 authored Sep 10, 2024
    Configuration menu
    Copy the full SHA
    8803394 View commit details
    Browse the repository at this point in the history