diff --git a/api/.gitignore b/api/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/api/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/api/.mvn/wrapper/maven-wrapper.jar b/api/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000..cb28b0e Binary files /dev/null and b/api/.mvn/wrapper/maven-wrapper.jar differ diff --git a/api/.mvn/wrapper/maven-wrapper.properties b/api/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..e70e7bc --- /dev/null +++ b/api/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/api/mvnw b/api/mvnw new file mode 100755 index 0000000..66df285 --- /dev/null +++ b/api/mvnw @@ -0,0 +1,308 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.2.0 +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "$(uname)" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && + JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then + if $darwin ; then + javaHome="$(dirname "\"$javaExecutable\"")" + javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" + else + javaExecutable="$(readlink -f "\"$javaExecutable\"")" + fi + javaHome="$(dirname "\"$javaExecutable\"")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=$(cd "$wdir/.." || exit 1; pwd) + fi + # end of workaround + done + printf '%s' "$(cd "$basedir" || exit 1; pwd)" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' < "$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR +log "$MAVEN_PROJECTBASEDIR" + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" +else + log "Couldn't find $wrapperJarPath, downloading it ..." + + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + fi + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; + esac + done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget > /dev/null; then + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + fi + else + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + log " - Compiling MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; + esac +done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# shellcheck disable=SC2086 # safe args +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/api/mvnw.cmd b/api/mvnw.cmd new file mode 100644 index 0000000..95ba6f5 --- /dev/null +++ b/api/mvnw.cmd @@ -0,0 +1,205 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.2.0 +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/api/pom.xml b/api/pom.xml new file mode 100644 index 0000000..d20b82f --- /dev/null +++ b/api/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.2.5 + + + org.entur.gbfs.validator + api + 0.0.1-SNAPSHOT + api + api + + 17 + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.entur.gbfs.validator + loader + 1.0-SNAPSHOT + + + + org.entur.gbfs + gbfs-validator-java + 2.0.0-SNAPSHOT + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/api/src/main/java/org/entur/gbfs/validator/api/ApiApplication.java b/api/src/main/java/org/entur/gbfs/validator/api/ApiApplication.java new file mode 100644 index 0000000..e4e3adb --- /dev/null +++ b/api/src/main/java/org/entur/gbfs/validator/api/ApiApplication.java @@ -0,0 +1,13 @@ +package org.entur.gbfs.validator.api; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ApiApplication { + + public static void main(String[] args) { + SpringApplication.run(ApiApplication.class, args); + } + +} diff --git a/api/src/main/java/org/entur/gbfs/validator/api/RestResource.java b/api/src/main/java/org/entur/gbfs/validator/api/RestResource.java new file mode 100644 index 0000000..5d5980e --- /dev/null +++ b/api/src/main/java/org/entur/gbfs/validator/api/RestResource.java @@ -0,0 +1,44 @@ +/* + * + * * + * * + * * * Licensed under the EUPL, Version 1.2 or – as soon they will be approved by + * * * the European Commission - subsequent versions of the EUPL (the "Licence"); + * * * You may not use this work except in compliance with the Licence. + * * * You may obtain a copy of the Licence at: + * * * + * * * https://joinup.ec.europa.eu/software/page/eupl + * * * + * * * Unless required by applicable law or agreed to in writing, software + * * * distributed under the Licence is distributed on an "AS IS" basis, + * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * See the Licence for the specific language governing permissions and + * * * limitations under the Licence. + * * + * + */ + +package org.entur.gbfs.validator.api; + +import org.entur.gbfs.validation.GbfsValidator; +import org.entur.gbfs.validation.GbfsValidatorFactory; +import org.entur.gbfs.validation.model.ValidationResult; +import org.entur.gbfs.validator.Loader; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import java.io.InputStream; +import java.util.Map; + +@RestController +public class RestResource { + + @PostMapping(path = "/.netlify/functions/validator") + public ValidationResult validate(@RequestBody ValidationRequest validationRequest) { + Loader loader = new Loader(); + Map fileMap = loader.load(validationRequest.url()); + GbfsValidator validator = GbfsValidatorFactory.getGbfsJsonValidator(); + return validator.validate(fileMap); + } +} diff --git a/api/src/main/java/org/entur/gbfs/validator/api/ValidationRequest.java b/api/src/main/java/org/entur/gbfs/validator/api/ValidationRequest.java new file mode 100644 index 0000000..314dd90 --- /dev/null +++ b/api/src/main/java/org/entur/gbfs/validator/api/ValidationRequest.java @@ -0,0 +1,23 @@ +/* + * + * * + * * + * * * Licensed under the EUPL, Version 1.2 or – as soon they will be approved by + * * * the European Commission - subsequent versions of the EUPL (the "Licence"); + * * * You may not use this work except in compliance with the Licence. + * * * You may obtain a copy of the Licence at: + * * * + * * * https://joinup.ec.europa.eu/software/page/eupl + * * * + * * * Unless required by applicable law or agreed to in writing, software + * * * distributed under the Licence is distributed on an "AS IS" basis, + * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * See the Licence for the specific language governing permissions and + * * * limitations under the Licence. + * * + * + */ + +package org.entur.gbfs.validator.api; + +public record ValidationRequest(String url) {} diff --git a/api/src/main/resources/application.properties b/api/src/main/resources/application.properties new file mode 100644 index 0000000..bbe3a4c --- /dev/null +++ b/api/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.application.name=api diff --git a/api/src/test/java/org/entur/gbfs/validator/api/ApiApplicationTests.java b/api/src/test/java/org/entur/gbfs/validator/api/ApiApplicationTests.java new file mode 100644 index 0000000..82d4ae8 --- /dev/null +++ b/api/src/test/java/org/entur/gbfs/validator/api/ApiApplicationTests.java @@ -0,0 +1,13 @@ +package org.entur.gbfs.validator.api; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class ApiApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/cli/pom.xml b/cli/pom.xml new file mode 100644 index 0000000..b424c00 --- /dev/null +++ b/cli/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + + org.entur.gbfs.validator + cli + 1.0-SNAPSHOT + + cli + + http://www.example.com + + + UTF-8 + 21 + 21 + + + + + org.entur.gbfs.validator + loader + 1.0-SNAPSHOT + + + org.entur.gbfs + gbfs-validator-java + 2.0.0-SNAPSHOT + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-assembly-plugin + 3.1.1 + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + + jar-with-dependencies + + + + true + org.entur.gbfs.validator.Main + + + + + + + make-assembly + package + + single + + + + + + + + diff --git a/cli/src/main/java/org/entur/gbfs/validator/Main.java b/cli/src/main/java/org/entur/gbfs/validator/Main.java new file mode 100644 index 0000000..449f4b2 --- /dev/null +++ b/cli/src/main/java/org/entur/gbfs/validator/Main.java @@ -0,0 +1,56 @@ +package org.entur.gbfs.validator; + +import org.entur.gbfs.validation.GbfsValidatorFactory; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Hello world! + * + */ +public class Main +{ + public static void main( String[] args ) + { + if (args.length < 1) { + printHelp(); + } else { + Map argsMap = new HashMap<>(); + Arrays.stream(args).forEach(arg -> { + var splitArg = arg.split("="); + if (splitArg[0].equals("-u") || splitArg[0].equals("--url")) { + argsMap.put("url", splitArg[1]); + } + }); + + if (!argsMap.containsKey("url")) { + printHelp(); + } + + Loader loader = new Loader(); + var map = loader.load(argsMap.get("url")); + var validator = GbfsValidatorFactory.getGbfsJsonValidator(); + long start = System.currentTimeMillis(); + var result = validator.validate(map); + long finish = System.currentTimeMillis(); + System.out.println(result.summary()); + + long timeElapsed = finish - start; + System.out.println("Execution time validation: " + timeElapsed + "ms"); + } + } + + private static void printHelp() { + System.out.println( + """ + -v, --version: output the version number + -u, --url : URL of the GBFS feed + -vb, --verbose: Verbose mode prints debugging console logs + -s, --save-report : Local path to output report file + -pr, --print-report : Print report to standard output (choices: "yes", "no", default: "yes") + -h, --help: display help for command + """.stripIndent()); + } +} diff --git a/README.md b/gbfs-validator-java/README.md similarity index 100% rename from README.md rename to gbfs-validator-java/README.md diff --git a/bin/gbfs-download-extract.sh b/gbfs-validator-java/bin/gbfs-download-extract.sh similarity index 100% rename from bin/gbfs-download-extract.sh rename to gbfs-validator-java/bin/gbfs-download-extract.sh diff --git a/gbfs-validator-java/pom.xml b/gbfs-validator-java/pom.xml new file mode 100644 index 0000000..b5dc7e9 --- /dev/null +++ b/gbfs-validator-java/pom.xml @@ -0,0 +1,407 @@ + + + 4.0.0 + + org.entur.gbfs + gbfs-validator-java + 2.0.0-SNAPSHOT + + gbfs-validator-java + Validate GBFS feeds + https://github.com/entur/gbfs-validator-java + + Entur AS + http://www.entur.org/ + + + + EUPL-1.2 with modifications + https://joinup.ec.europa.eu/software/page/eupl + repo + + + + + Tom Erik Støwer + tom.erik.stower@entur.org + Entur + http://www.entur.org + + + + scm:git:ssh://git@github.com/entur/gbfs-validator-java.git + scm:git:ssh://git@github.com/entur/gbfs-validator-java.git + https://github.com/entur/gbfs-validator-java/tree/master + HEAD + + + + snapshots + entur2-snapshots + https://entur2.jfrog.io/entur2/libs-snapshot-local + + + + + UTF-8 + 17 + + https://github.com/entur/gbfs-json-schema/archive/refs/tags/v3.0.zip + 3.0 + + 1.14.4 + 1.7.36 + + 0.8.12 + 1.6.13 + 1.6.0 + 2.22.2 + 3.4.1 + 3.3.1 + 3.6.3 + 1.6 + 3.13.0 + 3.4.1 + 3.3.2 + 2.5.2 + 3.12.1 + 3.3.1 + 2.8.2 + 2.12 + 2.15.0 + 2.16.2 + 5.3.2 + 1.13.0 + 1.13.0 + 1.21.0 + + + + + + 3.25.3 + 5.10.2 + + + + + com.github.erosb + everit-json-schema + ${everit-json-schema.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + + + com.jayway.jsonpath + json-path + 2.9.0 + + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.assertj + assertj-core + ${assertj.core.version} + test + + + org.slf4j + slf4j-simple + ${slf4j.version} + test + + + + + + + org.apache.maven.wagon + wagon-ssh-external + 2.12 + + + + + + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + maven-jar-plugin + ${maven-jar-plugin.version} + + + maven-clean-plugin + ${maven-clean-plugin.version} + + + maven-install-plugin + ${maven-install-plugin.version} + + + maven-site-plugin + ${maven-site-plugin.version} + + + maven-resources-plugin + ${maven-resources-plugin.version} + + + maven-deploy-plugin + ${maven-deploy-plugin.version} + + + + + + org.codehaus.mojo + exec-maven-plugin + ${maven-exec-plugin.version} + + + download-extract-current-version + generate-sources + + exec + + + + ${gbfsGithubUrl} + ${schemaVersion} + src/main/resources/schema + + ./bin/gbfs-download-extract.sh + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${jdk.version} + ${jdk.version} + UTF-8 + + + -Xlint:all + + + + + org.codehaus.plexus + plexus-compiler-javac + ${plexus-compiler-javac.version} + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven-enforcer-plugin.version} + + + + enforce + + + + + ${jdk.version} + + + + + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + default-prepare-agent + + prepare-agent + + + + default-report + prepare-package + + report + + + + default-check + + check + + + + + + + + + org.codehaus.mojo + versions-maven-plugin + ${versions-maven-plugin.version} + + + org.owasp + dependency-check-maven + ${dependency-check-maven.version} + + + com.amashchenko.maven.plugin + gitflow-maven-plugin + ${gitflow-maven-plugin.version} + + false + true + [ci skip] + + master + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus-staging-maven-plugin.version} + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + attach-sources + + jar + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + -Xdoclint:none + + + + attach-javadocs + + jar + + + + + + + + + sonar + + false + + + + 3.7.0.1746 + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} + + + + + + release + + false + + + + ossrh + Sonatype release + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + sign-artifacts + + sign + + verify + + ${env.SONATYPE_GPG_KEY_PASSWORD} + + --pinentry-mode + loopback + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + ossrh + https://oss.sonatype.org/ + + true + + + + + + + diff --git a/src/main/java/org/entur/gbfs/validation/GbfsValidator.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/GbfsValidator.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/GbfsValidator.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/GbfsValidator.java diff --git a/src/main/java/org/entur/gbfs/validation/GbfsValidatorFactory.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/GbfsValidatorFactory.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/GbfsValidatorFactory.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/GbfsValidatorFactory.java diff --git a/src/main/java/org/entur/gbfs/validation/model/FileValidationError.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/FileValidationError.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/model/FileValidationError.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/FileValidationError.java diff --git a/src/main/java/org/entur/gbfs/validation/model/FileValidationResult.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/FileValidationResult.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/model/FileValidationResult.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/FileValidationResult.java diff --git a/src/main/java/org/entur/gbfs/validation/model/ValidationResult.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/ValidationResult.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/model/ValidationResult.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/ValidationResult.java diff --git a/src/main/java/org/entur/gbfs/validation/model/ValidationResultComponentIdentity.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/ValidationResultComponentIdentity.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/model/ValidationResultComponentIdentity.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/ValidationResultComponentIdentity.java diff --git a/src/main/java/org/entur/gbfs/validation/model/ValidationSummary.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/ValidationSummary.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/model/ValidationSummary.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/model/ValidationSummary.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/FileValidator.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/FileValidator.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/FileValidator.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/FileValidator.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/GbfsJsonValidator.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/GbfsJsonValidator.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/GbfsJsonValidator.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/GbfsJsonValidator.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/URIFormatValidator.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/URIFormatValidator.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/URIFormatValidator.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/URIFormatValidator.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/rules/CustomRuleSchemaPatcher.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/CustomRuleSchemaPatcher.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/rules/CustomRuleSchemaPatcher.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/CustomRuleSchemaPatcher.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/rules/NoInvalidReferenceToPricingPlansInVehicleTypes.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoInvalidReferenceToPricingPlansInVehicleTypes.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/rules/NoInvalidReferenceToPricingPlansInVehicleTypes.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoInvalidReferenceToPricingPlansInVehicleTypes.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/rules/NoInvalidReferenceToVehicleTypesInStationStatus.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoInvalidReferenceToVehicleTypesInStationStatus.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/rules/NoInvalidReferenceToVehicleTypesInStationStatus.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoInvalidReferenceToVehicleTypesInStationStatus.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingCurrentRangeMetersInVehicleStatusForMotorizedVehicles.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingCurrentRangeMetersInVehicleStatusForMotorizedVehicles.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingCurrentRangeMetersInVehicleStatusForMotorizedVehicles.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingCurrentRangeMetersInVehicleStatusForMotorizedVehicles.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingStoreUriInSystemInformation.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingStoreUriInSystemInformation.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingStoreUriInSystemInformation.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingStoreUriInSystemInformation.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingVehicleTypeIdInVehicleStatusWhenVehicleTypesExist.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingVehicleTypeIdInVehicleStatusWhenVehicleTypesExist.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingVehicleTypeIdInVehicleStatusWhenVehicleTypesExist.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingVehicleTypeIdInVehicleStatusWhenVehicleTypesExist.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingVehicleTypesAvailableWhenVehicleTypesExists.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingVehicleTypesAvailableWhenVehicleTypesExists.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingVehicleTypesAvailableWhenVehicleTypesExists.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/rules/NoMissingVehicleTypesAvailableWhenVehicleTypesExists.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/AbstractVersion.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/AbstractVersion.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/AbstractVersion.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/AbstractVersion.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/Version.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/Version.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/Version10.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version10.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/Version10.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version10.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/Version11.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version11.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/Version11.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version11.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/Version20.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version20.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/Version20.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version20.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/Version21.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version21.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/Version21.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version21.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/Version22.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version22.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/Version22.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version22.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/Version23.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version23.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/Version23.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version23.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/Version30.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version30.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/Version30.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/Version30.java diff --git a/src/main/java/org/entur/gbfs/validation/validator/versions/VersionFactory.java b/gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/VersionFactory.java similarity index 100% rename from src/main/java/org/entur/gbfs/validation/validator/versions/VersionFactory.java rename to gbfs-validator-java/src/main/java/org/entur/gbfs/validation/validator/versions/VersionFactory.java diff --git a/gbfs-validator-java/src/main/resources/schema/README.md b/gbfs-validator-java/src/main/resources/schema/README.md new file mode 100644 index 0000000..cf6cde1 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/README.md @@ -0,0 +1,2 @@ +# gbfs-json-schema +JSON Schema for [General Bikeshare Feed Specification(GBFS)](https://github.com/MobilityData/gbfs/blob/master/gbfs.md) feeds, managed by MobilityData. The [gbfs-validator](https://github.com/MobilityData/gbfs-validator) links directly to them. diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/free_bike_status.json b/gbfs-validator-java/src/main/resources/schema/v1.0/free_bike_status.json new file mode 100644 index 0000000..273d09f --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/free_bike_status.json @@ -0,0 +1,60 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#free_bike_statusjson", + "description": "Describes the vehicles that are available for rent (as of v2.1-RC2).", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + } + }, + "required": ["bike_id", "lat", "lon", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/gbfs.json b/gbfs-validator-java/src/main/resources/schema/v1.0/gbfs.json new file mode 100644 index 0000000..28aedb6 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/gbfs.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#gbfsjson", + "description": "Auto-discovery file that links to all of the other files published by the system.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-zA-Z]{2}$": { + "type": "object", + "properties": { + "feeds": { + "description": "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": ["name", "url"] + } + } + }, + "required": ["feeds"] + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/station_information.json b/gbfs-validator-java/src/main/resources/schema/v1.0/station_information.json new file mode 100644 index 0000000..0b16d81 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/station_information.json @@ -0,0 +1,98 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#station_informationjson", + "description": "List of all stations, their capacities and locations. REQUIRED of systems utilizing docks.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": "Cross street or landmark…the station is located.", + "type": "string" + }, + "region_id": { + "description": "Identifier of the region…the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "KEY", + "CREDITCARD", + "PAYPASS", + "APPLEPAY", + "ANDROIDPAY", + "TRANSITCARD", + "ACCOUNTNUMBER", + "PHONE" + ] + } + }, + "capacity": { + "description": "Number of total docking …ilable and unavailable.", + "type": "integer", + "minimum": 0 + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/station_status.json b/gbfs-validator-java/src/main/resources/schema/v1.0/station_status.json new file mode 100644 index 0000000..86c75ff --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/station_status.json @@ -0,0 +1,84 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#station_statusjson", + "description": "Describes the capacity and rental availability of the station", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "num_bikes_disabled": { + "description": "Number of disabled vehic…ny type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": "Number of functional doc…sically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + }, + "last_reported": { + "description": "The last time this station reported its status to the operator's backend in POSIX time.", + "type": "number" + } + }, + "required": [ + "station_id", + "num_bikes_available", + "num_docks_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/system_alerts.json b/gbfs-validator-java/src/main/resources/schema/v1.0/system_alerts.json new file mode 100644 index 0000000..c005ee8 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/system_alerts.json @@ -0,0 +1,101 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "SYSTEM_CLOSURE", + "STATION_CLOSURE", + "STATION_MOVE", + "OTHER" + ] + }, + "times": { + "description": "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "type": "number", + "minimum": 0 + }, + "end": { + "type": "number", + "minimum": 0 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": "URL where the customer can learn more information about this alert.", + "type": "string" + }, + "summary": { + "description": "A short summary of this …played to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": "Indicates the last time the info for the alert was updated.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/system_calendar.json b/gbfs-validator-java/src/main/resources/schema/v1.0/system_calendar.json new file mode 100644 index 0000000..89cbffe --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/system_calendar.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Array that contains operations calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + }, + "minItems": 1 + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/system_hours.json b/gbfs-validator-java/src/main/resources/schema/v1.0/system_hours.json new file mode 100644 index 0000000..66e75b6 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/system_hours.json @@ -0,0 +1,62 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_type": { + "description": "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + } + }, + "days": { + "description": "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] + } + }, + "start_time": { + "description": "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^[0-9]{2}:[0-9]{2}:[0-9]{2}$" + }, + "end_time": { + "description": "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^[0-9]{2}:[0-9]{2}:[0-9]{2}$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/system_information.json b/gbfs-validator-java/src/main/resources/schema/v1.0/system_information.json new file mode 100644 index 0000000..8ab0516 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/system_information.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#system_informationjson", + "description": "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2}$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "format": "date" + }, + "phone_number": { + "description": "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": "Email address actively monitored by the operator's customer service department.", + "type": "string" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string" + }, + "license_url": { + "description": "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string" + } + }, + "required": ["system_id", "language", "name", "timezone"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/system_pricing_plans.json b/gbfs-validator-java/src/main/resources/schema/v1.0/system_pricing_plans.json new file mode 100644 index 0000000..d0e3dd1 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/system_pricing_plans.json @@ -0,0 +1,73 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": "URL where the customer c…bout this pricing plan.", + "type": "string" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "minLength": 3, + "maxLength": 3 + }, + "price": { + "description": "Fare price.", + "type": "number" + }, + "is_taxable": { + "description": "Will additional tax be added to the base price?", + "type": ["number"] + }, + "description": { + "description": "Customer-readable description of the pricing plan.", + "type": "string" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.0/system_regions.json b/gbfs-validator-java/src/main/resources/schema/v1.0/system_regions.json new file mode 100644 index 0000000..bc4d796 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.0/system_regions.json @@ -0,0 +1,45 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#system_regionsjson", + "description": "Describes regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/free_bike_status.json b/gbfs-validator-java/src/main/resources/schema/v1.1/free_bike_status.json new file mode 100644 index 0000000..6d0fafa --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/free_bike_status.json @@ -0,0 +1,99 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are not at a station and are available for rent.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": + "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + } + } + } + }, + "required": ["bike_id", "lat", "lon", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/gbfs.json b/gbfs-validator-java/src/main/resources/schema/v1.1/gbfs.json new file mode 100644 index 0000000..e3bbc61 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/gbfs.json @@ -0,0 +1,76 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files publiished by the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-z]{2,3}(-[A-Z]{2})?$": { + "type": "object", + "properties": { + "feeds": { + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "station_information", + "station_status", + "free_bike_status", + "system_hours", + "system_alerts", + "system_calendar", + "system_regions", + "system_pricing_plans" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + } + } + }, + "required": ["feeds"] + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/gbfs_versions.json b/gbfs-validator-java/src/main/resources/schema/v1.1/gbfs_versions.json new file mode 100644 index 0000000..c92a9de --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/gbfs_versions.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#gbfs_versionsjson-added-in-v11", + "description": + "Lists all feed endpoints published according to version sof the GBFS documentation. (added in v1.1)", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "versions": { + "description": + "Contains one object, as defined below, for each of the available versions of a feed. The array must be sorted by increasing MAJOR and MINOR version number.", + "type": "array", + "items": { + "type": "object", + "properties": { + "version": { + "description": + "The semantic version of the feed in the form X.Y", + "type": "string", + "enum": [ + "1.0", + "1.1", + "2.0", + "2.1", + "2.2", + "2.3", + "3.0" + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": ["version", "url"] + } + } + }, + "required": ["versions"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/station_information.json b/gbfs-validator-java/src/main/resources/schema/v1.1/station_information.json new file mode 100644 index 0000000..5effc94 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/station_information.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#station_informationjson", + "description": + "List of all stations, their capacities and locations. REQUIRED of systems utilizing docks.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "KEY", + "CREDITCARD", + "PAYPASS", + "APPLEPAY", + "ANDROIDPAY", + "TRANSITCARD", + "ACCOUNTNUMBER", + "PHONE" + ] + }, + "minItems": 1 + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this station (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting a vehicle at this station (added in v1.1).", + "type": "string", + "format": "uri" + } + } + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/station_status.json b/gbfs-validator-java/src/main/resources/schema/v1.1/station_status.json new file mode 100644 index 0000000..444d89f --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/station_status.json @@ -0,0 +1,105 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availablility of the station", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": [ + "station_id", + "num_bikes_available", + "num_docks_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/system_alerts.json b/gbfs-validator-java/src/main/resources/schema/v1.1/system_alerts.json new file mode 100644 index 0000000..9523d70 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/system_alerts.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "SYSTEM_CLOSURE", + "STATION_CLOSURE", + "STATION_MOVE", + "OTHER" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the alert.", + "type": "number", + "minimum": 1450155600 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "string", + "format": "uri" + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/system_calendar.json b/gbfs-validator-java/src/main/resources/schema/v1.1/system_calendar.json new file mode 100644 index 0000000..68f2cd8 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/system_calendar.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Array that contains opertions calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + } + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/system_hours.json b/gbfs-validator-java/src/main/resources/schema/v1.1/system_hours.json new file mode 100644 index 0000000..0c22de8 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/system_information.json b/gbfs-validator-java/src/main/resources/schema/v1.1/system_information.json new file mode 100644 index 0000000..24e6b06 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/system_information.json @@ -0,0 +1,148 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "format": "date" + }, + "phone_number": { + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string" + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + } + } + } + }, + "required": ["system_id", "language", "name", "timezone"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/system_pricing_plans.json b/gbfs-validator-java/src/main/resources/schema/v1.1/system_pricing_plans.json new file mode 100644 index 0000000..15d84d0 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/system_pricing_plans.json @@ -0,0 +1,89 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v1.1/system_regions.json b/gbfs-validator-java/src/main/resources/schema/v1.1/system_regions.json new file mode 100644 index 0000000..e5ea55b --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v1.1/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/free_bike_status.json b/gbfs-validator-java/src/main/resources/schema/v2.0/free_bike_status.json new file mode 100644 index 0000000..15572b4 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/free_bike_status.json @@ -0,0 +1,95 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are not at a station and are available for rent.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": + "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "boolean" + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "boolean" + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + } + } + } + }, + "required": ["bike_id", "lat", "lon", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/gbfs.json b/gbfs-validator-java/src/main/resources/schema/v2.0/gbfs.json new file mode 100644 index 0000000..b46dfb7 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/gbfs.json @@ -0,0 +1,76 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files publiished by the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-z]{2,3}(-[A-Z]{2})?$": { + "type": "object", + "properties": { + "feeds": { + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "station_information", + "station_status", + "free_bike_status", + "system_hours", + "system_alerts", + "system_calendar", + "system_regions", + "system_pricing_plans" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + } + } + }, + "required": ["feeds"] + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/gbfs_versions.json b/gbfs-validator-java/src/main/resources/schema/v2.0/gbfs_versions.json new file mode 100644 index 0000000..40fc7a2 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/gbfs_versions.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#gbfs_versionsjson-added-in-v11", + "description": + "Lists all feed endpoints published according to version sof the GBFS documentation. (added in v1.1)", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "versions": { + "description": + "Contains one object, as defined below, for each of the available versions of a feed. The array must be sorted by increasing MAJOR and MINOR version number.", + "type": "array", + "items": { + "type": "object", + "properties": { + "version": { + "description": + "The semantic version of the feed in the form X.Y", + "type": "string", + "enum": [ + "1.0", + "1.1", + "2.0", + "2.1", + "2.2", + "2.3", + "3.0" + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": ["version", "url"] + } + } + }, + "required": ["versions"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/station_information.json b/gbfs-validator-java/src/main/resources/schema/v2.0/station_information.json new file mode 100644 index 0000000..1d1cbfd --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/station_information.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#station_informationjson", + "description": + "List of all stations, their capacities and locations. REQUIRED of systems utilizing docks.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "KEY", + "CREDITCARD", + "PAYPASS", + "APPLEPAY", + "ANDROIDPAY", + "TRANSITCARD", + "ACCOUNTNUMBER", + "PHONE" + ] + }, + "minItems": 1 + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this station (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting a vehicle at this station (added in v1.1).", + "type": "string", + "format": "uri" + } + } + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/station_status.json b/gbfs-validator-java/src/main/resources/schema/v2.0/station_status.json new file mode 100644 index 0000000..ca60f84 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/station_status.json @@ -0,0 +1,98 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availablility of the station", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "boolean" + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "boolean" + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "boolean" + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": [ + "station_id", + "num_bikes_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/system_alerts.json b/gbfs-validator-java/src/main/resources/schema/v2.0/system_alerts.json new file mode 100644 index 0000000..68f40b8 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/system_alerts.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "SYSTEM_CLOSURE", + "STATION_CLOSURE", + "STATION_MOVE", + "OTHER" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the alert.", + "type": "number", + "minimum": 1450155600 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "string", + "format": "uri" + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/system_calendar.json b/gbfs-validator-java/src/main/resources/schema/v2.0/system_calendar.json new file mode 100644 index 0000000..96a497e --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/system_calendar.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Array that contains opertions calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + } + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/system_hours.json b/gbfs-validator-java/src/main/resources/schema/v2.0/system_hours.json new file mode 100644 index 0000000..87f85df --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/system_information.json b/gbfs-validator-java/src/main/resources/schema/v2.0/system_information.json new file mode 100644 index 0000000..23dbadb --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/system_information.json @@ -0,0 +1,527 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "format": "date" + }, + "phone_number": { + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Algiers", + "Africa/Bissau", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/El_Aaiun", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Khartoum", + "Africa/Lagos", + "Africa/Maputo", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Sao_Tome", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Asuncion", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Cayenne", + "America/Chicago", + "America/Chihuahua", + "America/Costa_Rica", + "America/Cuiaba", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Fort_Nelson", + "America/Fortaleza", + "America/Glace_Bay", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port-au-Prince", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Sitka", + "America/St_Johns", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Vancouver", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/Troll", + "Antarctica/Vostok", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Colombo", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kathmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Riyadh", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ulaanbaatar", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faroe", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/Stanley", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/Perth", + "Australia/Sydney", + "CET", + "CST6CDT", + "EET", + "EST", + "EST5EDT", + "Etc/GMT", + "Etc/GMT-1", + "Etc/GMT-10", + "Etc/GMT-11", + "Etc/GMT-12", + "Etc/GMT-13", + "Etc/GMT-14", + "Etc/GMT-2", + "Etc/GMT-3", + "Etc/GMT-4", + "Etc/GMT-5", + "Etc/GMT-6", + "Etc/GMT-7", + "Etc/GMT-8", + "Etc/GMT-9", + "Etc/GMT+1", + "Etc/GMT+10", + "Etc/GMT+11", + "Etc/GMT+12", + "Etc/GMT+2", + "Etc/GMT+3", + "Etc/GMT+4", + "Etc/GMT+5", + "Etc/GMT+6", + "Etc/GMT+7", + "Etc/GMT+8", + "Etc/GMT+9", + "Etc/UTC", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Helsinki", + "Europe/Istanbul", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Lisbon", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Oslo", + "Europe/Paris", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zaporozhye", + "Europe/Zurich", + "HST", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Reunion", + "MET", + "MST", + "MST7MDT", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Wake", + "Pacific/Wallis", + "PST8PDT", + "WET" + ] + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + } + } + } + }, + "required": ["system_id", "language", "name", "timezone"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/system_pricing_plans.json b/gbfs-validator-java/src/main/resources/schema/v2.0/system_pricing_plans.json new file mode 100644 index 0000000..efba71f --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/system_pricing_plans.json @@ -0,0 +1,87 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "boolean" + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.0/system_regions.json b/gbfs-validator-java/src/main/resources/schema/v2.0/system_regions.json new file mode 100644 index 0000000..361eb7d --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.0/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.0/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/free_bike_status.json b/gbfs-validator-java/src/main/resources/schema/v2.1/free_bike_status.json new file mode 100644 index 0000000..1a242b4 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/free_bike_status.json @@ -0,0 +1,135 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are available for rent (as of v2.1-RC2).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": + "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "boolean" + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "boolean" + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + } + } + }, + "vehicle_type_id": { + "description": + "The vehicle_type_id of this vehicle (added in v2.1-RC).", + "type": "string" + }, + "last_reported": { + "description": + "The last time this vehicle reported its status to the operator's backend in POSIX time (added in v2.1-RC).", + "type": "number", + "minimum": 1450155600 + }, + "current_range_meters": { + "description": + "The furthest distance in meters that the vehicle can travel without recharging or refueling with the vehicle's current charge or fuel (added in v2.1-RC).", + "type": "number", + "minimum": 0 + }, + "station_id": { + "description": + "Identifier referencing the station_id if the vehicle is currently at a station (added in v2.1-RC2).", + "type": "string" + } + }, + "anyOf": [ + { + "required": ["lat", "lon"], + "errorMessage": "Both 'lat' and 'lon' are required." + }, + { + "required": ["station_id"], + "properties": { + "lat": { + "not": {} + }, + "lon": { + "not": {} + } + }, + "errorMessage": "'station_id' is required if 'lat' and 'lon' are not present." + } + ], + "required": ["bike_id", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/gbfs.json b/gbfs-validator-java/src/main/resources/schema/v2.1/gbfs.json new file mode 100644 index 0000000..ce487bc --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/gbfs.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files published by the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-z]{2,3}(-[A-Z]{2})?$": { + "type": "object", + "properties": { + "feeds": { + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "vehicle_types", + "station_information", + "station_status", + "free_bike_status", + "system_hours", + "system_alerts", + "system_calendar", + "system_regions", + "system_pricing_plans", + "geofencing_zones" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + } + } + }, + "required": ["feeds"] + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/gbfs_versions.json b/gbfs-validator-java/src/main/resources/schema/v2.1/gbfs_versions.json new file mode 100644 index 0000000..10582ba --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/gbfs_versions.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#gbfs_versionsjson-added-in-v11", + "description": + "Lists all feed endpoints published according to version sof the GBFS documentation. (added in v1.1)", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "versions": { + "description": + "Contains one object, as defined below, for each of the available versions of a feed. The array must be sorted by increasing MAJOR and MINOR version number.", + "type": "array", + "items": { + "type": "object", + "properties": { + "version": { + "description": + "The semantic version of the feed in the form X.Y", + "type": "string", + "enum": [ + "1.0", + "1.1", + "2.0", + "2.1", + "2.2", + "2.3", + "3.0" + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": ["version", "url"] + } + } + }, + "required": ["versions"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/geofencing_zones.json b/gbfs-validator-java/src/main/resources/schema/v2.1/geofencing_zones.json new file mode 100644 index 0000000..6ce15de --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/geofencing_zones.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#geofencing_zonesjson", + "description": + "Describes geofencing zones and their associated rules and attributes (added in v2.1-RC).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.1" + }, + "data": { + "description": + "Array that contains geofencing information for the system.", + "type": "object", + "properties": { + "geofencing_zones": { + "type": "object", + "description": + "Each geofenced zone and its associated rules and attributes is described as an object within the array of features.", + "properties": { + "type": { + "description": "FeatureCollection as per IETF RFC 7946.", + "type": "string", + "enum": ["FeatureCollection"] + }, + "features": { + "description": "Array of objects.", + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["Feature"] + }, + "properties": { + "description": + "Describing travel allowances and limitations.", + "type": "object", + "properties": { + "name": { + "description": "Public name of the geofencing zone.", + "type": "string" + }, + "start": { + "description": + "Start time of the geofencing zone in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": + "End time of the geofencing zone in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "rules": { + "description": + "Array that contains one object per rule.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "type": "array", + "description": + "Array of vehicle type IDs for which these restrictions apply.", + "items": { "type": "string" } + }, + "ride_allowed": { + "description": + "Is the undocked ride allowed to stat and end in this zone?", + "type": "boolean" + }, + "ride_through_allowed": { + "description": + "Is the ride allowed to travel through this zone?", + "type": "boolean" + }, + "maximum_speed_kph": { + "description": + "What is the maximum speed allowed, in kilometers per hour?", + "type": "integer", + "minimum": 0 + } + }, + "required": ["ride_allowed", "ride_through_allowed"] + } + } + } + }, + "geometry": { + "description": + "A polygon that describes where rides might not be able to start, end, go through, or have other limitations. Must follow the right-hand rule.", + "title": "GeoJSON MultiPolygon", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + }, + "required": ["type", "coordinates"] + } + }, + "required": ["type", "geometry", "properties"] + } + } + }, + "required": ["type", "features"] + } + }, + "required": ["geofencing_zones"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/station_information.json b/gbfs-validator-java/src/main/resources/schema/v2.1/station_information.json new file mode 100644 index 0000000..3548e76 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/station_information.json @@ -0,0 +1,192 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#station_informationjson", + "description": + "List of all stations, their capacities and locations. REQUIRED of systems utilizing docks.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "key", + "creditcard", + "paypass", + "applepay", + "androidpay", + "transitcard", + "accountnumber", + "phone" + ] + }, + "minItems": 1 + }, + "is_virtual_station": { + "description": + "Is this station a location with or without physical infrastructure? (added in v2.1-RC)", + "type": "boolean" + }, + "station_area": { + "description": + "A multipolygon that describes the area of a virtual station (added in v2.1-RC).", + "type": "object", + "required": ["type", "coordinates"], + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + } + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "vehicle_capacity": { + "description": + "An object where each key is a vehicle_type_id and the value is a number presenting the total number of vehicles of this type that can park within the station_area (added in v2.1-RC).", + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "is_valet_station": { + "description": + "Are valet services provided at this station? (added in v2.1-RC)", + "type": "boolean" + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this station (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting a vehicle at this station (added in v1.1).", + "type": "string", + "format": "uri" + } + } + }, + "vehicle_type_capacity": { + "description": + "An object where each key is a vehicle_type_id and the value is a number representing the total docking points installed at this station for each vehicle type (added in v2.1-RC).", + "type": "object", + "additionalProperties": { + "type": "number" + } + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/station_status.json b/gbfs-validator-java/src/main/resources/schema/v2.1/station_status.json new file mode 100644 index 0000000..a2a8bfa --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/station_status.json @@ -0,0 +1,145 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availability of the station", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "vehicle_types_available": { + "description": + "Array of objects displaying the total number of each vehicle type at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": + "The vehicle_type_id of vehicle at the station (added in v2.1-RC).", + "type": "string" + }, + "count": { + "description": + "A number representing the total amount of this vehicle type at the station (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_id", "count"] + } + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "boolean" + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "boolean" + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "boolean" + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "vehicle_docks_available": { + "description": + "Object displaying available docks by vehicle type (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "description": + "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "description": + "A number representing the total number of available docks for the defined vehicle type (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_ids", "count"] + } + } + }, + "required": [ + "station_id", + "num_bikes_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/system_alerts.json b/gbfs-validator-java/src/main/resources/schema/v2.1/system_alerts.json new file mode 100644 index 0000000..58b9c5f --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/system_alerts.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "system_closure", + "station_closure", + "station_move", + "other" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the alert.", + "type": "number", + "minimum": 1450155600 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "string", + "format": "uri" + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/system_calendar.json b/gbfs-validator-java/src/main/resources/schema/v2.1/system_calendar.json new file mode 100644 index 0000000..ec418e2 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/system_calendar.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Array that contains opertions calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + } + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/system_hours.json b/gbfs-validator-java/src/main/resources/schema/v2.1/system_hours.json new file mode 100644 index 0000000..1a68e0a --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/system_information.json b/gbfs-validator-java/src/main/resources/schema/v2.1/system_information.json new file mode 100644 index 0000000..79d5f34 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/system_information.json @@ -0,0 +1,527 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "format": "date" + }, + "phone_number": { + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Algiers", + "Africa/Bissau", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/El_Aaiun", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Khartoum", + "Africa/Lagos", + "Africa/Maputo", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Sao_Tome", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Asuncion", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Cayenne", + "America/Chicago", + "America/Chihuahua", + "America/Costa_Rica", + "America/Cuiaba", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Fort_Nelson", + "America/Fortaleza", + "America/Glace_Bay", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port-au-Prince", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Sitka", + "America/St_Johns", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Vancouver", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/Troll", + "Antarctica/Vostok", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Colombo", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kathmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Riyadh", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ulaanbaatar", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faroe", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/Stanley", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/Perth", + "Australia/Sydney", + "CET", + "CST6CDT", + "EET", + "EST", + "EST5EDT", + "Etc/GMT", + "Etc/GMT-1", + "Etc/GMT-10", + "Etc/GMT-11", + "Etc/GMT-12", + "Etc/GMT-13", + "Etc/GMT-14", + "Etc/GMT-2", + "Etc/GMT-3", + "Etc/GMT-4", + "Etc/GMT-5", + "Etc/GMT-6", + "Etc/GMT-7", + "Etc/GMT-8", + "Etc/GMT-9", + "Etc/GMT+1", + "Etc/GMT+10", + "Etc/GMT+11", + "Etc/GMT+12", + "Etc/GMT+2", + "Etc/GMT+3", + "Etc/GMT+4", + "Etc/GMT+5", + "Etc/GMT+6", + "Etc/GMT+7", + "Etc/GMT+8", + "Etc/GMT+9", + "Etc/UTC", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Helsinki", + "Europe/Istanbul", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Lisbon", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Oslo", + "Europe/Paris", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zaporozhye", + "Europe/Zurich", + "HST", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Reunion", + "MET", + "MST", + "MST7MDT", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Wake", + "Pacific/Wallis", + "PST8PDT", + "WET" + ] + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + } + } + } + }, + "required": ["system_id", "language", "name", "timezone"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/system_pricing_plans.json b/gbfs-validator-java/src/main/resources/schema/v2.1/system_pricing_plans.json new file mode 100644 index 0000000..0ac1e6e --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/system_pricing_plans.json @@ -0,0 +1,87 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "boolean" + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/system_regions.json b/gbfs-validator-java/src/main/resources/schema/v2.1/system_regions.json new file mode 100644 index 0000000..dd850ae --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.1/vehicle_types.json b/gbfs-validator-java/src/main/resources/schema/v2.1/vehicle_types.json new file mode 100644 index 0000000..aad4542 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.1/vehicle_types.json @@ -0,0 +1,82 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.1/gbfs.md#vehicle_typesjson-added-in-v21", + "description": + "Describes the types of vehicles that System operator has available for rent (added in v2.1-RC).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "vehicle_types": { + "description": + "Array that contains one object per vehicle type in the system as defined below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": "Unique identifier of a vehicle type.", + "type": "string" + }, + "form_factor": { + "description": "The vehicle's general form factor.", + "type": "string", + "enum": ["bicycle", "car", "moped", "other", "scooter"] + }, + "propulsion_type": { + "description": "The primary propulsion type of the vehicle.", + "type": "string", + "enum": ["human", "electric_assist", "electric", "combustion"] + }, + "max_range_meters": { + "description": + "The furthest distance in meters that the vehicle can travel without recharging or refueling when it has the maximum amount of energy potential.", + "type": "number", + "minimum": 0 + }, + "name": { + "description": "The public name of this vehicle type.", + "type": "string" + } + }, + "required": ["vehicle_type_id", "form_factor", "propulsion_type"], + "if": { + "properties": { + "propulsion_type": { + "enum": ["electric", "electric_assist", "combustion"] + } + }, + "required": ["propulsion_type"] + }, + "then": { + "required": ["max_range_meters"] + } + } + } + }, + "required": ["vehicle_types"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/free_bike_status.json b/gbfs-validator-java/src/main/resources/schema/v2.2/free_bike_status.json new file mode 100644 index 0000000..6e80951 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/free_bike_status.json @@ -0,0 +1,140 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are available for rent (as of v2.1-RC2).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": + "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "boolean" + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "boolean" + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + } + } + }, + "vehicle_type_id": { + "description": + "The vehicle_type_id of this vehicle (added in v2.1-RC).", + "type": "string" + }, + "last_reported": { + "description": + "The last time this vehicle reported its status to the operator's backend in POSIX time (added in v2.1-RC).", + "type": "number", + "minimum": 1450155600 + }, + "current_range_meters": { + "description": + "The furthest distance in meters that the vehicle can travel without recharging or refueling with the vehicle's current charge or fuel (added in v2.1-RC).", + "type": "number", + "minimum": 0 + }, + "station_id": { + "description": + "Identifier referencing the station_id if the vehicle is currently at a station (added in v2.1-RC2).", + "type": "string" + }, + "pricing_plan_id": { + "description": + "The plan_id of the pricing plan this vehicle is eligible for (added in v2.1-RC2).", + "type": "string" + } + }, + "anyOf": [ + { + "required": ["lat", "lon"], + "errorMessage": "Both 'lat' and 'lon' are required." + }, + { + "required": ["station_id"], + "properties": { + "lat": { + "not": {} + }, + "lon": { + "not": {} + } + }, + "errorMessage": "'station_id' is required if 'lat' and 'lon' are not present." + } + ], + "required": ["bike_id", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/gbfs.json b/gbfs-validator-java/src/main/resources/schema/v2.2/gbfs.json new file mode 100644 index 0000000..8c3aa98 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/gbfs.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files published by the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-z]{2,3}(-[A-Z]{2})?$": { + "type": "object", + "properties": { + "feeds": { + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "vehicle_types", + "station_information", + "station_status", + "free_bike_status", + "system_hours", + "system_alerts", + "system_calendar", + "system_regions", + "system_pricing_plans", + "geofencing_zones" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + } + } + }, + "required": ["feeds"] + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/gbfs_versions.json b/gbfs-validator-java/src/main/resources/schema/v2.2/gbfs_versions.json new file mode 100644 index 0000000..e5d34b0 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/gbfs_versions.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#gbfs_versionsjson-added-in-v11", + "description": + "Lists all feed endpoints published according to version sof the GBFS documentation. (added in v1.1)", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "versions": { + "description": + "Contains one object, as defined below, for each of the available versions of a feed. The array must be sorted by increasing MAJOR and MINOR version number.", + "type": "array", + "items": { + "type": "object", + "properties": { + "version": { + "description": + "The semantic version of the feed in the form X.Y", + "type": "string", + "enum": [ + "1.0", + "1.1", + "2.0", + "2.1", + "2.2", + "2.3", + "3.0" + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": ["version", "url"] + } + } + }, + "required": ["versions"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/geofencing_zones.json b/gbfs-validator-java/src/main/resources/schema/v2.2/geofencing_zones.json new file mode 100644 index 0000000..f9a9476 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/geofencing_zones.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#geofencing_zonesjson", + "description": + "Describes geofencing zones and their associated rules and attributes (added in v2.1-RC).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.2" + }, + "data": { + "description": + "Array that contains geofencing information for the system.", + "type": "object", + "properties": { + "geofencing_zones": { + "type": "object", + "description": + "Each geofenced zone and its associated rules and attributes is described as an object within the array of features.", + "properties": { + "type": { + "description": "FeatureCollection as per IETF RFC 7946.", + "type": "string", + "enum": ["FeatureCollection"] + }, + "features": { + "description": "Array of objects.", + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["Feature"] + }, + "properties": { + "description": + "Describing travel allowances and limitations.", + "type": "object", + "properties": { + "name": { + "description": "Public name of the geofencing zone.", + "type": "string" + }, + "start": { + "description": + "Start time of the geofencing zone in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": + "End time of the geofencing zone in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "rules": { + "description": + "Array that contains one object per rule.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "type": "array", + "description": + "Array of vehicle type IDs for which these restrictions apply.", + "items": { "type": "string" } + }, + "ride_allowed": { + "description": + "Is the undocked ride allowed to stat and end in this zone?", + "type": "boolean" + }, + "ride_through_allowed": { + "description": + "Is the ride allowed to travel through this zone?", + "type": "boolean" + }, + "maximum_speed_kph": { + "description": + "What is the maximum speed allowed, in kilometers per hour?", + "type": "integer", + "minimum": 0 + } + }, + "required": ["ride_allowed", "ride_through_allowed"] + } + } + } + }, + "geometry": { + "description": + "A polygon that describes where rides might not be able to start, end, go through, or have other limitations. Must follow the right-hand rule.", + "title": "GeoJSON MultiPolygon", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + }, + "required": ["type", "coordinates"] + } + }, + "required": ["type", "geometry", "properties"] + } + } + }, + "required": ["type", "features"] + } + }, + "required": ["geofencing_zones"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/station_information.json b/gbfs-validator-java/src/main/resources/schema/v2.2/station_information.json new file mode 100644 index 0000000..4df11e2 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/station_information.json @@ -0,0 +1,192 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#station_informationjson", + "description": + "List of all stations, their capacities and locations. REQUIRED of systems utilizing docks.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "key", + "creditcard", + "paypass", + "applepay", + "androidpay", + "transitcard", + "accountnumber", + "phone" + ] + }, + "minItems": 1 + }, + "is_virtual_station": { + "description": + "Is this station a location with or without physical infrastructure? (added in v2.1-RC)", + "type": "boolean" + }, + "station_area": { + "description": + "A multipolygon that describes the area of a virtual station (added in v2.1-RC).", + "type": "object", + "required": ["type", "coordinates"], + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + } + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "vehicle_capacity": { + "description": + "An object where each key is a vehicle_type_id and the value is a number presenting the total number of vehicles of this type that can park within the station_area (added in v2.1-RC).", + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "is_valet_station": { + "description": + "Are valet services provided at this station? (added in v2.1-RC)", + "type": "boolean" + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this station (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting a vehicle at this station (added in v1.1).", + "type": "string", + "format": "uri" + } + } + }, + "vehicle_type_capacity": { + "description": + "An object where each key is a vehicle_type_id and the value is a number representing the total docking points installed at this station for each vehicle type (added in v2.1-RC).", + "type": "object", + "additionalProperties": { + "type": "number" + } + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/station_status.json b/gbfs-validator-java/src/main/resources/schema/v2.2/station_status.json new file mode 100644 index 0000000..f94fb2c --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/station_status.json @@ -0,0 +1,145 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availability of the station", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "vehicle_types_available": { + "description": + "Array of objects displaying the total number of each vehicle type at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": + "The vehicle_type_id of vehicle at the station (added in v2.1-RC).", + "type": "string" + }, + "count": { + "description": + "A number representing the total amount of this vehicle type at the station (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_id", "count"] + } + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "boolean" + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "boolean" + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "boolean" + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "vehicle_docks_available": { + "description": + "Object displaying available docks by vehicle type (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "description": + "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "description": + "A number representing the total number of available docks for the defined vehicle type (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_ids", "count"] + } + } + }, + "required": [ + "station_id", + "num_bikes_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/system_alerts.json b/gbfs-validator-java/src/main/resources/schema/v2.2/system_alerts.json new file mode 100644 index 0000000..a885ea1 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/system_alerts.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "system_closure", + "station_closure", + "station_move", + "other" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the alert.", + "type": "number", + "minimum": 1450155600 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "string", + "format": "uri" + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/system_calendar.json b/gbfs-validator-java/src/main/resources/schema/v2.2/system_calendar.json new file mode 100644 index 0000000..d6ebc86 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/system_calendar.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Array that contains opertions calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + } + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/system_hours.json b/gbfs-validator-java/src/main/resources/schema/v2.2/system_hours.json new file mode 100644 index 0000000..85997bd --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/system_information.json b/gbfs-validator-java/src/main/resources/schema/v2.2/system_information.json new file mode 100644 index 0000000..8f99c47 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/system_information.json @@ -0,0 +1,527 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "format": "date" + }, + "phone_number": { + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Algiers", + "Africa/Bissau", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/El_Aaiun", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Khartoum", + "Africa/Lagos", + "Africa/Maputo", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Sao_Tome", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Asuncion", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Cayenne", + "America/Chicago", + "America/Chihuahua", + "America/Costa_Rica", + "America/Cuiaba", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Fort_Nelson", + "America/Fortaleza", + "America/Glace_Bay", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port-au-Prince", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Sitka", + "America/St_Johns", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Vancouver", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/Troll", + "Antarctica/Vostok", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Colombo", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kathmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Riyadh", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ulaanbaatar", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faroe", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/Stanley", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/Perth", + "Australia/Sydney", + "CET", + "CST6CDT", + "EET", + "EST", + "EST5EDT", + "Etc/GMT", + "Etc/GMT-1", + "Etc/GMT-10", + "Etc/GMT-11", + "Etc/GMT-12", + "Etc/GMT-13", + "Etc/GMT-14", + "Etc/GMT-2", + "Etc/GMT-3", + "Etc/GMT-4", + "Etc/GMT-5", + "Etc/GMT-6", + "Etc/GMT-7", + "Etc/GMT-8", + "Etc/GMT-9", + "Etc/GMT+1", + "Etc/GMT+10", + "Etc/GMT+11", + "Etc/GMT+12", + "Etc/GMT+2", + "Etc/GMT+3", + "Etc/GMT+4", + "Etc/GMT+5", + "Etc/GMT+6", + "Etc/GMT+7", + "Etc/GMT+8", + "Etc/GMT+9", + "Etc/UTC", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Helsinki", + "Europe/Istanbul", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Lisbon", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Oslo", + "Europe/Paris", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zaporozhye", + "Europe/Zurich", + "HST", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Reunion", + "MET", + "MST", + "MST7MDT", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Wake", + "Pacific/Wallis", + "PST8PDT", + "WET" + ] + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + } + } + } + }, + "required": ["system_id", "language", "name", "timezone"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/system_pricing_plans.json b/gbfs-validator-java/src/main/resources/schema/v2.2/system_pricing_plans.json new file mode 100644 index 0000000..cbf797c --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/system_pricing_plans.json @@ -0,0 +1,160 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "boolean" + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + }, + "per_km_pricing": { + "description": + "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of kilometers that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each kilometer interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "description": + "Interval in kilometers at which the rate of this segment is either reapplied indefinitely, or if defined, up until (but not including) end kilometer (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The kilometer at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["start", "rate", "interval"] + } + }, + "per_min_pricing": { + "description": + "Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of minutes that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each minute interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "description": + "Interval in minutes at which the rate of this segment is either reapplied (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The minute at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["start", "rate", "interval"] + } + }, + "surge_pricing": { + "description": + "Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)", + "type": "boolean" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/system_regions.json b/gbfs-validator-java/src/main/resources/schema/v2.2/system_regions.json new file mode 100644 index 0000000..23e66b4 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.2/vehicle_types.json b/gbfs-validator-java/src/main/resources/schema/v2.2/vehicle_types.json new file mode 100644 index 0000000..2878136 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.2/vehicle_types.json @@ -0,0 +1,82 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#vehicle_typesjson-added-in-v21", + "description": + "Describes the types of vehicles that System operator has available for rent (added in v2.1-RC).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "vehicle_types": { + "description": + "Array that contains one object per vehicle type in the system as defined below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": "Unique identifier of a vehicle type.", + "type": "string" + }, + "form_factor": { + "description": "The vehicle's general form factor.", + "type": "string", + "enum": ["bicycle", "car", "moped", "other", "scooter"] + }, + "propulsion_type": { + "description": "The primary propulsion type of the vehicle.", + "type": "string", + "enum": ["human", "electric_assist", "electric", "combustion"] + }, + "max_range_meters": { + "description": + "The furthest distance in meters that the vehicle can travel without recharging or refueling when it has the maximum amount of energy potential.", + "type": "number", + "minimum": 0 + }, + "name": { + "description": "The public name of this vehicle type.", + "type": "string" + } + }, + "required": ["vehicle_type_id", "form_factor", "propulsion_type"], + "if": { + "properties": { + "propulsion_type": { + "enum": ["electric", "electric_assist", "combustion"] + } + }, + "required": ["propulsion_type"] + }, + "then": { + "required": ["max_range_meters"] + } + } + } + }, + "required": ["vehicle_types"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/free_bike_status.json b/gbfs-validator-java/src/main/resources/schema/v2.3/free_bike_status.json new file mode 100644 index 0000000..ea51584 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/free_bike_status.json @@ -0,0 +1,152 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are available for rent (as of v2.1-RC2).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": + "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "boolean" + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "boolean" + }, + "rental_uris": { + "description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": "URI that can be used on iOS to launch the rental app for this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": "URL that can be used by a web browser to show more information about renting this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + } + } + }, + "vehicle_type_id": { + "description": "The vehicle_type_id of this vehicle (added in v2.1-RC).", + "type": "string" + }, + "last_reported": { + "description": "The last time this vehicle reported its status to the operator's backend in POSIX time (added in v2.1-RC).", + "type": "number", + "minimum": 1450155600 + }, + "current_range_meters": { + "description": "The furthest distance in meters that the vehicle can travel without recharging or refueling with the vehicle's current charge or fuel (added in v2.1-RC).", + "type": "number", + "minimum": 0 + }, + "current_fuel_percent": { + "description": "This value represents the current percentage, expressed from 0 to 1, of fuel or battery power remaining in the vehicle. Added in v2.3-RC.", + "type": "number", + "minimum": 0 + }, + "station_id": { + "description": "Identifier referencing the station_id if the vehicle is currently at a station (added in v2.1-RC2).", + "type": "string" + }, + "home_station_id": { + "description": "The station_id of the station this vehicle must be returned to (added in v2.3-RC).", + "type": "string" + }, + "pricing_plan_id": { + "description": "The plan_id of the pricing plan this vehicle is eligible for (added in v2.2).", + "type": "string" + }, + "vehicle_equipment": { + "description": "List of vehicle equipment provided by the operator in addition to the accessories already provided in the vehicle. Added in v2.3.", + "type": "array", + "items": { + "enum": ["child_seat_a", "child_seat_b", "child_seat_c", "winter_tires", "snow_chains"] + } + }, + "available_until": { + "description": "The date and time when any rental of the vehicle must be completed. Added in v2.3.", + "type": "string", + "pattern": "^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(([+-]([0-9]{2}):([0-9]{2}))|Z)$" + } + }, + "anyOf": [ + { + "required": ["lat", "lon"], + "errorMessage": "Both 'lat' and 'lon' are required." + }, + { + "required": ["station_id"], + "properties": { + "lat": { + "not": {} + }, + "lon": { + "not": {} + } + }, + "errorMessage": "'station_id' is required if 'lat' and 'lon' are not present." + } + ], + "required": ["bike_id", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/gbfs.json b/gbfs-validator-java/src/main/resources/schema/v2.3/gbfs.json new file mode 100644 index 0000000..90852b3 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/gbfs.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files published by the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-z]{2,3}(-[A-Z]{2})?$": { + "type": "object", + "properties": { + "feeds": { + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "vehicle_types", + "station_information", + "station_status", + "free_bike_status", + "system_hours", + "system_alerts", + "system_calendar", + "system_regions", + "system_pricing_plans", + "geofencing_zones" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + } + } + }, + "required": ["feeds"] + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/gbfs_versions.json b/gbfs-validator-java/src/main/resources/schema/v2.3/gbfs_versions.json new file mode 100644 index 0000000..9898465 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/gbfs_versions.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#gbfs_versionsjson", + "description": + "Lists all feed endpoints published according to version sof the GBFS documentation. (added in v1.1)", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.3" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "versions": { + "description": + "Contains one object, as defined below, for each of the available versions of a feed. The array must be sorted by increasing MAJOR and MINOR version number.", + "type": "array", + "items": { + "type": "object", + "properties": { + "version": { + "description": + "The semantic version of the feed in the form X.Y", + "type": "string", + "enum": [ + "1.0", + "1.1", + "2.0", + "2.1", + "2.2", + "2.3", + "3.0" + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": ["version", "url"] + } + } + }, + "required": ["versions"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/geofencing_zones.json b/gbfs-validator-java/src/main/resources/schema/v2.3/geofencing_zones.json new file mode 100644 index 0000000..6bd5917 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/geofencing_zones.json @@ -0,0 +1,145 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#geofencing_zonesjson", + "description": + "Describes geofencing zones and their associated rules and attributes (added in v2.1-RC).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.3" + }, + "data": { + "description": "Array that contains geofencing information for the system.", + "type": "object", + "properties": { + "geofencing_zones": { + "type": "object", + "description": "Each geofenced zone and its associated rules and attributes is described as an object within the array of features.", + "properties": { + "type": { + "description": "FeatureCollection as per IETF RFC 7946.", + "type": "string", + "enum": ["FeatureCollection"] + }, + "features": { + "description": "Array of objects.", + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["Feature"] + }, + "properties": { + "description": + "Describing travel allowances and limitations.", + "type": "object", + "properties": { + "name": { + "description": "Public name of the geofencing zone.", + "type": "string" + }, + "start": { + "description": "Start time of the geofencing zone in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the geofencing zone in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "rules": { + "description": "Array that contains one object per rule.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "type": "array", + "description": "Array of vehicle type IDs for which these restrictions apply.", + "items": { "type": "string" } + }, + "ride_allowed": { + "description": "Is the undocked ride allowed to start and end in this zone?", + "type": "boolean" + }, + "ride_through_allowed": { + "description": + "Is the ride allowed to travel through this zone?", + "type": "boolean" + }, + "maximum_speed_kph": { + "description": "What is the maximum speed allowed, in kilometers per hour?", + "type": "integer", + "minimum": 0 + }, + "station_parking": { + "description": "Vehicle MUST be parked at stations defined in station_information.json within this geofence zone", + "type": "boolean" + } + }, + "required": ["ride_allowed", "ride_through_allowed"] + } + } + } + }, + "geometry": { + "description": + "A polygon that describes where rides might not be able to start, end, go through, or have other limitations. Must follow the right-hand rule.", + "title": "GeoJSON MultiPolygon", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + }, + "required": ["type", "coordinates"] + } + }, + "required": ["type", "geometry", "properties"] + } + } + }, + "required": ["type", "features"] + } + }, + "required": ["geofencing_zones"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/station_information.json b/gbfs-validator-java/src/main/resources/schema/v2.3/station_information.json new file mode 100644 index 0000000..7fc079d --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/station_information.json @@ -0,0 +1,216 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#station_informationjson", + "description": + "List of all stations, their capacities and locations. REQUIRED of systems utilizing docks.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "key", + "creditcard", + "paypass", + "applepay", + "androidpay", + "transitcard", + "accountnumber", + "phone" + ] + }, + "minItems": 1 + }, + "is_virtual_station": { + "description": + "Is this station a location with or without physical infrastructure? (added in v2.1-RC)", + "type": "boolean" + }, + "station_area": { + "description": + "A multipolygon that describes the area of a virtual station (added in v2.1-RC).", + "type": "object", + "required": ["type", "coordinates"], + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + } + }, + "parking_type": { + "description": "Type of parking station. Added in v2.3", + "type": "string", + "enum": [ + "parking_lot", + "street_parking", + "underground_parking", + "sidewalk_parking", + "other" + ] + }, + "parking_hoop": { + "description": "Are parking hoops present at this station? Added in v2.3", + "type": "boolean" + }, + "contact_phone": { + "description": "Contact phone of the station. Added in v2.3", + "type": "string" + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "vehicle_capacity": { + "description": + "An object where each key is a vehicle_type_id and the value is a number presenting the total number of vehicles of this type that can park within the station_area (added in v2.1-RC).", + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "is_valet_station": { + "description": + "Are valet services provided at this station? (added in v2.1-RC)", + "type": "boolean" + }, + "is_charging_station": { + "description": + "Does the station support charging of electric vehicles? (added in v2.3-RC)", + "type": "boolean" + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this station (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting a vehicle at this station (added in v1.1).", + "type": "string", + "format": "uri" + } + } + }, + "vehicle_type_capacity": { + "description": + "An object where each key is a vehicle_type_id and the value is a number representing the total docking points installed at this station for each vehicle type (added in v2.1-RC).", + "type": "object", + "additionalProperties": { + "type": "number" + } + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/station_status.json b/gbfs-validator-java/src/main/resources/schema/v2.3/station_status.json new file mode 100644 index 0000000..c6db772 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/station_status.json @@ -0,0 +1,145 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availability of the station", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "vehicle_types_available": { + "description": + "Array of objects displaying the total number of each vehicle type at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": + "The vehicle_type_id of vehicle at the station (added in v2.1-RC).", + "type": "string" + }, + "count": { + "description": + "A number representing the total amount of this vehicle type at the station (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_id", "count"] + } + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "boolean" + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "boolean" + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "boolean" + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "vehicle_docks_available": { + "description": + "Object displaying available docks by vehicle type (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "description": + "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "description": + "A number representing the total number of available docks for the defined vehicle type (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_ids", "count"] + } + } + }, + "required": [ + "station_id", + "num_bikes_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/system_alerts.json b/gbfs-validator-java/src/main/resources/schema/v2.3/system_alerts.json new file mode 100644 index 0000000..b19db8b --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/system_alerts.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "system_closure", + "station_closure", + "station_move", + "other" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "integer", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the alert.", + "type": "integer", + "minimum": 1450155600 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "string", + "format": "uri" + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/system_calendar.json b/gbfs-validator-java/src/main/resources/schema/v2.3/system_calendar.json new file mode 100644 index 0000000..688f311 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/system_calendar.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": "Array that contains opertions calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + } + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/system_hours.json b/gbfs-validator-java/src/main/resources/schema/v2.3/system_hours.json new file mode 100644 index 0000000..49c6c73 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/system_information.json b/gbfs-validator-java/src/main/resources/schema/v2.3/system_information.json new file mode 100644 index 0000000..40e7ea8 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/system_information.json @@ -0,0 +1,588 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "format": "date" + }, + "phone_number": { + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Algiers", + "Africa/Bissau", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/El_Aaiun", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Khartoum", + "Africa/Lagos", + "Africa/Maputo", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Sao_Tome", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Asuncion", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Cayenne", + "America/Chicago", + "America/Chihuahua", + "America/Costa_Rica", + "America/Cuiaba", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Fort_Nelson", + "America/Fortaleza", + "America/Glace_Bay", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port-au-Prince", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Sitka", + "America/St_Johns", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Vancouver", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/Troll", + "Antarctica/Vostok", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Colombo", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kathmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Riyadh", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ulaanbaatar", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faroe", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/Stanley", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/Perth", + "Australia/Sydney", + "CET", + "CST6CDT", + "EET", + "EST", + "EST5EDT", + "Etc/GMT", + "Etc/GMT-1", + "Etc/GMT-10", + "Etc/GMT-11", + "Etc/GMT-12", + "Etc/GMT-13", + "Etc/GMT-14", + "Etc/GMT-2", + "Etc/GMT-3", + "Etc/GMT-4", + "Etc/GMT-5", + "Etc/GMT-6", + "Etc/GMT-7", + "Etc/GMT-8", + "Etc/GMT-9", + "Etc/GMT+1", + "Etc/GMT+10", + "Etc/GMT+11", + "Etc/GMT+12", + "Etc/GMT+2", + "Etc/GMT+3", + "Etc/GMT+4", + "Etc/GMT+5", + "Etc/GMT+6", + "Etc/GMT+7", + "Etc/GMT+8", + "Etc/GMT+9", + "Etc/UTC", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Helsinki", + "Europe/Istanbul", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Lisbon", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Oslo", + "Europe/Paris", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zaporozhye", + "Europe/Zurich", + "HST", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Reunion", + "MET", + "MST", + "MST7MDT", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Wake", + "Pacific/Wallis", + "PST8PDT", + "WET" + ] + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "brand_assets": { + "description": + "An object where each key defines one of the items listed below (added in v2.3-RC).", + "type": "object", + "properties": { + "brand_last_modified": { + "description": "Date that indicates the last time any included brand assets were updated (added in v2.3-RC).", + "type": "string", + "format": "date" + }, + "brand_terms_url": { + "description": "A fully qualified URL pointing to the location of a page that defines the license terms of brand icons, colors or other trademark information (added in v2.3-RC).", + "type": "string", + "format": "uri" + }, + "brand_image_url": { + "description": "A fully qualified URL pointing to the location of a graphic file representing the brand for the service (added in v2.3-RC). ", + "type": "string", + "format": "uri" + }, + "brand_image_url_dark": { + "description": "A fully qualified URL pointing to the location of a graphic file representing the brand for the service for use in dark mode (added in v2.3-RC).", + "type": "string", + "format": "uri" + }, + "color": { + "description": "Color used to represent the brand for the service (added in v2.3-RC)", + "type": "string", + "pattern": "^#([a-fA-F0-9]{6})$" + } + }, + "required": ["brand_last_modified", "brand_image_url"] + }, + "terms_url": { + "description": + "A fully qualified URL pointing to the terms of service (added in v2.3-RC)", + "type": "string", + "format": "uri" + }, + "terms_last_updated": { + "description": + "The date that the terms of service provided at terms_url were last updated (added in v2.3-RC)", + "type": "string", + "format": "date" + }, + "privacy_url": { + "description": + "A fully qualified URL pointing to the privacy policy for the service (added in v2.3-RC).", + "type": "string", + "format": "uri" + }, + "privacy_last_updated": { + "description": + "The date that the privacy policy provided at privacy_url was last updated (added in v2.3-RC).", + "type": "string", + "format": "date" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + } + } + } + }, + "required": ["system_id", "language", "name", "timezone"], + "dependentRequired": { + "terms_url": ["terms_last_updated"], + "privacy_url": ["privacy_last_updated"] + } + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/system_pricing_plans.json b/gbfs-validator-java/src/main/resources/schema/v2.3/system_pricing_plans.json new file mode 100644 index 0000000..b6b4ba9 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/system_pricing_plans.json @@ -0,0 +1,160 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "boolean" + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + }, + "per_km_pricing": { + "description": + "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of kilometers that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each kilometer interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "description": + "Interval in kilometers at which the rate of this segment is either reapplied indefinitely, or if defined, up until (but not including) end kilometer (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The kilometer at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["start", "rate", "interval"] + } + }, + "per_min_pricing": { + "description": + "Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of minutes that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each minute interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "description": + "Interval in minutes at which the rate of this segment is either reapplied (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The minute at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["start", "rate", "interval"] + } + }, + "surge_pricing": { + "description": + "Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)", + "type": "boolean" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/system_regions.json b/gbfs-validator-java/src/main/resources/schema/v2.3/system_regions.json new file mode 100644 index 0000000..a3cb932 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "2.3" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v2.3/vehicle_types.json b/gbfs-validator-java/src/main/resources/schema/v2.3/vehicle_types.json new file mode 100644 index 0000000..f396269 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v2.3/vehicle_types.json @@ -0,0 +1,204 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v2.3/gbfs.md#vehicle_typesjson", + "description": + "Describes the types of vehicles that System operator has available for rent (added in v2.1-RC).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 1450155600 + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "2.3" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "vehicle_types": { + "description": + "Array that contains one object per vehicle type in the system as defined below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": "Unique identifier of a vehicle type.", + "type": "string" + }, + "form_factor": { + "description": "The vehicle's general form factor.", + "type": "string", + "enum": ["bicycle", "cargo_bicycle" ,"car", "moped", "scooter_standing", "scooter_seated", "other", "scooter"] + }, + "rider_capacity": { + "description": "The number of riders (driver included) the vehicle can legally accommodate", + "type": "integer", + "minimum": 0 + }, + "cargo_volume_capacity": { + "description": "Cargo volume available in the vehicle, expressed in liters.", + "type": "integer", + "minimum": 0 + }, + "cargo_load_capacity": { + "description": "The capacity of the vehicle cargo space (excluding passengers), expressed in kilograms.", + "type": "integer", + "minimum": 0 + }, + + "propulsion_type": { + "description": "The primary propulsion type of the vehicle. Updated in v2.3 to represent car-sharing", + "type": "string", + "enum": ["human", "electric_assist", "electric", "combustion", "combustion_diesel", "hybrid", "plug_in_hybrid", "hydrogen_fuel_cell"] + }, + "eco_label": { + "description": "Vehicle air quality certificate. added in v2.3.", + "type": "array", + "items": { + "type": "object", + "properties": { + "country_code": { + "description": " Country code following the ISO 3166-1 alpha-2 notation. Added in v2.3.", + "type": "string", + "pattern": "^[A-Z]{2}" + }, + "eco_sticker": { + "description": " Name of the eco label. Added in v2.3.", + "type": "string" + } + } + }, + "required": ["country_code", "eco_sticker"] + }, + "max_range_meters": { + "description": + "The furthest distance in meters that the vehicle can travel without recharging or refueling when it has the maximum amount of energy potential.", + "type": "number", + "minimum": 0 + }, + "name": { + "description": "The public name of this vehicle type.", + "type": "string" + }, + "vehicle_accessories": { + "description": "Description of accessories available in the vehicle.", + "type": "array", + "items": { + "enum": ["air_conditioning", "automatic", "manual", "convertible", "cruise_control", "doors_2", "doors_3", "doors_4", "doors_5", "navigation"] + } + }, + "g_CO2_km": { + "description": "Maximum quantity of CO2, in grams, emitted per kilometer, according to the WLTP. Added in v2.3", + "type": "integer", + "minimum": 0 + }, + "vehicle_image": { + "description": "URL to an image that would assist the user in identifying the vehicle. JPEG or PNG. Added in v2.3", + "type": "string", + "format": "uri" + }, + "make": { + "description": "The name of the vehicle manufacturer. Added in v2.3", + "type": "string" + }, + "model": { + "description": "The name of the vehicle model. Added in v2.3", + "type": "string" + }, + "color": { + "description": "The color of the vehicle. Added in v2.3", + "type": "string" + }, + "wheel_count": { + "description": "Number of wheels this vehicle type has. Added in v2.3", + "type": "integer", + "minimum": 0 + }, + "max_permitted_speed": { + "description": "The maximum speed in kilometers per hour this vehicle is permitted to reach in accordance with local permit and regulations. Added in v2.3", + "type": "integer", + "minimum": 0 + }, + "rated_power": { + "description": "The rated power of the motor for this vehicle type in watts. Added in v2.3", + "type": "integer", + "minimum": 0 + }, + "default_reserve_time": { + "description": "Maximum time in minutes that a vehicle can be reserved before a rental begins added in v2.3-RC.", + "type": "integer", + "minimum": 0 + }, + "return_constraint": { + "description": "The conditions for returning the vehicle at the end of the trip. Added in v2.3-RC as return_type, and updated to return_constraint in v2.3.", + "type": "string", + "enum": ["free_floating", "roundtrip_station", "any_station", "hybrid"] + }, + "vehicle_assets": { + "description": "An object where each key defines one of the items listed below added in v2.3-RC.", + "type": "object", + "properties": { + "icon_url": { + "description": "A fully qualified URL pointing to the location of a graphic icon file that MAY be used to represent this vehicle type on maps and in other applications added in v2.3-RC.", + "type": "string", + "format": "uri" + }, + "icon_url_dark": { + "description": "A fully qualified URL pointing to the location of a graphic icon file to be used to represent this vehicle type when in dark mode added in v2.3-RC.", + "type": "string", + "format": "uri" + }, + "icon_last_modified": { + "description": "Date that indicates the last time any included vehicle icon images were modified or updated added in v2.3-RC.", + "type": "string", + "format": "date" + } + }, + "required": ["icon_url", "icon_last_modified"] + }, + "default_pricing_plan_id": { + "description": "A plan_id as defined in system_pricing_plans.json added in v2.3-RC.", + "type": "string" + }, + "pricing_plan_ids": { + "description": "Array of all pricing plan IDs as defined in system_pricing_plans.json added in v2.3-RC.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["vehicle_type_id", "form_factor", "propulsion_type"], + "if": { + "properties": { + "propulsion_type": { + "enum": ["electric", "electric_assist", "combustion", "combustion_diesel", "hybrid", "plug_in_hybrid", "hydrogen_fuel_cell"] + } + } + }, + "then": { + "required": ["max_range_meters"] + } + } + } + }, + "required": ["vehicle_types"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} + diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/gbfs.json b/gbfs-validator-java/src/main/resources/schema/v3.0/gbfs.json new file mode 100644 index 0000000..404c5e6 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/gbfs.json @@ -0,0 +1,64 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#gbfsjson", + "description": "Auto-discovery file that links to all of the other files published by the system.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "3.0" + }, + "data": { + "type": "object", + "properties": { + "feeds": { + "description": "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "vehicle_types", + "station_information", + "station_status", + "vehicle_status", + "system_alerts", + "system_regions", + "system_pricing_plans", + "geofencing_zones" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + }, + "minItems": 1 + } + }, + "required": ["feeds"] + } + }, + "additionalProperties": false, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/gbfs_versions.json b/gbfs-validator-java/src/main/resources/schema/v3.0/gbfs_versions.json new file mode 100644 index 0000000..de78545 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/gbfs_versions.json @@ -0,0 +1,60 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#gbfs_versionsjson", + "description": "Lists all feed endpoints published according to version sof the GBFS documentation. (added in v1.1)", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "3.0" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "versions": { + "description": "Contains one object, as defined below, for each of the available versions of a feed. The array must be sorted by increasing MAJOR and MINOR version number.", + "type": "array", + "items": { + "type": "object", + "properties": { + "version": { + "description": "The semantic version of the feed in the form X.Y", + "type": "string", + "enum": [ + "1.0", + "1.1", + "2.0", + "2.1", + "2.2", + "2.3", + "3.0" + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": ["version", "url"] + } + } + }, + "required": ["versions"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/geofencing_zones.json b/gbfs-validator-java/src/main/resources/schema/v3.0/geofencing_zones.json new file mode 100644 index 0000000..0129665 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/geofencing_zones.json @@ -0,0 +1,202 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#geofencing_zonesjson", + "description": "Describes geofencing zones and their associated rules and attributes (added in v2.1-RC).", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "3.0" + }, + "data": { + "description": "Array that contains geofencing information for the system.", + "type": "object", + "properties": { + "geofencing_zones": { + "type": "object", + "description": "Each geofenced zone and its associated rules and attributes is described as an object within the array of features.", + "properties": { + "type": { + "description": "FeatureCollection as per IETF RFC 7946.", + "type": "string", + "enum": ["FeatureCollection"] + }, + "features": { + "description": "Array of objects.", + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["Feature"] + }, + "properties": { + "description": "Describing travel allowances and limitations.", + "type": "object", + "properties": { + "name": { + "description": "Public name of the geofencing zone.", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "start": { + "description": "Start time of the geofencing zone in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "end": { + "description": "End time of the geofencing zone in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "rules": { + "description": "Array of Rule objects defining restrictions that apply within the area of the polygon.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "type": "array", + "description": "Array of vehicle type IDs for which these restrictions apply.", + "items": { "type": "string" } + }, + "ride_start_allowed": { + "description": "Is the ride allowed to start in this zone?", + "type": "boolean" + }, + "ride_end_allowed": { + "description": "Is the ride allowed to end in this zone?", + "type": "boolean" + }, + "ride_through_allowed": { + "description": "Is the ride allowed to travel through this zone?", + "type": "boolean" + }, + "maximum_speed_kph": { + "description": "What is the maximum speed allowed, in kilometers per hour?", + "type": "integer", + "minimum": 0 + }, + "station_parking": { + "description": "Vehicle MUST be parked at stations defined in station_information.json within this geofence zone", + "type": "boolean" + } + }, + "required": [ + "ride_start_allowed", + "ride_end_allowed", + "ride_through_allowed" + ] + } + } + } + }, + "geometry": { + "description": "A polygon that describes where rides might not be able to start, end, go through, or have other limitations. Must follow the right-hand rule.", + "title": "GeoJSON MultiPolygon", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + }, + "required": ["type", "coordinates"] + } + }, + "required": ["type", "geometry", "properties"] + } + } + }, + "required": ["type", "features"] + }, + "global_rules": { + "description": "Array of Rule objects defining restrictions that apply globally in all areas as the default restrictions, except where overridden with an explicit geofencing zone.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "type": "array", + "description": "Array of vehicle type IDs for which these restrictions apply.", + "items": { "type": "string" } + }, + "ride_start_allowed": { + "description": "Is the ride allowed to start in this zone?", + "type": "boolean" + }, + "ride_end_allowed": { + "description": "Is the ride allowed to end in this zone?", + "type": "boolean" + }, + "ride_through_allowed": { + "description": "Is the ride allowed to travel through this zone?", + "type": "boolean" + }, + "maximum_speed_kph": { + "description": "What is the maximum speed allowed, in kilometers per hour?", + "type": "integer", + "minimum": 0 + }, + "station_parking": { + "description": "Vehicle MUST be parked at stations defined in station_information.json within this geofence zone", + "type": "boolean" + } + }, + "required": [ + "ride_start_allowed", + "ride_end_allowed", + "ride_through_allowed" + ] + } + } + }, + "required": ["geofencing_zones", "global_rules"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/manifest.json b/gbfs-validator-java/src/main/resources/schema/v3.0/manifest.json new file mode 100644 index 0000000..2916822 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/manifest.json @@ -0,0 +1,80 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#manifestjson", + "description": "An index of gbfs.json URLs for each GBFS data set produced by a publisher. A single instance of this file should be published at a single stable URL, for example: https://example.com/gbfs/manifest.json.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "3.0" + }, + "data": { + "type": "object", + "properties": { + "datasets": { + "description": "An array of objects, each containing the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "system_id": { + "description": "The system_id from system_information.json for the corresponding data set(s).", + "type": "string" + }, + "versions": { + "description": "Contains one object, as defined below, for each of the available versions of a feed. The array MUST be sorted by increasing MAJOR and MINOR version number.", + "type": "array", + "items": { + "type": "object", + "properties": { + "version": { + "description": "The semantic version of the feed in the form X.Y", + "type": "string", + "enum": [ + "1.0", + "1.1", + "2.0", + "2.1", + "2.2", + "2.3", + "3.0" + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": [ + "version", + "url" + ] + } + } + }, + "required": [ + "system_id", + "versions" + ] + } + } + }, + "required": ["datasets"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} + diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/station_information.json b/gbfs-validator-java/src/main/resources/schema/v3.0/station_information.json new file mode 100644 index 0000000..ab777a6 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/station_information.json @@ -0,0 +1,278 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#station_informationjson", + "description": + "List of all stations, their capacities and locations. REQUIRED of systems utilizing docks.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "3.0" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "station_opening_hours": { + "description": "Hours of operation for the station in OSM opening_hours format.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "key", + "creditcard", + "paypass", + "applepay", + "androidpay", + "transitcard", + "accountnumber", + "phone" + ] + }, + "minItems": 1 + }, + "is_virtual_station": { + "description": + "Is this station a location with or without physical infrastructure? (added in v2.1-RC)", + "type": "boolean" + }, + "station_area": { + "description": + "A multipolygon that describes the area of a virtual station (added in v2.1-RC).", + "type": "object", + "required": ["type", "coordinates"], + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + } + }, + "parking_type": { + "description": "Type of parking station. Added in v2.3", + "type": "string", + "enum": [ + "parking_lot", + "street_parking", + "underground_parking", + "sidewalk_parking", + "other" + ] + }, + "parking_hoop": { + "description": "Are parking hoops present at this station? Added in v2.3", + "type": "boolean" + }, + "contact_phone": { + "description": "Contact phone of the station. Added in v2.3", + "type": "string" + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "vehicle_types_capacity": { + "description": "This field's value is an array of objects containing the keys vehicle_type_ids and count defined below. These objects are used to model the parking capacity of virtual stations (defined using the is_virtual_station field) for each vehicle type that can be returned to this station.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "description": "The vehicle_type_ids, as defined in vehicle_types.json, that may park at the virtual station.", + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "description": "A number representing the total number of vehicles of the specified vehicle_type_ids that can park within the virtual station.", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_ids","count"] + } + }, + "vehicle_docks_capacity": { + "description": "This field's value is an array of objects containing the keys vehicle_type_ids and count defined below. These objects are used to model the total docking capacity of a station, both available and unavailable, for each type of vehicle that may dock at this station.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "description": "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station.", + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "description": "A number representing the total number of docks at the station, both available and unavailable, that may accept the vehicle types specified by vehicle_type_ids.", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_ids","count"] + } + }, + "is_valet_station": { + "description": + "Are valet services provided at this station? (added in v2.1-RC)", + "type": "boolean" + }, + "is_charging_station": { + "description": + "Does the station support charging of electric vehicles? (added in v2.3-RC)", + "type": "boolean" + }, + "rental_uris": { + "description": + "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": + "URI that can be used on iOS to launch the rental app for this station (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": + "URL that can be used by a web browser to show more information about renting a vehicle at this station (added in v1.1).", + "type": "string", + "format": "uri" + } + } + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/station_status.json b/gbfs-validator-java/src/main/resources/schema/v3.0/station_status.json new file mode 100644 index 0000000..13fadfc --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/station_status.json @@ -0,0 +1,145 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availability of the station", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "3.0" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_vehicles_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "vehicle_types_available": { + "description": + "Array of objects displaying the total number of each vehicle type at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": + "The vehicle_type_id of vehicle at the station (added in v2.1-RC).", + "type": "string" + }, + "count": { + "description": + "A number representing the total amount of this vehicle type at the station (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_id", "count"] + } + }, + "num_vehicles_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "boolean" + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "boolean" + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "boolean" + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "vehicle_docks_available": { + "description": + "Object displaying available docks by vehicle type (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "description": + "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "description": + "A number representing the total number of available docks for the defined vehicle type (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["vehicle_type_ids", "count"] + } + } + }, + "required": [ + "station_id", + "num_vehicles_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/system_alerts.json b/gbfs-validator-java/src/main/resources/schema/v3.0/system_alerts.json new file mode 100644 index 0000000..5f7db8b --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/system_alerts.json @@ -0,0 +1,161 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "3.0" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "system_closure", + "station_closure", + "station_move", + "other" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "string", + "format": "date-time" + }, + "end": { + "description": "End time of the alert.", + "type": "string", + "format": "date-time" + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string", + "format": "uri" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "description": { + "description": "Detailed description of the alert.", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "string", + "format": "date-time" + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/system_information.json b/gbfs-validator-java/src/main/resources/schema/v3.0/system_information.json new file mode 100644 index 0000000..041a91f --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/system_information.json @@ -0,0 +1,1231 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "3.0" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "languages": { + "description": + "List of languages used in translated strings. Each element in the list must be of type Language.", + "type": "array", + "items": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "name": { + "description": "Name of the system to be displayed to customers. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "opening_hours": { + "description": "Hours and dates of operation for the system in OSM opening_hours format. (added in v3.0)", + "type": "string" + }, + "short_name": { + "description": "Abbreviation for a system. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "operator": { + "description": "Name of the system operator. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "format": "date" + }, + "termination_date": { + "description": "Date after which this data source will no longer be available to consuming applications.", + "type": "string", + "format": "date" + }, + "phone_number": { + "description": + "This OPTIONAL field SHOULD contain a single voice telephone number for the specified system’s customer service department. MUST be in E.164 format as defined in Field Types.", + "type": "string", + "pattern": "^\\+[1-9]\\d{1,14}$" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "manifest_url":{ + "description": "REQUIRED if the producer publishes datasets for more than one system geography, for example Berlin and Paris. A fully qualified URL pointing to the manifest.json file for the publisher.", + "type": "string", + "format": "uri" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Algiers", + "Africa/Bissau", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/El_Aaiun", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Khartoum", + "Africa/Lagos", + "Africa/Maputo", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Sao_Tome", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Asuncion", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Cayenne", + "America/Chicago", + "America/Chihuahua", + "America/Costa_Rica", + "America/Cuiaba", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Fort_Nelson", + "America/Fortaleza", + "America/Glace_Bay", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port-au-Prince", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Sitka", + "America/St_Johns", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Vancouver", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/Troll", + "Antarctica/Vostok", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Colombo", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kathmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Riyadh", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ulaanbaatar", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faroe", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/Stanley", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/Perth", + "Australia/Sydney", + "CET", + "CST6CDT", + "EET", + "EST", + "EST5EDT", + "Etc/GMT", + "Etc/GMT-1", + "Etc/GMT-10", + "Etc/GMT-11", + "Etc/GMT-12", + "Etc/GMT-13", + "Etc/GMT-14", + "Etc/GMT-2", + "Etc/GMT-3", + "Etc/GMT-4", + "Etc/GMT-5", + "Etc/GMT-6", + "Etc/GMT-7", + "Etc/GMT-8", + "Etc/GMT-9", + "Etc/GMT+1", + "Etc/GMT+10", + "Etc/GMT+11", + "Etc/GMT+12", + "Etc/GMT+2", + "Etc/GMT+3", + "Etc/GMT+4", + "Etc/GMT+5", + "Etc/GMT+6", + "Etc/GMT+7", + "Etc/GMT+8", + "Etc/GMT+9", + "Etc/UTC", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Helsinki", + "Europe/Istanbul", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Lisbon", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Oslo", + "Europe/Paris", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zaporozhye", + "Europe/Zurich", + "HST", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Reunion", + "MET", + "MST", + "MST7MDT", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Wake", + "Pacific/Wallis", + "PST8PDT", + "WET" + ] + }, + "license_id": { + "description": "REQUIRED if the dataset is provided under a standard license. An identifier for a standard license from the SPDX License List. Provide license_id rather than license_url if the license is included in the SPDX License List. See the GBFS wiki for a comparison of a subset of standard licenses. If the license_id and license_url fields are blank or omitted, this indicates that the feed is provided under the Creative Commons Universal Public Domain Dedication.", + "type": "string", + "enum": [ + "0BSD", + "AAL", + "Abstyles", + "AdaCore-doc", + "Adobe-2006", + "Adobe-Glyph", + "ADSL", + "AFL-1.1", + "AFL-1.2", + "AFL-2.0", + "AFL-2.1", + "AFL-3.0", + "Afmparse", + "AGPL-1.0-only", + "AGPL-1.0-or-later", + "AGPL-3.0-only", + "AGPL-3.0-or-later", + "Aladdin", + "AMDPLPA", + "AML", + "AMPAS", + "ANTLR-PD", + "ANTLR-PD-fallback", + "Apache-1.0", + "Apache-1.1", + "Apache-2.0", + "APAFML", + "APL-1.0", + "App-s2p", + "APSL-1.0", + "APSL-1.1", + "APSL-1.2", + "APSL-2.0", + "Arphic-1999", + "Artistic-1.0", + "Artistic-1.0-cl8", + "Artistic-1.0-Perl", + "Artistic-2.0", + "Baekmuk", + "Bahyph", + "Barr", + "Beerware", + "Bitstream-Charter", + "Bitstream-Vera", + "BitTorrent-1.0", + "BitTorrent-1.1", + "blessing", + "BlueOak-1.0.0", + "Borceux", + "Brian-Gladman-3-Clause", + "BSD-1-Clause", + "BSD-2-Clause", + "BSD-2-Clause-Patent", + "BSD-2-Clause-Views", + "BSD-3-Clause", + "BSD-3-Clause-Attribution", + "BSD-3-Clause-Clear", + "BSD-3-Clause-LBNL", + "BSD-3-Clause-Modification", + "BSD-3-Clause-No-Military-License", + "BSD-3-Clause-No-Nuclear-License", + "BSD-3-Clause-No-Nuclear-License-2014", + "BSD-3-Clause-No-Nuclear-Warranty", + "BSD-3-Clause-Open-MPI", + "BSD-4-Clause", + "BSD-4-Clause-Shortened", + "BSD-4-Clause-UC", + "BSD-4.3RENO", + "BSD-4.3TAHOE", + "BSD-Advertising-Acknowledgement", + "BSD-Attribution-HPND-disclaimer", + "BSD-Protection", + "BSD-Source-Code", + "BSL-1.0", + "BUSL-1.1", + "bzip2-1.0.6", + "C-UDA-1.0", + "CAL-1.0", + "CAL-1.0-Combined-Work-Exception", + "Caldera", + "CATOSL-1.1", + "CC-BY-1.0", + "CC-BY-2.0", + "CC-BY-2.5", + "CC-BY-2.5-AU", + "CC-BY-3.0", + "CC-BY-3.0-AT", + "CC-BY-3.0-DE", + "CC-BY-3.0-IGO", + "CC-BY-3.0-NL", + "CC-BY-3.0-US", + "CC-BY-4.0", + "CC-BY-NC-1.0", + "CC-BY-NC-2.0", + "CC-BY-NC-2.5", + "CC-BY-NC-3.0", + "CC-BY-NC-3.0-DE", + "CC-BY-NC-4.0", + "CC-BY-NC-ND-1.0", + "CC-BY-NC-ND-2.0", + "CC-BY-NC-ND-2.5", + "CC-BY-NC-ND-3.0", + "CC-BY-NC-ND-3.0-DE", + "CC-BY-NC-ND-3.0-IGO", + "CC-BY-NC-ND-4.0", + "CC-BY-NC-SA-1.0", + "CC-BY-NC-SA-2.0", + "CC-BY-NC-SA-2.0-DE", + "CC-BY-NC-SA-2.0-FR", + "CC-BY-NC-SA-2.0-UK", + "CC-BY-NC-SA-2.5", + "CC-BY-NC-SA-3.0", + "CC-BY-NC-SA-3.0-DE", + "CC-BY-NC-SA-3.0-IGO", + "CC-BY-NC-SA-4.0", + "CC-BY-ND-1.0", + "CC-BY-ND-2.0", + "CC-BY-ND-2.5", + "CC-BY-ND-3.0", + "CC-BY-ND-3.0-DE", + "CC-BY-ND-4.0", + "CC-BY-SA-1.0", + "CC-BY-SA-2.0", + "CC-BY-SA-2.0-UK", + "CC-BY-SA-2.1-JP", + "CC-BY-SA-2.5", + "CC-BY-SA-3.0", + "CC-BY-SA-3.0-AT", + "CC-BY-SA-3.0-DE", + "CC-BY-SA-4.0", + "CC-PDDC", + "CC0-1.0", + "CDDL-1.0", + "CDDL-1.1", + "CDL-1.0", + "CDLA-Permissive-1.0", + "CDLA-Permissive-2.0", + "CDLA-Sharing-1.0", + "CECILL-1.0", + "CECILL-1.1", + "CECILL-2.0", + "CECILL-2.1", + "CECILL-B", + "CECILL-C", + "CERN-OHL-1.1", + "CERN-OHL-1.2", + "CERN-OHL-P-2.0", + "CERN-OHL-S-2.0", + "CERN-OHL-W-2.0", + "CFITSIO", + "checkmk", + "ClArtistic", + "Clips", + "CMU-Mach", + "CNRI-Jython", + "CNRI-Python", + "CNRI-Python-GPL-Compatible", + "COIL-1.0", + "Community-Spec-1.0", + "Condor-1.1", + "copyleft-next-0.3.0", + "copyleft-next-0.3.1", + "Cornell-Lossless-JPEG", + "CPAL-1.0", + "CPL-1.0", + "CPOL-1.02", + "Crossword", + "CrystalStacker", + "CUA-OPL-1.0", + "Cube", + "curl", + "D-FSL-1.0", + "diffmark", + "DL-DE-BY-2.0", + "DOC", + "Dotseqn", + "DRL-1.0", + "DSDP", + "dvipdfm", + "ECL-1.0", + "ECL-2.0", + "EFL-1.0", + "EFL-2.0", + "eGenix", + "Elastic-2.0", + "Entessa", + "EPICS", + "EPL-1.0", + "EPL-2.0", + "ErlPL-1.1", + "etalab-2.0", + "EUDatagrid", + "EUPL-1.0", + "EUPL-1.1", + "EUPL-1.2", + "Eurosym", + "Fair", + "FDK-AAC", + "Frameworx-1.0", + "FreeBSD-DOC", + "FreeImage", + "FSFAP", + "FSFUL", + "FSFULLR", + "FSFULLRWD", + "FTL", + "GD", + "GFDL-1.1-invariants-only", + "GFDL-1.1-invariants-or-later", + "GFDL-1.1-no-invariants-only", + "GFDL-1.1-no-invariants-or-later", + "GFDL-1.1-only", + "GFDL-1.1-or-later", + "GFDL-1.2-invariants-only", + "GFDL-1.2-invariants-or-later", + "GFDL-1.2-no-invariants-only", + "GFDL-1.2-no-invariants-or-later", + "GFDL-1.2-only", + "GFDL-1.2-or-later", + "GFDL-1.3-invariants-only", + "GFDL-1.3-invariants-or-later", + "GFDL-1.3-no-invariants-only", + "GFDL-1.3-no-invariants-or-later", + "GFDL-1.3-only", + "GFDL-1.3-or-later", + "Giftware", + "GL2PS", + "Glide", + "Glulxe", + "GLWTPL", + "gnuplot", + "GPL-1.0-only", + "GPL-1.0-or-later", + "GPL-2.0-only", + "GPL-2.0-or-later", + "GPL-3.0-only", + "GPL-3.0-or-later", + "Graphics-Gems", + "gSOAP-1.3b", + "HaskellReport", + "Hippocratic-2.1", + "HP-1986", + "HPND", + "HPND-export-US", + "HPND-Markus-Kuhn", + "HPND-sell-variant", + "HPND-sell-variant-MIT-disclaimer", + "HTMLTIDY", + "IBM-pibs", + "ICU", + "IEC-Code-Components-EULA", + "IJG", + "IJG-short", + "ImageMagick", + "iMatix", + "Imlib2", + "Info-ZIP", + "Intel", + "Intel-ACPI", + "Interbase-1.0", + "IPA", + "IPL-1.0", + "ISC", + "Jam", + "JasPer-2.0", + "JPL-image", + "JPNIC", + "JSON", + "Kazlib", + "Knuth-CTAN", + "LAL-1.2", + "LAL-1.3", + "Latex2e", + "Leptonica", + "LGPL-2.0-only", + "LGPL-2.0-or-later", + "LGPL-2.1-only", + "LGPL-2.1-or-later", + "LGPL-3.0-only", + "LGPL-3.0-or-later", + "LGPLLR", + "Libpng", + "libpng-2.0", + "libselinux-1.0", + "libtiff", + "libutil-David-Nugent", + "LiLiQ-P-1.1", + "LiLiQ-R-1.1", + "LiLiQ-Rplus-1.1", + "Linux-man-pages-copyleft", + "Linux-OpenIB", + "LOOP", + "LPL-1.0", + "LPL-1.02", + "LPPL-1.0", + "LPPL-1.1", + "LPPL-1.2", + "LPPL-1.3a", + "LPPL-1.3c", + "LZMA-SDK-9.11-to-9.20", + "LZMA-SDK-9.22", + "MakeIndex", + "Martin-Birgmeier", + "Minpack", + "MirOS", + "MIT", + "MIT-0", + "MIT-advertising", + "MIT-CMU", + "MIT-enna", + "MIT-feh", + "MIT-Modern-Variant", + "MIT-open-group", + "MIT-Wu", + "MITNFA", + "Motosoto", + "mpi-permissive", + "mpich2", + "MPL-1.0", + "MPL-1.1", + "MPL-2.0", + "MPL-2.0-no-copyleft-exception", + "mplus", + "MS-LPL", + "MS-PL", + "MS-RL", + "MTLL", + "MulanPSL-1.0", + "MulanPSL-2.0", + "Multics", + "Mup", + "NAIST-2003", + "NASA-1.3", + "Naumen", + "NBPL-1.0", + "NCGL-UK-2.0", + "NCSA", + "Net-SNMP", + "NetCDF", + "Newsletr", + "NGPL", + "NICTA-1.0", + "NIST-PD", + "NIST-PD-fallback", + "NLOD-1.0", + "NLOD-2.0", + "NLPL", + "Nokia", + "NOSL", + "Noweb", + "NPL-1.0", + "NPL-1.1", + "NPOSL-3.0", + "NRL", + "NTP", + "NTP-0", + "O-UDA-1.0", + "OCCT-PL", + "OCLC-2.0", + "ODbL-1.0", + "ODC-By-1.0", + "OFFIS", + "OFL-1.0", + "OFL-1.0-no-RFN", + "OFL-1.0-RFN", + "OFL-1.1", + "OFL-1.1-no-RFN", + "OFL-1.1-RFN", + "OGC-1.0", + "OGDL-Taiwan-1.0", + "OGL-Canada-2.0", + "OGL-UK-1.0", + "OGL-UK-2.0", + "OGL-UK-3.0", + "OGTSL", + "OLDAP-1.1", + "OLDAP-1.2", + "OLDAP-1.3", + "OLDAP-1.4", + "OLDAP-2.0", + "OLDAP-2.0.1", + "OLDAP-2.1", + "OLDAP-2.2", + "OLDAP-2.2.1", + "OLDAP-2.2.2", + "OLDAP-2.3", + "OLDAP-2.4", + "OLDAP-2.5", + "OLDAP-2.6", + "OLDAP-2.7", + "OLDAP-2.8", + "OML", + "OpenPBS-2.3", + "OpenSSL", + "OPL-1.0", + "OPUBL-1.0", + "OSET-PL-2.1", + "OSL-1.0", + "OSL-1.1", + "OSL-2.0", + "OSL-2.1", + "OSL-3.0", + "Parity-6.0.0", + "Parity-7.0.0", + "PDDL-1.0", + "PHP-3.0", + "PHP-3.01", + "Plexus", + "PolyForm-Noncommercial-1.0.0", + "PolyForm-Small-Business-1.0.0", + "PostgreSQL", + "PSF-2.0", + "psfrag", + "psutils", + "Python-2.0", + "Python-2.0.1", + "Qhull", + "QPL-1.0", + "QPL-1.0-INRIA-2004", + "Rdisc", + "RHeCos-1.1", + "RPL-1.1", + "RPL-1.5", + "RPSL-1.0", + "RSA-MD", + "RSCPL", + "Ruby", + "SAX-PD", + "Saxpath", + "SCEA", + "SchemeReport", + "Sendmail", + "Sendmail-8.23", + "SGI-B-1.0", + "SGI-B-1.1", + "SGI-B-2.0", + "SHL-0.5", + "SHL-0.51", + "SimPL-2.0", + "SISSL", + "SISSL-1.2", + "Sleepycat", + "SMLNJ", + "SMPPL", + "SNIA", + "snprintf", + "Spencer-86", + "Spencer-94", + "Spencer-99", + "SPL-1.0", + "SSH-OpenSSH", + "SSH-short", + "SSPL-1.0", + "SugarCRM-1.1.3", + "SunPro", + "SWL", + "Symlinks", + "TAPR-OHL-1.0", + "TCL", + "TCP-wrappers", + "TMate", + "TORQUE-1.1", + "TOSL", + "TPDL", + "TPL-1.0", + "TTWL", + "TU-Berlin-1.0", + "TU-Berlin-2.0", + "UCAR", + "UCL-1.0", + "Unicode-DFS-2015", + "Unicode-DFS-2016", + "Unicode-TOU", + "Unlicense", + "UPL-1.0", + "Vim", + "VOSTROM", + "VSL-1.0", + "W3C", + "W3C-19980720", + "W3C-20150513", + "w3m", + "Watcom-1.0", + "Wsuipa", + "WTFPL", + "X11", + "X11-distribute-modifications-variant", + "Xerox", + "XFree86-1.1", + "xinetd", + "xlock", + "Xnet", + "xpp", + "XSkat", + "YPL-1.0", + "YPL-1.1", + "Zed", + "Zend-2.0", + "Zimbra-1.3", + "Zimbra-1.4", + "Zlib", + "zlib-acknowledgement", + "ZPL-1.1", + "ZPL-2.0", + "ZPL-2.1" + ] + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "attribution_organization_name": { + "description": "If the feed license requires attribution, name of the organization to which attribution should be provided. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "attribution_url": { + "description": "URL of the organization to which attribution should be provided.", + "type": "string", + "format": "uri" + }, + "brand_assets": { + "description": + "An object where each key defines one of the items listed below (added in v2.3-RC).", + "type": "object", + "properties": { + "brand_last_modified": { + "description": "Date that indicates the last time any included brand assets were updated (added in v2.3-RC).", + "type": "string", + "format": "date" + }, + "brand_terms_url": { + "description": "A fully qualified URL pointing to the location of a page that defines the license terms of brand icons, colors or other trademark information (added in v2.3-RC).", + "type": "string", + "format": "uri" + }, + "brand_image_url": { + "description": "A fully qualified URL pointing to the location of a graphic file representing the brand for the service (added in v2.3-RC). ", + "type": "string", + "format": "uri" + }, + "brand_image_url_dark": { + "description": "A fully qualified URL pointing to the location of a graphic file representing the brand for the service for use in dark mode (added in v2.3-RC).", + "type": "string", + "format": "uri" + }, + "color": { + "description": "Color used to represent the brand for the service (added in v2.3-RC)", + "type": "string", + "pattern": "^#([a-fA-F0-9]{6})$" + } + }, + "required": ["brand_last_modified", "brand_image_url"] + }, + "terms_url": { + "description": + "A fully qualified URL pointing to the terms of service (also often called \"terms of use\" or \"terms and conditions\") for the service. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string", + "format": "uri" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "terms_last_updated": { + "description": + "The date that the terms of service provided at terms_url were last updated (added in v2.3-RC)", + "type": "string", + "format": "date" + }, + "privacy_url": { + "description": + "A fully qualified URL pointing to the privacy policy for the service. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string", + "format": "uri" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "privacy_last_updated": { + "description": + "The date that the privacy policy provided at privacy_url was last updated (added in v2.3-RC).", + "type": "string", + "format": "date" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "required": ["store_uri", "discovery_uri"] + } + } + } + }, + "oneOf": [ + { + "not": {"required" : ["license_url", "license_id"] } + }, + { + "required": ["license_id"], + "not": {"required": ["license_id"] } + }, + { + "required": ["license_url"], + "not": {"required": ["license_url"] } + } + ], + "required": ["system_id", "languages", "name", "opening_hours", "feed_contact_email", "timezone"], + "dependentRequired": { + "terms_url": ["terms_last_updated"], + "privacy_url": ["privacy_last_updated"] + }, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/system_pricing_plans.json b/gbfs-validator-java/src/main/resources/schema/v3.0/system_pricing_plans.json new file mode 100644 index 0000000..40459aa --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/system_pricing_plans.json @@ -0,0 +1,191 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "3.0" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "boolean" + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "per_km_pricing": { + "description": + "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of kilometers that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each kilometer interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "description": + "Interval in kilometers at which the rate of this segment is either reapplied indefinitely, or if defined, up until (but not including) end kilometer (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The kilometer at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["start", "rate", "interval"] + } + }, + "per_min_pricing": { + "description": + "Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of minutes that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each minute interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "description": + "Interval in minutes at which the rate of this segment is either reapplied (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The minute at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + }, + "required": ["start", "rate", "interval"] + } + }, + "surge_pricing": { + "description": + "Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)", + "type": "boolean" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} + diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/system_regions.json b/gbfs-validator-java/src/main/resources/schema/v3.0/system_regions.json new file mode 100644 index 0000000..f9d1e50 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/system_regions.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "3.0" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/vehicle_status.json b/gbfs-validator-java/src/main/resources/schema/v3.0/vehicle_status.json new file mode 100644 index 0000000..19bb035 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/vehicle_status.json @@ -0,0 +1,152 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#vehicle_statusjson", + "description": + "Describes the vehicles that are available for rent (as of v3.0, formerly free_bike_status).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", + "type": "string", + "const": "3.0" + }, + "data": { + "description": + "Array that contains one object per vehicle as defined below.", + "type": "object", + "properties": { + "vehicles": { + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "boolean" + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "boolean" + }, + "rental_uris": { + "description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": "URI that can be passed to an Android app with an intent (added in v1.1).", + "type": "string", + "format": "uri" + }, + "ios": { + "description": "URI that can be used on iOS to launch the rental app for this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + }, + "web": { + "description": "URL that can be used by a web browser to show more information about renting this vehicle (added in v1.1).", + "type": "string", + "format": "uri" + } + } + }, + "vehicle_type_id": { + "description": "The vehicle_type_id of this vehicle (added in v2.1-RC).", + "type": "string" + }, + "last_reported": { + "description": "The last time this vehicle reported its status to the operator's backend in RFC3339 format (added in v2.1-RC).", + "type": "string", + "format": "date-time" + }, + "current_range_meters": { + "description": "The furthest distance in meters that the vehicle can travel without recharging or refueling with the vehicle's current charge or fuel (added in v2.1-RC).", + "type": "number", + "minimum": 0 + }, + "current_fuel_percent": { + "description": "This value represents the current percentage, expressed from 0 to 1, of fuel or battery power remaining in the vehicle. Added in v2.3-RC.", + "type": "number", + "minimum": 0 + }, + "station_id": { + "description": "Identifier referencing the station_id if the vehicle is currently at a station (added in v2.1-RC2).", + "type": "string" + }, + "home_station_id": { + "description": "The station_id of the station this vehicle must be returned to (added in v2.3-RC).", + "type": "string" + }, + "pricing_plan_id": { + "description": "The plan_id of the pricing plan this vehicle is eligible for (added in v2.2).", + "type": "string" + }, + "vehicle_equipment": { + "description": "List of vehicle equipment provided by the operator in addition to the accessories already provided in the vehicle. Added in v2.3.", + "type": "array", + "items": { + "enum": ["child_seat_a", "child_seat_b", "child_seat_c", "winter_tires", "snow_chains"] + } + }, + "available_until": { + "description": "The date and time when any rental of the vehicle must be completed. Added in v2.3.", + "type": "string", + "pattern": "^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(([+-]([0-9]{2}):([0-9]{2}))|Z)$" + } + }, + "anyOf": [ + { + "required": ["lat", "lon"], + "errorMessage": "Both 'lat' and 'lon' are required." + }, + { + "required": ["station_id"], + "properties": { + "lat": { + "not": {} + }, + "lon": { + "not": {} + } + }, + "errorMessage": "'station_id' is required if 'lat' and 'lon' are not present." + } + ], + "required": ["vehicle_id", "is_reserved", "is_disabled"] + } + } + }, + "required": ["vehicles"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs-validator-java/src/main/resources/schema/v3.0/vehicle_types.json b/gbfs-validator-java/src/main/resources/schema/v3.0/vehicle_types.json new file mode 100644 index 0000000..d2b9c05 --- /dev/null +++ b/gbfs-validator-java/src/main/resources/schema/v3.0/vehicle_types.json @@ -0,0 +1,268 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#vehicle_typesjson", + "description": + "Describes the types of vehicles that System operator has available for rent (added in v2.1-RC).", + "type": "object", + "properties": { + "last_updated": { + "description": + "Last time the data in the feed was updated in RFC3339 format.", + "type": "string", + "format": "date-time" + }, + "ttl": { + "description": + "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).", + "type": "integer", + "minimum": 0 + }, + "version": { + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", + "type": "string", + "const": "3.0" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "vehicle_types": { + "description": + "Array that contains one object per vehicle type in the system as defined below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": "Unique identifier of a vehicle type.", + "type": "string" + }, + "form_factor": { + "description": "The vehicle's general form factor.", + "type": "string", + "enum": ["bicycle", "cargo_bicycle" ,"car", "moped", "scooter_standing", "scooter_seated", "other", "scooter"] + }, + "rider_capacity": { + "description": "The number of riders (driver included) the vehicle can legally accommodate", + "type": "integer", + "minimum": 0 + }, + "cargo_volume_capacity": { + "description": "Cargo volume available in the vehicle, expressed in liters.", + "type": "integer", + "minimum": 0 + }, + "cargo_load_capacity": { + "description": "The capacity of the vehicle cargo space (excluding passengers), expressed in kilograms.", + "type": "integer", + "minimum": 0 + }, + + "propulsion_type": { + "description": "The primary propulsion type of the vehicle. Updated in v2.3 to represent car-sharing", + "type": "string", + "enum": ["human", "electric_assist", "electric", "combustion", "combustion_diesel", "hybrid", "plug_in_hybrid", "hydrogen_fuel_cell"] + }, + "eco_labels": { + "description": "Vehicle air quality certificate. added in v2.3.", + "type": "array", + "items": { + "type": "object", + "properties": { + "country_code": { + "description": " Country code following the ISO 3166-1 alpha-2 notation. Added in v2.3.", + "type": "string", + "pattern": "^[A-Z]{2}" + }, + "eco_sticker": { + "description": " Name of the eco label. Added in v2.3.", + "type": "string" + } + } + }, + "required": ["country_code", "eco_sticker"] + }, + "max_range_meters": { + "description": + "The furthest distance in meters that the vehicle can travel without recharging or refueling when it has the maximum amount of energy potential.", + "type": "number", + "minimum": 0 + }, + "name": { + "description": "The public name of this vehicle type. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "vehicle_accessories": { + "description": "Description of accessories available in the vehicle.", + "type": "array", + "items": { + "enum": ["air_conditioning", "automatic", "manual", "convertible", "cruise_control", "doors_2", "doors_3", "doors_4", "doors_5", "navigation"] + } + }, + "g_CO2_km": { + "description": "Maximum quantity of CO2, in grams, emitted per kilometer, according to the WLTP. Added in v2.3", + "type": "integer", + "minimum": 0 + }, + "vehicle_image": { + "description": "URL to an image that would assist the user in identifying the vehicle. JPEG or PNG. Added in v2.3", + "type": "string", + "format": "uri" + }, + "make": { + "description": "The name of the vehicle manufacturer. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "model": { + "description": "The name of the vehicle model. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "color": { + "description": "The color of the vehicle. Added in v2.3", + "type": "string" + }, + "description": { + "description": "Customer-readable description of the vehicle type outlining special features or how-tos. An array with one object per supported language with the following keys:", + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "description": "The translated text.", + "type": "string" + }, + "language": { + "description": "IETF BCP 47 language code.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + } + }, + "required": ["text", "language"] + } + }, + "wheel_count": { + "description": "Number of wheels this vehicle type has. Added in v2.3", + "type": "integer", + "minimum": 0 + }, + "max_permitted_speed": { + "description": "The maximum speed in kilometers per hour this vehicle is permitted to reach in accordance with local permit and regulations. Added in v2.3", + "type": "integer", + "minimum": 0 + }, + "rated_power": { + "description": "The rated power of the motor for this vehicle type in watts. Added in v2.3", + "type": "integer", + "minimum": 0 + }, + "default_reserve_time": { + "description": "Maximum time in minutes that a vehicle can be reserved before a rental begins added in v2.3-RC.", + "type": "integer", + "minimum": 0 + }, + "return_constraint": { + "description": "The conditions for returning the vehicle at the end of the trip. Added in v2.3-RC as return_type, and updated to return_constraint in v2.3.", + "type": "string", + "enum": ["free_floating", "roundtrip_station", "any_station", "hybrid"] + }, + "vehicle_assets": { + "description": "An object where each key defines one of the items listed below added in v2.3-RC.", + "type": "object", + "properties": { + "icon_url": { + "description": "A fully qualified URL pointing to the location of a graphic icon file that MAY be used to represent this vehicle type on maps and in other applications added in v2.3-RC.", + "type": "string", + "format": "uri" + }, + "icon_url_dark": { + "description": "A fully qualified URL pointing to the location of a graphic icon file to be used to represent this vehicle type when in dark mode added in v2.3-RC.", + "type": "string", + "format": "uri" + }, + "icon_last_modified": { + "description": "Date that indicates the last time any included vehicle icon images were modified or updated added in v2.3-RC.", + "type": "string", + "format": "date" + } + }, + "required": ["icon_url", "icon_last_modified"] + }, + "default_pricing_plan_id": { + "description": "A plan_id as defined in system_pricing_plans.json added in v2.3-RC.", + "type": "string" + }, + "pricing_plan_ids": { + "description": "Array of all pricing plan IDs as defined in system_pricing_plans.json added in v2.3-RC.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["vehicle_type_id", "form_factor", "propulsion_type"], + "if": { + "properties": { + "propulsion_type": { + "enum": ["electric", "electric_assist", "combustion", "combustion_diesel", "hybrid", "plug_in_hybrid", "hydrogen_fuel_cell"] + } + } + }, + "then": { + "required": ["max_range_meters"] + } + } + } + }, + "required": ["vehicle_types"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} + diff --git a/src/test/java/org/entur/gbfs/validation/model/ValidationResultTest.java b/gbfs-validator-java/src/test/java/org/entur/gbfs/validation/model/ValidationResultTest.java similarity index 100% rename from src/test/java/org/entur/gbfs/validation/model/ValidationResultTest.java rename to gbfs-validator-java/src/test/java/org/entur/gbfs/validation/model/ValidationResultTest.java diff --git a/src/test/java/org/entur/gbfs/validation/validator/GbfsJsonValidatorTest.java b/gbfs-validator-java/src/test/java/org/entur/gbfs/validation/validator/GbfsJsonValidatorTest.java similarity index 100% rename from src/test/java/org/entur/gbfs/validation/validator/GbfsJsonValidatorTest.java rename to gbfs-validator-java/src/test/java/org/entur/gbfs/validation/validator/GbfsJsonValidatorTest.java diff --git a/src/test/resources/fixtures/v1.0/gbfs.json b/gbfs-validator-java/src/test/resources/fixtures/v1.0/gbfs.json similarity index 100% rename from src/test/resources/fixtures/v1.0/gbfs.json rename to gbfs-validator-java/src/test/resources/fixtures/v1.0/gbfs.json diff --git a/src/test/resources/fixtures/v1.0/system_hours.json b/gbfs-validator-java/src/test/resources/fixtures/v1.0/system_hours.json similarity index 100% rename from src/test/resources/fixtures/v1.0/system_hours.json rename to gbfs-validator-java/src/test/resources/fixtures/v1.0/system_hours.json diff --git a/src/test/resources/fixtures/v1.0/system_information.json b/gbfs-validator-java/src/test/resources/fixtures/v1.0/system_information.json similarity index 100% rename from src/test/resources/fixtures/v1.0/system_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v1.0/system_information.json diff --git a/src/test/resources/fixtures/v1.1/gbfs.json b/gbfs-validator-java/src/test/resources/fixtures/v1.1/gbfs.json similarity index 100% rename from src/test/resources/fixtures/v1.1/gbfs.json rename to gbfs-validator-java/src/test/resources/fixtures/v1.1/gbfs.json diff --git a/src/test/resources/fixtures/v1.1/gbfs_versions.json b/gbfs-validator-java/src/test/resources/fixtures/v1.1/gbfs_versions.json similarity index 100% rename from src/test/resources/fixtures/v1.1/gbfs_versions.json rename to gbfs-validator-java/src/test/resources/fixtures/v1.1/gbfs_versions.json diff --git a/src/test/resources/fixtures/v1.1/system_hours.json b/gbfs-validator-java/src/test/resources/fixtures/v1.1/system_hours.json similarity index 100% rename from src/test/resources/fixtures/v1.1/system_hours.json rename to gbfs-validator-java/src/test/resources/fixtures/v1.1/system_hours.json diff --git a/src/test/resources/fixtures/v1.1/system_information.json b/gbfs-validator-java/src/test/resources/fixtures/v1.1/system_information.json similarity index 100% rename from src/test/resources/fixtures/v1.1/system_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v1.1/system_information.json diff --git a/src/test/resources/fixtures/v2.0/gbfs.json b/gbfs-validator-java/src/test/resources/fixtures/v2.0/gbfs.json similarity index 100% rename from src/test/resources/fixtures/v2.0/gbfs.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.0/gbfs.json diff --git a/src/test/resources/fixtures/v2.0/gbfs_versions.json b/gbfs-validator-java/src/test/resources/fixtures/v2.0/gbfs_versions.json similarity index 100% rename from src/test/resources/fixtures/v2.0/gbfs_versions.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.0/gbfs_versions.json diff --git a/src/test/resources/fixtures/v2.0/system_hours.json b/gbfs-validator-java/src/test/resources/fixtures/v2.0/system_hours.json similarity index 100% rename from src/test/resources/fixtures/v2.0/system_hours.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.0/system_hours.json diff --git a/src/test/resources/fixtures/v2.0/system_information.json b/gbfs-validator-java/src/test/resources/fixtures/v2.0/system_information.json similarity index 100% rename from src/test/resources/fixtures/v2.0/system_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.0/system_information.json diff --git a/src/test/resources/fixtures/v2.1/free_bike_status.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/free_bike_status.json similarity index 100% rename from src/test/resources/fixtures/v2.1/free_bike_status.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/free_bike_status.json diff --git a/src/test/resources/fixtures/v2.1/gbfs.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/gbfs.json similarity index 100% rename from src/test/resources/fixtures/v2.1/gbfs.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/gbfs.json diff --git a/src/test/resources/fixtures/v2.1/gbfs_versions.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/gbfs_versions.json similarity index 100% rename from src/test/resources/fixtures/v2.1/gbfs_versions.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/gbfs_versions.json diff --git a/src/test/resources/fixtures/v2.1/geofencing_zones.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/geofencing_zones.json similarity index 100% rename from src/test/resources/fixtures/v2.1/geofencing_zones.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/geofencing_zones.json diff --git a/src/test/resources/fixtures/v2.1/station_information.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/station_information.json similarity index 100% rename from src/test/resources/fixtures/v2.1/station_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/station_information.json diff --git a/src/test/resources/fixtures/v2.1/station_information_virtual.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/station_information_virtual.json similarity index 100% rename from src/test/resources/fixtures/v2.1/station_information_virtual.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/station_information_virtual.json diff --git a/src/test/resources/fixtures/v2.1/station_status.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/station_status.json similarity index 100% rename from src/test/resources/fixtures/v2.1/station_status.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/station_status.json diff --git a/src/test/resources/fixtures/v2.1/system_alerts.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/system_alerts.json similarity index 100% rename from src/test/resources/fixtures/v2.1/system_alerts.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/system_alerts.json diff --git a/src/test/resources/fixtures/v2.1/system_calendar.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/system_calendar.json similarity index 100% rename from src/test/resources/fixtures/v2.1/system_calendar.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/system_calendar.json diff --git a/src/test/resources/fixtures/v2.1/system_hours.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/system_hours.json similarity index 100% rename from src/test/resources/fixtures/v2.1/system_hours.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/system_hours.json diff --git a/src/test/resources/fixtures/v2.1/system_information.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/system_information.json similarity index 100% rename from src/test/resources/fixtures/v2.1/system_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/system_information.json diff --git a/src/test/resources/fixtures/v2.1/system_regions.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/system_regions.json similarity index 100% rename from src/test/resources/fixtures/v2.1/system_regions.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/system_regions.json diff --git a/src/test/resources/fixtures/v2.1/vehicle_types.json b/gbfs-validator-java/src/test/resources/fixtures/v2.1/vehicle_types.json similarity index 100% rename from src/test/resources/fixtures/v2.1/vehicle_types.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.1/vehicle_types.json diff --git a/src/test/resources/fixtures/v2.2/free_bike_status.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/free_bike_status.json similarity index 100% rename from src/test/resources/fixtures/v2.2/free_bike_status.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/free_bike_status.json diff --git a/src/test/resources/fixtures/v2.2/gbfs.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/gbfs.json similarity index 100% rename from src/test/resources/fixtures/v2.2/gbfs.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/gbfs.json diff --git a/src/test/resources/fixtures/v2.2/gbfs_versions.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/gbfs_versions.json similarity index 100% rename from src/test/resources/fixtures/v2.2/gbfs_versions.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/gbfs_versions.json diff --git a/src/test/resources/fixtures/v2.2/geofencing_zones.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/geofencing_zones.json similarity index 100% rename from src/test/resources/fixtures/v2.2/geofencing_zones.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/geofencing_zones.json diff --git a/src/test/resources/fixtures/v2.2/station_information.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/station_information.json similarity index 100% rename from src/test/resources/fixtures/v2.2/station_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/station_information.json diff --git a/src/test/resources/fixtures/v2.2/station_information_virtual.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/station_information_virtual.json similarity index 100% rename from src/test/resources/fixtures/v2.2/station_information_virtual.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/station_information_virtual.json diff --git a/src/test/resources/fixtures/v2.2/station_status.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/station_status.json similarity index 100% rename from src/test/resources/fixtures/v2.2/station_status.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/station_status.json diff --git a/src/test/resources/fixtures/v2.2/system_alerts.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/system_alerts.json similarity index 100% rename from src/test/resources/fixtures/v2.2/system_alerts.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/system_alerts.json diff --git a/src/test/resources/fixtures/v2.2/system_calendar.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/system_calendar.json similarity index 100% rename from src/test/resources/fixtures/v2.2/system_calendar.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/system_calendar.json diff --git a/src/test/resources/fixtures/v2.2/system_hours.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/system_hours.json similarity index 100% rename from src/test/resources/fixtures/v2.2/system_hours.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/system_hours.json diff --git a/src/test/resources/fixtures/v2.2/system_information.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/system_information.json similarity index 100% rename from src/test/resources/fixtures/v2.2/system_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/system_information.json diff --git a/src/test/resources/fixtures/v2.2/system_pricing_plans.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/system_pricing_plans.json similarity index 100% rename from src/test/resources/fixtures/v2.2/system_pricing_plans.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/system_pricing_plans.json diff --git a/src/test/resources/fixtures/v2.2/system_pricing_plans_min_and_km.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/system_pricing_plans_min_and_km.json similarity index 100% rename from src/test/resources/fixtures/v2.2/system_pricing_plans_min_and_km.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/system_pricing_plans_min_and_km.json diff --git a/src/test/resources/fixtures/v2.2/system_regions.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/system_regions.json similarity index 100% rename from src/test/resources/fixtures/v2.2/system_regions.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/system_regions.json diff --git a/src/test/resources/fixtures/v2.2/vehicle_types.json b/gbfs-validator-java/src/test/resources/fixtures/v2.2/vehicle_types.json similarity index 100% rename from src/test/resources/fixtures/v2.2/vehicle_types.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.2/vehicle_types.json diff --git a/src/test/resources/fixtures/v2.3/free_bike_status.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/free_bike_status.json similarity index 100% rename from src/test/resources/fixtures/v2.3/free_bike_status.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/free_bike_status.json diff --git a/src/test/resources/fixtures/v2.3/free_bike_status_carsharing.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/free_bike_status_carsharing.json similarity index 100% rename from src/test/resources/fixtures/v2.3/free_bike_status_carsharing.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/free_bike_status_carsharing.json diff --git a/src/test/resources/fixtures/v2.3/free_bike_status_with_error.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/free_bike_status_with_error.json similarity index 100% rename from src/test/resources/fixtures/v2.3/free_bike_status_with_error.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/free_bike_status_with_error.json diff --git a/src/test/resources/fixtures/v2.3/gbfs.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/gbfs.json similarity index 100% rename from src/test/resources/fixtures/v2.3/gbfs.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/gbfs.json diff --git a/src/test/resources/fixtures/v2.3/gbfs_versions.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/gbfs_versions.json similarity index 100% rename from src/test/resources/fixtures/v2.3/gbfs_versions.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/gbfs_versions.json diff --git a/src/test/resources/fixtures/v2.3/geofencing_zones.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/geofencing_zones.json similarity index 100% rename from src/test/resources/fixtures/v2.3/geofencing_zones.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/geofencing_zones.json diff --git a/src/test/resources/fixtures/v2.3/station_information.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/station_information.json similarity index 100% rename from src/test/resources/fixtures/v2.3/station_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/station_information.json diff --git a/src/test/resources/fixtures/v2.3/station_information_virtual.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/station_information_virtual.json similarity index 100% rename from src/test/resources/fixtures/v2.3/station_information_virtual.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/station_information_virtual.json diff --git a/src/test/resources/fixtures/v2.3/station_status.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/station_status.json similarity index 100% rename from src/test/resources/fixtures/v2.3/station_status.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/station_status.json diff --git a/src/test/resources/fixtures/v2.3/system_alerts.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/system_alerts.json similarity index 100% rename from src/test/resources/fixtures/v2.3/system_alerts.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/system_alerts.json diff --git a/src/test/resources/fixtures/v2.3/system_calendar.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/system_calendar.json similarity index 100% rename from src/test/resources/fixtures/v2.3/system_calendar.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/system_calendar.json diff --git a/src/test/resources/fixtures/v2.3/system_hours.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/system_hours.json similarity index 100% rename from src/test/resources/fixtures/v2.3/system_hours.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/system_hours.json diff --git a/src/test/resources/fixtures/v2.3/system_information.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/system_information.json similarity index 100% rename from src/test/resources/fixtures/v2.3/system_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/system_information.json diff --git a/src/test/resources/fixtures/v2.3/system_pricing_plans.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/system_pricing_plans.json similarity index 100% rename from src/test/resources/fixtures/v2.3/system_pricing_plans.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/system_pricing_plans.json diff --git a/src/test/resources/fixtures/v2.3/system_pricing_plans_min_and_km.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/system_pricing_plans_min_and_km.json similarity index 100% rename from src/test/resources/fixtures/v2.3/system_pricing_plans_min_and_km.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/system_pricing_plans_min_and_km.json diff --git a/src/test/resources/fixtures/v2.3/system_regions.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/system_regions.json similarity index 100% rename from src/test/resources/fixtures/v2.3/system_regions.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/system_regions.json diff --git a/src/test/resources/fixtures/v2.3/vehicle_types.json b/gbfs-validator-java/src/test/resources/fixtures/v2.3/vehicle_types.json similarity index 100% rename from src/test/resources/fixtures/v2.3/vehicle_types.json rename to gbfs-validator-java/src/test/resources/fixtures/v2.3/vehicle_types.json diff --git a/src/test/resources/fixtures/v3.0/gbfs.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/gbfs.json similarity index 100% rename from src/test/resources/fixtures/v3.0/gbfs.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/gbfs.json diff --git a/src/test/resources/fixtures/v3.0/gbfs_versions.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/gbfs_versions.json similarity index 100% rename from src/test/resources/fixtures/v3.0/gbfs_versions.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/gbfs_versions.json diff --git a/src/test/resources/fixtures/v3.0/geofencing_zones.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/geofencing_zones.json similarity index 100% rename from src/test/resources/fixtures/v3.0/geofencing_zones.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/geofencing_zones.json diff --git a/src/test/resources/fixtures/v3.0/manifest.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/manifest.json similarity index 100% rename from src/test/resources/fixtures/v3.0/manifest.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/manifest.json diff --git a/src/test/resources/fixtures/v3.0/station_information.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/station_information.json similarity index 100% rename from src/test/resources/fixtures/v3.0/station_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/station_information.json diff --git a/src/test/resources/fixtures/v3.0/station_status.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/station_status.json similarity index 100% rename from src/test/resources/fixtures/v3.0/station_status.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/station_status.json diff --git a/src/test/resources/fixtures/v3.0/system_alerts.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/system_alerts.json similarity index 100% rename from src/test/resources/fixtures/v3.0/system_alerts.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/system_alerts.json diff --git a/src/test/resources/fixtures/v3.0/system_information.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/system_information.json similarity index 100% rename from src/test/resources/fixtures/v3.0/system_information.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/system_information.json diff --git a/src/test/resources/fixtures/v3.0/system_pricing_plans.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/system_pricing_plans.json similarity index 100% rename from src/test/resources/fixtures/v3.0/system_pricing_plans.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/system_pricing_plans.json diff --git a/src/test/resources/fixtures/v3.0/system_regions.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/system_regions.json similarity index 100% rename from src/test/resources/fixtures/v3.0/system_regions.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/system_regions.json diff --git a/src/test/resources/fixtures/v3.0/vehicle_status.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/vehicle_status.json similarity index 100% rename from src/test/resources/fixtures/v3.0/vehicle_status.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/vehicle_status.json diff --git a/src/test/resources/fixtures/v3.0/vehicle_types.json b/gbfs-validator-java/src/test/resources/fixtures/v3.0/vehicle_types.json similarity index 100% rename from src/test/resources/fixtures/v3.0/vehicle_types.json rename to gbfs-validator-java/src/test/resources/fixtures/v3.0/vehicle_types.json diff --git a/loader/pom.xml b/loader/pom.xml new file mode 100644 index 0000000..7360752 --- /dev/null +++ b/loader/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + org.entur.gbfs.validator + loader + 1.0-SNAPSHOT + loader + http://maven.apache.org + + + UTF-8 + 17 + 17 + + + + + org.json + json + 20240303 + + + diff --git a/loader/src/main/java/org/entur/gbfs/validator/Loader.java b/loader/src/main/java/org/entur/gbfs/validator/Loader.java new file mode 100644 index 0000000..ec1c5ac --- /dev/null +++ b/loader/src/main/java/org/entur/gbfs/validator/Loader.java @@ -0,0 +1,126 @@ +/* + * + * * + * * + * * * Licensed under the EUPL, Version 1.2 or – as soon they will be approved by + * * * the European Commission - subsequent versions of the EUPL (the "Licence"); + * * * You may not use this work except in compliance with the Licence. + * * * You may obtain a copy of the Licence at: + * * * + * * * https://joinup.ec.europa.eu/software/page/eupl + * * * + * * * Unless required by applicable law or agreed to in writing, software + * * * distributed under the Licence is distributed on an "AS IS" basis, + * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * See the Licence for the specific language governing permissions and + * * * limitations under the Licence. + * * + * + */ + +package org.entur.gbfs.validator; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.json.JSONString; +import org.json.JSONTokener; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; + +public class Loader { + + public Map load(String discoveryURI) { + Map result = new HashMap<>(); + InputStream discoveryFileStream = loadFile(URI.create(discoveryURI)); + + result.put("gbfs", discoveryFileStream); + + JSONObject discoveryFile = new JSONObject(new JSONTokener(discoveryFileStream)); + + String version = (String) discoveryFile.get("version"); + + JSONArray files; + + if (version.matches("^3\\.\\d")) { + files = getV3Files(discoveryFile); + } else { + files = getPreV3Files(discoveryFile); + } + + files.forEach(file -> { + JSONObject fileObj = (JSONObject) file; + String fileName = (String) fileObj.get("name"); + String fileURL = (String) fileObj.get("url"); + InputStream fileStream = loadFile(URI.create(fileURL)); + result.put(fileName, fileStream); + }); + + return result; + } + + private JSONArray getV3Files(JSONObject discoveryFile) { + return discoveryFile.getJSONObject("data").getJSONArray("feeds"); + } + + private JSONArray getPreV3Files(JSONObject discoveryFile) { + String firstLanguageKey = discoveryFile.getJSONObject("data").keys().next(); + return discoveryFile.getJSONObject("data").getJSONObject(firstLanguageKey).getJSONArray("feeds"); + } + + private InputStream loadFile(URI fileURI) { + if (fileURI.getScheme().equals("file")) { + try { + return getFileInputStream(fileURI); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } + } else if (fileURI.getScheme().equals("https") || fileURI.getScheme().equals("http")) { + try { + return getHTTPInputStream(fileURI); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + throw new RuntimeException("Scheme not supported"); + } + + private static FileInputStream getFileInputStream(URI fileURI) throws FileNotFoundException { + return new FileInputStream(new File(fileURI)); + } + + private InputStream getHTTPInputStream(URI fileURI) throws IOException { + URL url = fileURI.toURL(); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + con.setRequestMethod("GET"); + con.setConnectTimeout(5000); + con.setReadTimeout(5000); + con.setRequestProperty("Et-Client-Name", "entur-gbfs-validator"); + con.connect(); + BufferedReader in = new BufferedReader( + new InputStreamReader(con.getInputStream())); + + String inputLine; + StringBuffer content = new StringBuffer(); + while ((inputLine = in.readLine()) != null) { + content.append(inputLine); + } + in.close(); + con.disconnect(); + return new ByteArrayInputStream(content.toString().getBytes()); + } +} diff --git a/pom.xml b/pom.xml index b5dc7e9..e287012 100644 --- a/pom.xml +++ b/pom.xml @@ -1,407 +1,115 @@ - - - 4.0.0 - - org.entur.gbfs - gbfs-validator-java - 2.0.0-SNAPSHOT - - gbfs-validator-java - Validate GBFS feeds - https://github.com/entur/gbfs-validator-java - - Entur AS - http://www.entur.org/ - - - - EUPL-1.2 with modifications - https://joinup.ec.europa.eu/software/page/eupl - repo - - - - - Tom Erik Støwer - tom.erik.stower@entur.org - Entur - http://www.entur.org - - - - scm:git:ssh://git@github.com/entur/gbfs-validator-java.git - scm:git:ssh://git@github.com/entur/gbfs-validator-java.git - https://github.com/entur/gbfs-validator-java/tree/master - HEAD - - - - snapshots - entur2-snapshots - https://entur2.jfrog.io/entur2/libs-snapshot-local - - - - - UTF-8 - 17 - - https://github.com/entur/gbfs-json-schema/archive/refs/tags/v3.0.zip - 3.0 - - 1.14.4 - 1.7.36 - - 0.8.12 - 1.6.13 - 1.6.0 - 2.22.2 - 3.4.1 - 3.3.1 - 3.6.3 - 1.6 - 3.13.0 - 3.4.1 - 3.3.2 - 2.5.2 - 3.12.1 - 3.3.1 - 2.8.2 - 2.12 - 2.15.0 - 2.16.2 - 5.3.2 - 1.13.0 - 1.13.0 - 1.21.0 - - - - - - 3.25.3 - 5.10.2 - - - - - com.github.erosb - everit-json-schema - ${everit-json-schema.version} - - - org.slf4j - slf4j-api - ${slf4j.version} - - - com.jayway.jsonpath - json-path - 2.9.0 - - - - - org.junit.jupiter - junit-jupiter-api - ${junit.version} - test - - - org.junit.jupiter - junit-jupiter-engine - ${junit.version} - test - - - org.assertj - assertj-core - ${assertj.core.version} - test - - - org.slf4j - slf4j-simple - ${slf4j.version} - test - - - - - - - org.apache.maven.wagon - wagon-ssh-external - 2.12 - - - - - - maven-compiler-plugin - ${maven-compiler-plugin.version} - - - maven-jar-plugin - ${maven-jar-plugin.version} - - - maven-clean-plugin - ${maven-clean-plugin.version} - - - maven-install-plugin - ${maven-install-plugin.version} - - - maven-site-plugin - ${maven-site-plugin.version} - - - maven-resources-plugin - ${maven-resources-plugin.version} - - - maven-deploy-plugin - ${maven-deploy-plugin.version} - - - + + + + + 4.0.0 + + + org.entur.gbfs + + + gbfs-validator-java-parent + + + 1.0.0 + + + gbfs-validator-java-parent + + + pom + + + + + + gbfs-validator-java + + + loader + + + cli + + + + + + + + + + + sonar + + + + + + false + + + + + + + + + 3.7.0.1746 + + + + + + + + - - org.codehaus.mojo - exec-maven-plugin - ${maven-exec-plugin.version} - - - download-extract-current-version - generate-sources - - exec - - - - ${gbfsGithubUrl} - ${schemaVersion} - src/main/resources/schema - - ./bin/gbfs-download-extract.sh - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${jdk.version} - ${jdk.version} - UTF-8 - - - -Xlint:all - - - - - org.codehaus.plexus - plexus-compiler-javac - ${plexus-compiler-javac.version} - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - org.apache.maven.plugins - maven-enforcer-plugin - ${maven-enforcer-plugin.version} - - - - enforce - - - - - ${jdk.version} - - - - - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco-maven-plugin.version} - - - default-prepare-agent - - prepare-agent - - - - default-report - prepare-package - - report - - - - default-check - - check - - - - - - - - - org.codehaus.mojo - versions-maven-plugin - ${versions-maven-plugin.version} - - - org.owasp - dependency-check-maven - ${dependency-check-maven.version} - - - com.amashchenko.maven.plugin - gitflow-maven-plugin - ${gitflow-maven-plugin.version} - - false - true - [ci skip] - - master - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus-staging-maven-plugin.version} - true - - ossrh - https://oss.sonatype.org/ - true - - - - org.apache.maven.plugins - maven-source-plugin - ${maven-source-plugin.version} - - - attach-sources - - jar - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven-javadoc-plugin.version} - - -Xdoclint:none - - - - attach-javadocs - - jar - - - - + + + + + + org.sonarsource.scanner.maven + + + sonar-maven-plugin + + + ${sonar-maven-plugin.version} + + + + + - - - - sonar - - false - - - - 3.7.0.1746 - + + + + + + + + + + - - - - org.sonarsource.scanner.maven - sonar-maven-plugin - ${sonar-maven-plugin.version} - - - - - - release - - false - - - - ossrh - Sonatype release - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${maven-gpg-plugin.version} - - - sign-artifacts - - sign - - verify - - ${env.SONATYPE_GPG_KEY_PASSWORD} - - --pinentry-mode - loopback - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - true - - ossrh - https://oss.sonatype.org/ - - true - - - - - -