Skip to content

Java uses the default JSON endpoint and still accepts the old one - #23

Merged
jwrosewell merged 2 commits into
rcfrom
java-default-json-endpoint
Nov 10, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
java-default-json-endpoint

Conversation

@jwrosewell

Copy link
Copy Markdown
Contributor

Problem

The Java descriptor in Examples/ExampleApps.cs sets JsonEndpointPath to /51Degrees.core.json. The specification's path is /51dpipeline/json, which .NET and Go use and which is this suite's default. 51degrees-java draft #80 (head 2d741ef6) makes Java default to /51dpipeline/json and still answer the old path, and the script it serves calls /51dpipeline/json. With the old override the session storage cache test proxies and counts only /51Degrees.core.json, so Java #80's full build fails with "the first page must call the json endpoint at least once".

Change

  1. The Java descriptor no longer overrides JsonEndpointPath, so Java uses the default like the other languages.
  2. ExampleDescriptor gains AlternativeJsonEndpointPaths, older paths an integration still answers. Java lists /51Degrees.core.json there.
  3. ExampleApps.JsonEndpointPaths returns the default plus those alternatives. TestHelpers.ExampleProxyListener proxies every path in the list, and the session storage cache test counts POSTs to any of them.

The suite therefore passes against Java rc (script calls /51Degrees.core.json) and against Java #80 (script calls /51dpipeline/json). The merge order does not matter, and the alternative path can be removed once Java #80 has reached rc and main.

How this was checked

Java's CI clones this repository's main in ci/run-integration-tests.ps1 (line 97), honouring an environment variable SELENIUM_TESTS_REF. Nothing in common-ci's nightly-pull-request.yml or Java's workflows sets that variable or accepts one, so Java #80's full build cannot be pointed at this branch without changing 51degrees-java or merging here. It has not been run against this branch. This repository has no secrets, so its own workflow cannot run the Contract tests either.

This repository's own Build and test workflow runs on this pull request and proves the change compiles and the non-browser tests pass.

Remaining

After merge, rerun Java #80's full build (and Java rc's) to confirm the contract tests pass with both script paths.

@jwrosewell
jwrosewell changed the base branch from main to rc November 10, 2026 08:36
@jwrosewell
jwrosewell marked this pull request as ready for review November 10, 2026 08:44
@jwrosewell
jwrosewell merged commit 345a4a6 into rc Nov 10, 2026
4 of 5 checks passed
@jwrosewell jwrosewell mentioned this pull request Nov 10, 2026
jwrosewell added a commit that referenced this pull request Nov 10, 2026
* Find the Java example in 51degrees-java (#16)

* Find the dotnet example in 51degrees-dotnet (#17)

device-detection-dotnet-examples has moved into 51degrees-dotnet, under
examples/device-detection. Both dotnet demos, pmp-web and GettingStarted-Web,
are found there as siblings, and the docs name the monorepo.

* Find the Node example in 51degrees-node (#18)

* Find the Node example in 51degrees-node

* Copy the monorepo packages in when installing the Node example

* Check that only rc merges into the default branch (#19)

* Find the Python example in 51degrees-python (#20)

* Find the PHP example in 51degrees-php (#21)

* Java uses the default JSON endpoint and still accepts the old one (#23)

* Let Java use the default JSON endpoint and still accept its old one

* Say once which JSON path each language uses

---------

Co-authored-by: ben51degrees <ben@51degrees.com>
Co-authored-by: Jamesr51d <122470673+Jamesr51d@users.noreply.github.com>
Co-authored-by: Eugene Dorfman <justadreamer2007@gmail.com>
jwrosewell added a commit that referenced this pull request Nov 11, 2026
* Find the Java example in 51degrees-java (#16)

* Find the dotnet example in 51degrees-dotnet (#17)

device-detection-dotnet-examples has moved into 51degrees-dotnet, under
examples/device-detection. Both dotnet demos, pmp-web and GettingStarted-Web,
are found there as siblings, and the docs name the monorepo.

* Find the Node example in 51degrees-node (#18)

* Find the Node example in 51degrees-node

* Copy the monorepo packages in when installing the Node example

* Check that only rc merges into the default branch (#19)

* Find the Python example in 51degrees-python (#20)

* Find the PHP example in 51degrees-php (#21)

* Java uses the default JSON endpoint and still accepts the old one (#23)

* Let Java use the default JSON endpoint and still accept its old one

* Say once which JSON path each language uses

* Give the .NET example the _51DEGREES_ variable names alongside the old ones (#25)

* Test that the .NET example is given the underscore variable names

The .NET cloud web example reads the resource key from
_51DEGREES_RESOURCE_KEY and the cloud endpoint from
_51DEGREES_CLOUD_ENDPOINT, with no other name, once its rename is
released.

* Give the .NET example the _51DEGREES_ variable names

The .NET cloud web example now reads the resource key from
_51DEGREES_RESOURCE_KEY and the endpoint from _51DEGREES_CLOUD_ENDPOINT,
with no other name. Released versions of it read SUPER_RESOURCE_KEY and
FIFTYONE_CLOUD_ENDPOINT, so the harness sets both pairs until every
language has released with the new names.

---------

Co-authored-by: ben51degrees <ben@51degrees.com>
Co-authored-by: Jamesr51d <122470673+Jamesr51d@users.noreply.github.com>
Co-authored-by: Eugene Dorfman <justadreamer2007@gmail.com>
@jwrosewell jwrosewell mentioned this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant