@@ -133,15 +133,15 @@ sub check_jurisdiction_id {
133
133
* jurisdictions - an array of jurisdiction_ids
134
134
you may want to subclass the methods:
135
135
- requires_jurisdiction_ids
136
- - check_jurisdiction_id
136
+ - check_jurisdiction_id
137
137
* default_identifier_type
138
138
Open311 doesn't mandate what these types look like, but a backend
139
139
server may! The module provides an example identifier type which allows
140
140
ascii "word" characters .e.g [a-zA-Z0-9_] as an example default.
141
141
You can also override these individually using:
142
142
143
143
identifier_types => {
144
- api_key => '//str', #
144
+ api_key => '//str', #
145
145
jurisdiction_id => ...
146
146
service_code => ...
147
147
service_request_id => ...
@@ -246,9 +246,9 @@ has json => (
246
246
has xml => (
247
247
is => ' lazy' ,
248
248
default => sub {
249
- XML::Simple-> new(
250
- NoAttr => 1,
251
- KeepRoot => 1,
249
+ XML::Simple-> new(
250
+ NoAttr => 1,
251
+ KeepRoot => 1,
252
252
SuppressEmpty => 0,
253
253
);
254
254
},
@@ -419,15 +419,15 @@ sub GET_Service_Definition {
419
419
%optional ,
420
420
$attribute -> has_values ? (
421
421
values => [
422
- map {
422
+ map {
423
423
my ($key , $name ) = @$_ ;
424
- +{
425
- key => $key ,
424
+ +{
425
+ key => $key ,
426
426
name => $name ,
427
427
}
428
428
} $self -> service_attribute_values( $attribute )
429
429
]) : (),
430
- map { $_ => $attribute -> $_ }
430
+ map { $_ => $attribute -> $_ }
431
431
qw/ code datatype datatype_description description / ,
432
432
}
433
433
} $service -> get_attributes,
@@ -456,8 +456,8 @@ sub POST_Service_Request_input_schema {
456
456
# to give a nice error message
457
457
return {
458
458
type => ' //rec' ,
459
- required => {
460
- service_code => $self -> get_identifier_type(' service_code' ),
459
+ required => {
460
+ service_code => $self -> get_identifier_type(' service_code' ),
461
461
api_key => $self -> get_identifier_type(' api_key' ) },
462
462
rest => ' //any' ,
463
463
};
@@ -518,7 +518,7 @@ sub POST_Service_Request_input_schema {
518
518
};
519
519
}
520
520
521
- return {
521
+ return {
522
522
type => ' //any' ,
523
523
of => \@address_schemas ,
524
524
};
@@ -571,12 +571,12 @@ sub POST_Service_Request {
571
571
}
572
572
573
573
my @service_requests = $self -> post_service_request( $service , $args );
574
-
574
+
575
575
return {
576
576
service_requests => [
577
577
map {
578
- my $service_notice =
579
- $_ -> service_notice
578
+ my $service_notice =
579
+ $_ -> service_notice
580
580
|| $service -> default_service_notice
581
581
|| $self -> default_service_notice;
582
582
+{
@@ -754,7 +754,7 @@ sub format_service_requests {
754
754
zipcode
755
755
lat
756
756
long
757
- /
757
+ /
758
758
),
759
759
(
760
760
map {
@@ -812,11 +812,11 @@ sub get_jurisdiction_id_validation {
812
812
813
813
# jurisdiction_id is documented as "Required", but with the note
814
814
# 'This is only required if the endpoint serves multiple jurisdictions'
815
- # i.e. it is optional as regards the schema, but the server may choose
815
+ # i.e. it is optional as regards the schema, but the server may choose
816
816
# to error if it is not provided.
817
817
return {
818
818
type => ' //rec' ,
819
- ($self -> requires_jurisdiction_ids ? ' required' : ' optional' ) => {
819
+ ($self -> requires_jurisdiction_ids ? ' required' : ' optional' ) => {
820
820
jurisdiction_id => $self -> get_identifier_type(' jurisdiction_id' ),
821
821
},
822
822
};
@@ -834,7 +834,7 @@ sub get_jurisdiction_id_optional_clause {
834
834
835
835
sub call_api {
836
836
my ($self , $api_name , @args ) = @_ ;
837
-
837
+
838
838
my $api_method = $self -> can($api_name )
839
839
or die " No such API $api_name !" ;
840
840
@@ -894,10 +894,10 @@ sub format_response {
894
894
my $data = $response -> data;
895
895
if ($ext eq ' json' ) {
896
896
return [
897
- $status ,
897
+ $status ,
898
898
[ ' Content-Type' => ' application/json' ],
899
- [ $self -> json-> encode(
900
- $self -> spark-> process_for_json( $data )
899
+ [ $self -> json-> encode(
900
+ $self -> spark-> process_for_json( $data )
901
901
)]
902
902
];
903
903
}
@@ -916,7 +916,7 @@ sub format_response {
916
916
404,
917
917
[ ' Content-Type' => ' text/plain' ],
918
918
[ ' Bad extension. We support .xml and .json' ],
919
- ]
919
+ ]
920
920
}
921
921
}
922
922
}
0 commit comments