import API: route -> intermediateStops
This commit is contained in:
parent
ba62df34ea
commit
d7c69acf41
2 changed files with 11 additions and 7 deletions
|
@ -18,7 +18,10 @@ sub sanitize {
|
||||||
if ( $type eq '' ) {
|
if ( $type eq '' ) {
|
||||||
return '' . $value;
|
return '' . $value;
|
||||||
}
|
}
|
||||||
return 0 + $value;
|
if ( $value =~ m{ ^ [0-9.e]+ $ }x ) {
|
||||||
|
return 0 + $value;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub documentation {
|
sub documentation {
|
||||||
|
@ -457,9 +460,12 @@ sub import_v1 {
|
||||||
lax => $payload->{lax} ? 1 : 0,
|
lax => $payload->{lax} ? 1 : 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( $payload->{route} and ref( $payload->{route} ) eq 'ARRAY' ) {
|
if ( $payload->{intermediateStops}
|
||||||
$opt{route}
|
and ref( $payload->{intermediateStops} ) eq 'ARRAY' )
|
||||||
= [ map { sanitize( q{}, $_ ) } @{ $payload->{route} } ];
|
{
|
||||||
|
$opt{intermediateStops}
|
||||||
|
= [ map { sanitize( q{}, $_ ) }
|
||||||
|
@{ $payload->{intermediateStops} } ];
|
||||||
}
|
}
|
||||||
|
|
||||||
for my $key (qw(sched_departure rt_departure sched_arrival rt_arrival))
|
for my $key (qw(sched_departure rt_departure sched_arrival rt_arrival))
|
||||||
|
|
|
@ -189,10 +189,8 @@
|
||||||
"scheduledTime": 1556083980, (UNIX-Timestamp)<br/>
|
"scheduledTime": 1556083980, (UNIX-Timestamp)<br/>
|
||||||
"realTime": 1556083980, (UNIX-Timestamp, optional, default == scheduledTime)<br/>
|
"realTime": 1556083980, (UNIX-Timestamp, optional, default == scheduledTime)<br/>
|
||||||
},<br/>
|
},<br/>
|
||||||
"route" : [ (optionale Liste mit Unterwegshalten als Name oder DS100, darf keine Stationen vor Checkin oder nach Checkout beinhalten)<br/>
|
"intermediateStops" : [ (optionale Liste mit Unterwegshalten als Name oder DS100, darf keine Stationen vor Checkin oder nach Checkout beinhalten)<br/>
|
||||||
"Essen Hbf",<br/>
|
|
||||||
"Essen Süd",<br/>
|
"Essen Süd",<br/>
|
||||||
"Essen Stadtwald"<br/>
|
|
||||||
],<br/>
|
],<br/>
|
||||||
"comment" : "Beliebiger Text" (optionaler Freitext-Kommentar)<br/>
|
"comment" : "Beliebiger Text" (optionaler Freitext-Kommentar)<br/>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue