| 1 | # Licensed to Elasticsearch B.V. under one or more contributor | ||
| 2 | # license agreements. See the NOTICE file distributed with | ||
| 3 | # this work for additional information regarding copyright | ||
| 4 | # ownership. Elasticsearch B.V. licenses this file to you under | ||
| 5 | # the Apache License, Version 2.0 (the "License"); you may | ||
| 6 | # not use this file except in compliance with the License. | ||
| 7 | # You may obtain a copy of the License at | ||
| 8 | # | ||
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | # | ||
| 11 | # Unless required by applicable law or agreed to in writing, | ||
| 12 | # software distributed under the License is distributed on an | ||
| 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| 14 | # KIND, either express or implied. See the License for the | ||
| 15 | # specific language governing permissions and limitations | ||
| 16 | # under the License. | ||
| 17 | |||
| 18 | package Search::Elasticsearch::Serializer::JSON::XS; | ||
| 19 | 3 | $Search::Elasticsearch::Serializer::JSON::XS::VERSION = '8.12'; | |
| 20 | 3 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 3 | ▶ | use JSON::XS 2.26; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 3 | ▶ | has 'JSON' => ( is => 'ro', default => sub { JSON::XS->new->utf8(1) } ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 24 | |||
| 25 | 3 | with 'Search::Elasticsearch::Role::Serializer::JSON'; | |
| 26 | |||
| 27 | 3 | 1; | |
| 28 | |||
| 29 | =pod | ||
| 30 | |||
| 31 | =encoding UTF-8 | ||
| 32 | |||
| 33 | =head1 NAME | ||
| 34 | |||
| 35 | Search::Elasticsearch::Serializer::JSON::XS - A JSON Serializer using JSON::XS | ||
| 36 | |||
| 37 | =head1 VERSION | ||
| 38 | |||
| 39 | version 8.12 | ||
| 40 | |||
| 41 | =head1 SYNOPSIS | ||
| 42 | |||
| 43 | $e = Search::Elasticsearch( | ||
| 44 | serializer => 'JSON::XS' | ||
| 45 | ); | ||
| 46 | |||
| 47 | =head1 DESCRIPTION | ||
| 48 | |||
| 49 | While the default serializer, L<Search::Elasticsearch::Serializer::JSON>, | ||
| 50 | tries to choose the appropriate JSON backend, this module allows you to | ||
| 51 | choose the L<JSON::XS> backend specifically. | ||
| 52 | |||
| 53 | This class does L<Search::Elasticsearch::Role::Serializer::JSON>. | ||
| 54 | |||
| 55 | =head1 SEE ALSO | ||
| 56 | |||
| 57 | =over | ||
| 58 | |||
| 59 | =item * L<Search::Elasticsearch::Serializer::JSON> | ||
| 60 | |||
| 61 | =item * L<Search::Elasticsearch::Serializer::JSON::Cpanel> | ||
| 62 | |||
| 63 | =item * L<Search::Elasticsearch::Serializer::JSON::PP> | ||
| 64 | |||
| 65 | =back | ||
| 66 | |||
| 67 | =head1 AUTHOR | ||
| 68 | |||
| 69 | Enrico Zimuel <enrico.zimuel@elastic.co> | ||
| 70 | |||
| 71 | =head1 COPYRIGHT AND LICENSE | ||
| 72 | |||
| 73 | This software is Copyright (c) 2024 by Elasticsearch BV. | ||
| 74 | |||
| 75 | This is free software, licensed under: | ||
| 76 | |||
| 77 | The Apache License, Version 2.0, January 2004 | ||
| 78 | |||
| 79 | =cut | ||
| 80 | |||
| 81 | __END__ | ||