Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
4683-Fix-since-tags-json.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 4683-Fix-since-tags-json.patch of Package erlang
From c714e219c38915d8cca9d6807c2921e1cd7fd45b Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson <dgud@erlang.org> Date: Fri, 8 Mar 2024 14:33:09 +0100 Subject: [PATCH 3/3] Fix since tags (json) And also add the copyright to the OTP copyright file. --- lib/stdlib/doc/docs.exs | 1 + lib/stdlib/src/json.erl | 18 ++++++++++++++++++ system/COPYRIGHT | 29 +++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/lib/stdlib/src/json.erl b/lib/stdlib/src/json.erl index 6d7561d871..7210239fed 100644 --- a/lib/stdlib/src/json.erl +++ b/lib/stdlib/src/json.erl @@ -132,6 +132,7 @@ This is equivalent to `encode(Term, fun json:encode_value/2)`. <<"{\"foo\":\"bar\"}">> ``` """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode(encode_value()) -> iodata(). encode(Term) -> encode(Term, fun do_encode/2). @@ -159,6 +160,7 @@ lists of key-value pairs from plain lists: <<"{\"a\":[],\"b\":1}">> ``` """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode(dynamic(), encoder()) -> iodata(). encode(Term, Encoder) when is_function(Encoder, 2) -> Encoder(Term, Encoder). @@ -169,6 +171,7 @@ Default encoder used by `json:encode/1`. Recursively calls `Encode` on all the values in `Value`. """. -spec encode_value(dynamic(), encoder()) -> iodata(). +-doc(#{since => <<"OTP 27.0">>}). encode_value(Value, Encode) -> do_encode(Value, Encode). @@ -197,6 +200,7 @@ and everything else as JSON strings calling the `Encode` callback with the corresponding binary. """. -spec encode_atom(atom(), encoder()) -> iodata(). +-doc(#{since => <<"OTP 27.0">>}). encode_atom(null, _Encode) -> <<"null">>; encode_atom(true, _Encode) -> <<"true">>; encode_atom(false, _Encode) -> <<"false">>; @@ -205,18 +209,21 @@ encode_atom(Other, Encode) -> Encode(atom_to_binary(Other, utf8), Encode). -doc """ Default encoder for integers as JSON numbers used by `json:encode/1`. """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode_integer(integer()) -> iodata(). encode_integer(Integer) -> integer_to_binary(Integer). -doc """ Default encoder for floats as JSON numbers used by `json:encode/1`. """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode_float(float()) -> iodata(). encode_float(Float) -> float_to_binary(Float, [short]). -doc """ Default encoder for lists as JSON arrays used by `json:encode/1`. """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode_list(list(), encoder()) -> iodata(). encode_list(List, Encode) when is_list(List) -> do_encode_list(List, Encode). @@ -234,6 +241,7 @@ Default encoder for maps as JSON objects used by `json:encode/1`. Accepts maps with atom, binary, integer, or float keys. """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode_map(encode_map(dynamic()), encoder()) -> iodata(). encode_map(Map, Encode) when is_map(Map) -> do_encode_map(Map, Encode). @@ -252,6 +260,7 @@ resulting JSON object. Raises `error({duplicate_key, Key})` if there are duplicates. """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode_map_checked(map(), encoder()) -> iodata(). encode_map_checked(Map, Encode) -> do_encode_checked(maps:to_list(Map), Encode). @@ -261,6 +270,7 @@ Encoder for lists of key-value pairs as JSON objects. Accepts lists with atom, binary, integer, or float keys. """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode_key_value_list([{term(), term()}], encoder()) -> iodata(). encode_key_value_list(List, Encode) when is_function(Encode, 2) -> encode_object([[$,, key(Key, Encode), $: | Encode(Value, Encode)] || {Key, Value} <- List]). @@ -276,6 +286,7 @@ resulting JSON object. Raises `error({duplicate_key, Key})` if there are duplicates. """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode_key_value_list_checked([{term(), term()}], encoder()) -> iodata(). encode_key_value_list_checked(List, Encode) -> do_encode_checked(List, Encode). @@ -315,6 +326,7 @@ Default encoder for binaries as JSON strings used by `json:encode/1`. * `error(unexpected_end)` if the binary contains incomplete UTF-8 sequences. * `error({invalid_byte, Byte})` if the binary contains invalid UTF-8 sequences. """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode_binary(binary()) -> iodata(). encode_binary(Bin) when is_binary(Bin) -> escape_binary(Bin). @@ -329,6 +341,7 @@ For any non-ASCII unicode character, a corresponding `\\uXXXX` sequence is used. * `error(unexpected_end)` if the binary contains incomplete UTF-8 sequences. * `error({invalid_byte, Byte})` if the binary contains invalid UTF-8 sequences. """. +-doc(#{since => <<"OTP 27.0">>}). -spec encode_binary_escape_all(binary()) -> iodata(). encode_binary_escape_all(Bin) when is_binary(Bin) -> escape_all(Bin). @@ -601,7 +614,9 @@ Supports basic data mapping: ```erlang > json:decode(<<"{\"foo\": 1}">>). #{<<"foo">> => 1} +``` """. +-doc(#{since => <<"OTP 27.0">>}). -spec decode(binary()) -> decode_value(). decode(Binary) when is_binary(Binary) -> case value(Binary, Binary, 0, ok, [], #decode{}) of @@ -659,6 +674,7 @@ Decoding object keys as atoms: {#{foo => 1},ok,<<>>} ``` """. +-doc(#{since => <<"OTP 27.0">>}). -spec decode(binary(), dynamic(), decoders()) -> {Result :: dynamic(), Acc :: dynamic(), binary()}. decode(Binary, Acc0, Decoders) when is_binary(Binary) -> @@ -681,6 +697,7 @@ Similar to `decode/3` but returns when a complete JSON value can be parsed or returns `{continue, State}` for incomplete data, the `State` can be fed to the `decode_continue/2` function when more data is available. """. +-doc(#{since => <<"OTP 27.0">>}). -spec decode_start(binary(), dynamic(), decoders()) -> {Result :: dynamic(), Acc :: dynamic(), binary()} | {continue, continuation_state()}. decode_start(Binary, Acc, Decoders) when is_binary(Binary) -> @@ -704,6 +721,7 @@ there is no more data, use `end_of_input` instead of a binary. {123,ok,<<>>} ``` """. +-doc(#{since => <<"OTP 27.0">>}). -spec decode_continue(binary() | end_of_input, Opaque::term()) -> {Result :: dynamic(), Acc :: dynamic(), binary()} | {continue, continuation_state()}. decode_continue(end_of_input, State) -> diff --git a/system/COPYRIGHT b/system/COPYRIGHT index f2906fd9e1..64cd2c0355 100644 --- a/system/COPYRIGHT +++ b/system/COPYRIGHT @@ -667,6 +667,35 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +--------------------------------------------------------------------------- +[json tests] + +* Info: + * SPDX-License-Identifier: MIT + * Git Repository: https://github.com/nst/JSONTestSuite + * Commit: 984defc2deaa653cb73cd29f4144a720ec9efe7c + * OTP Location: ./lib/stdlib/test/json_SUITE_data + +Copyright (c) 2016 Nicolas Seriot + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + --------------------------------------------------------------------------- [wx documentation] -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor