Add copyright year to source file
This commit is contained in:
parent
9b5fbf8a0c
commit
34dc825066
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
# begin Nimble config (version 1)
|
||||
when fileExists("nimble.paths"):
|
||||
include "nimble.paths"
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
serialization, json_serialization/[format, reader, writer]
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
serialization/formats
|
||||
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
{.push raises: [].}
|
||||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
std/[json, unicode],
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
{.experimental: "notnil".}
|
||||
|
||||
import
|
||||
|
@ -773,4 +782,4 @@ template configureJsonDeserialization*(
|
|||
static: doAssert not allowNumericRepr or enumStyle(T) == EnumStyle.Numeric
|
||||
r.parseEnum(value, allowNumericRepr, stringNormalizer)
|
||||
|
||||
{.pop.}
|
||||
{.pop.}
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
std/strutils, stew/shims/net,
|
||||
../../json_serialization, chronos/transports/common
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import std/options, ../../json_serialization/[reader, writer, lexer]
|
||||
export options
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import stew/shims/sets, ../../json_serialization/[reader, writer, lexer]
|
||||
export sets
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import stew/shims/tables, ../../json_serialization/[reader, writer, lexer]
|
||||
export tables
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
stew/results, ../../json_serialization/[reader, writer, lexer]
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
serialization/errors
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
std/[json, typetraits],
|
||||
faststreams/[outputs, textio], serialization,
|
||||
|
@ -152,6 +161,9 @@ template writeObjectField*[FieldType, RecordType](w: var JsonWriter,
|
|||
field: FieldType): bool =
|
||||
mixin writeFieldIMPL, writeValue
|
||||
|
||||
type
|
||||
R {.used.} = type record
|
||||
|
||||
w.writeFieldName(fieldName)
|
||||
when RecordType is tuple:
|
||||
w.writeValue(field)
|
||||
|
|
|
@ -1,2 +1,11 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
--threads:on
|
||||
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
{. warning[UnusedImport]:off .}
|
||||
|
||||
import
|
||||
test_lexer,
|
||||
test_serialization
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
strutils,
|
||||
serialization,
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
{.used.}
|
||||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
unittest,
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
{.used.}
|
||||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
strutils, unittest2, json,
|
||||
|
@ -746,6 +753,7 @@ suite "toJson tests":
|
|||
expect SerializationError:
|
||||
let h4 = Json.decode("""{"o":{"distance":3,"x":1,"y":"2"}}""",
|
||||
HoldsOption, requireAllFields = true)
|
||||
discard h4
|
||||
|
||||
test "Nested option types":
|
||||
let
|
||||
|
@ -824,6 +832,7 @@ suite "toJson tests":
|
|||
expect SerializationError:
|
||||
let h4 = Json.decode("""{"o":{"distance":3,"x":1,"y":"2"}}""",
|
||||
HoldsResultOpt, requireAllFields = true)
|
||||
discard h4
|
||||
|
||||
test "Custom field serialization":
|
||||
let obj = WithCustomFieldRule(str: "test", intVal: 10)
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
import strutils
|
||||
# json-serialization
|
||||
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
||||
# at your option.
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import
|
||||
strutils
|
||||
|
||||
# `dedent` exists in newer Nim version and doesn't behave the same
|
||||
func test_dedent*(s: string): string =
|
||||
|
|
Loading…
Reference in New Issue