Support API version 1.1 in paths
Change-Id: Ibf951092318a71cb9f9d63ac6d21a92fd7ac36f5
diff --git a/Changes b/Changes
index 7a79201..8f6725a 100644
--- a/Changes
+++ b/Changes
@@ -1,9 +1,10 @@
-v0.63.1 2026-01-15
- - Fix hint foundry selection (kupietz)
+0.64 2026-01-15
+ - Support API version 1.1 (diewald)
0.63 2026-01-15
- Add data-testid to test relevant elements (fixes #244; diewald)
- Make hint foundries configurable (fixes #173; kupietz)
+ - Fix hint foundry selection (kupietz)
0.62 2025-12-05
- Fixed white box under query field glitch (kupietz, diewald)
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index 6c03406..0914943 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -8,10 +8,11 @@
use List::Util qw!none uniq!;
# Minor version - may be patched from package.json
-our $VERSION = '0.63.1';
+our $VERSION = '0.64';
# Supported version of Backend API
our $API_VERSION = '1.0';
+our $API_VERSION_SUPPORTED = ['1.0','1.1'];
# TODO: The FAQ-Page has a contact form for new questions
# TODO: Embed query serialization
@@ -436,8 +437,8 @@
$r->get('/contact')->mail_to_chiffre('documentation#contact');
# API proxy route
- $r->any('/api/v#apiv' => [apiv => ['1.0']])->name('proxy')->to('Proxy#api_pass');
- $r->any('/api/v#apiv/*proxy_path' => [apiv => ['1.0']])->to('Proxy#api_pass');
+ $r->any('/api/v#apiv' => [apiv => $API_VERSION_SUPPORTED])->name('proxy')->to('Proxy#api_pass');
+ $r->any('/api/v#apiv/*proxy_path' => [apiv => $API_VERSION_SUPPORTED])->to('Proxy#api_pass');
# General proxy mounts
my $proxies = $conf->{'proxies'} // [];
diff --git a/package.json b/package.json
index 3795a30..d618c08 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "Kalamar",
"description": "Mojolicious-based Frontend for KorAP",
"license": "BSD-2-Clause",
- "version": "0.63.1",
+ "version": "0.64.0",
"pluginVersion": "0.2.3",
"engines": {
"node": ">=6.0.0"
diff --git a/t/fixtures.t b/t/fixtures.t
index c3fbfdc..9816fe6 100644
--- a/t/fixtures.t
+++ b/t/fixtures.t
@@ -10,7 +10,7 @@
$t->get_ok('/v1.0')
->status_is(200)
- ->content_is('Fake server available');
+ ->content_is('Fake server available: 1.0');
$t->get_ok('/v1.0/search?ql=cosmas3')
->status_is(400)
diff --git a/t/plugin/auth-oauth.t b/t/plugin/auth-oauth.t
index f1349a6..04fcc3c 100644
--- a/t/plugin/auth-oauth.t
+++ b/t/plugin/auth-oauth.t
@@ -101,7 +101,7 @@
$t->get_ok('/realapi/v1.0')
->status_is(200)
- ->content_is('Fake server available');
+ ->content_is('Fake server available: 1.0');
$t->get_ok('/?q=Baum')
->status_is(200)
diff --git a/t/plugin/query_reference.t b/t/plugin/query_reference.t
index 56053c7..d54891a 100644
--- a/t/plugin/query_reference.t
+++ b/t/plugin/query_reference.t
@@ -96,7 +96,7 @@
$t->get_ok('/realapi/v1.0')
->status_is(200)
- ->content_is('Fake server available')
+ ->content_is('Fake server available: 1.0')
;
# Login
diff --git a/t/proxy.t b/t/proxy.t
index 5d5280a..3c7e4ea 100644
--- a/t/proxy.t
+++ b/t/proxy.t
@@ -56,9 +56,15 @@
$t->get_ok('/realapi/v1.0')
->status_is(200)
- ->content_is('Fake server available')
+ ->content_is('Fake server available: 1.0')
;
+$t->get_ok('/realapi/v1.1')
+ ->status_is(200)
+ ->content_is('Fake server available: 1.1')
+ ;
+
+
is($rendered, 1);
$t->get_ok('/api/v1.0/')
@@ -68,7 +74,7 @@
->header_is('Connection', 'close')
->header_is('Access-Control-Allow-Origin', '*')
->header_is('Access-Control-Allow-Methods', 'GET, OPTIONS')
- ->content_is('Fake server available')
+ ->content_is('Fake server available: 1.0')
;
# Proxy renders
diff --git a/t/server/mock.pl b/t/server/mock.pl
index 1af2fb0..0aa8a9b 100644
--- a/t/server/mock.pl
+++ b/t/server/mock.pl
@@ -111,11 +111,11 @@
app->defaults('oauth.pluginin_list' => []);
# Base page
-get '/v1.0/' => sub {
- shift->render(text => 'Fake server available');
+get '/v#apiv' => [apiv => ['1.0','1.1']] => sub {
+ my $c = shift;
+ $c->render(text => 'Fake server available: ' . $c->stash('apiv'));
};
-
get '/v1.0/redirect-target-a' => sub {
shift->render(text => 'Redirect Target!');
} => 'redirect-target';