GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
YAML::PP::Schema::JSON(3) User Contributed Perl Documentation YAML::PP::Schema::JSON(3)

YAML::PP::Schema::JSON - YAML 1.2 JSON Schema

    my $yp = YAML::PP->new( schema => ['JSON'] );
    my $yp = YAML::PP->new( schema => [qw/ JSON empty=str /] );
    my $yp = YAML::PP->new( schema => [qw/ JSON empty=null /] );

With this schema, the resolution of plain values will work like in JSON. Everything that matches a special value will be loaded as such, other plain scalars will be loaded as strings.

Note that this is different from the official YAML 1.2 JSON Schema, where all strings have to be quoted.

Here you can see all Schemas and examples implemented by YAML::PP: <https://perlpunk.github.io/YAML-PP-p5/schemas.html>

Official Schema: <https://yaml.org/spec/1.2/spec.html#id2803231>

The official YAML 1.2 JSON Schema wants all strings to be quoted. YAML::PP currently does not require that (it might do this optionally in the future).

That means, there are no empty nodes allowed in the official schema. Example:

    ---
    key:

The default behaviour of YAML::PP::Schema::JSON is to return an empty string, so it would be equivalent to:

    ---
    key: ''

You can configure it to resolve this as "undef":

    my $yp = YAML::PP->new( schema => [qw/ JSON empty=null /] );

This way it is equivalent to:

    ---
    key: null

The default is:

    my $yp = YAML::PP->new( schema => [qw/ JSON empty=str /] );

register
Called by YAML::PP::Schema
represent_bool, represent_float, represent_int, represent_literal, represent_undef
Functions to represent the several node types.

    represent_bool($representer, $node);
    
2021-12-25 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.