Skip to content

Conversation

@xC0dex
Copy link
Collaborator

@xC0dex xC0dex commented Oct 21, 2025

WIP

Currently not working:

  • Deserializing authentication with Spring Boot.

Problem

Our current Java integration lacks several configuration properties and doesn’t consistently use type-safe structures.

Solution

This PR introduces several improvements:

  • Added enums for specific types (e.g., ScalarTheme) to ensure stronger type safety.
  • Auto-generated ScalarClient and ScalarTarget enums (like in our .NET integration).
  • Refactored the structure to align (mostly) with the .NET integration.
  • Added a AbstractScalarController class as a base class for other controllers.
  • Added a ConfigureProperties() method in AbstractScalarController, allowing configuration updates before JSON serialization.
  • Replaced manual string construction with a proper JSON serializer.
  • Update the Renovate configuration to disable certain updates for the Java integration.

⚠️ There are some breaking changes:

The following string-based properties have been replaced with enum-based properties:

  • theme field and getTheme()/setTheme() methods
  • layout field and getLayout()/setLayout() methods
  • documentDownloadType field and getDocumentDownloadType()/setDocumentDownloadType() methods

The ScalarSource class has been moved from a nested class in ScalarProperties to a standalone class in the config package:

  • Old location: com.scalar.maven.webjar.ScalarProperties.ScalarSource
  • New location: com.scalar.maven.webjar.config.ScalarSource

Checklist

I've gone through the following:

  • I've added an explanation why this change is needed.
  • I've added a changeset (pnpm changeset).
  • I've added tests for the regression or new feature.
  • I've updated the documentation.

@changeset-bot
Copy link

changeset-bot bot commented Oct 21, 2025

🦋 Changeset detected

Latest commit: 1d5f6f7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@scalar/webjar Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hanspagel hanspagel changed the title feat: improved java types, structure and serialization feat(java): improved types, structure and serialization Oct 21, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

Scalar CDN Snapshot Diff Results

failed  18 failed
passed  1 passed

Details

report  Open report ↗︎
stats  19 tests across 1 suite
duration  38.9 seconds
commit  1d5f6f7
info  These tests are non-blocking and will not prevent merging of your PR.

Failed tests

test-snapshots/snapshot.e2e.ts › Diff with CDN - Scalar Galaxy
test-snapshots/snapshot.e2e.ts › Diff with CDN - Scalar Galaxy Registry
test-snapshots/snapshot.e2e.ts › Diff with CDN - Scalar Galaxy (Classic Layout)
test-snapshots/snapshot.e2e.ts › Diff with CDN - Stripe
test-snapshots/snapshot.e2e.ts › Diff with CDN - Relative URL Example
test-snapshots/snapshot.e2e.ts › Diff with CDN - Swagger Petstore 2.0
test-snapshots/snapshot.e2e.ts › Diff with CDN - Swagger Petstore 3.0
test-snapshots/snapshot.e2e.ts › Diff with CDN - Swagger Petstore 3.1
test-snapshots/snapshot.e2e.ts › Diff with CDN - Hello World (string)
test-snapshots/snapshot.e2e.ts › Diff with CDN - Valtown
test-snapshots/snapshot.e2e.ts › Diff with CDN - Zoom
test-snapshots/snapshot.e2e.ts › Diff with CDN - Cloudinary
test-snapshots/snapshot.e2e.ts › Diff with CDN - Tailscale
test-snapshots/snapshot.e2e.ts › Diff with CDN - Maersk
test-snapshots/snapshot.e2e.ts › Diff with CDN - Bolt
test-snapshots/snapshot.e2e.ts › Diff with CDN - OpenStatus
test-snapshots/snapshot.e2e.ts › Diff with CDN - Spotify
test-snapshots/snapshot.e2e.ts › Diff with CDN - Circular

Important

These tests detect visual differences between the current PR and the latest CDN build which means they may be affected by other changes in main that haven't been released yet.

They can help determine if the changes in the PR are causing any unexpected visual regressions but may be less helpful in isolating the exact cause. For more details see the readme.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

Scalar Components Snapshot Test Results

passed  152 passed

Details

report  Open report ↗︎
stats  152 tests across 19 suites
duration  46.1 seconds
commit  1d5f6f7

@scalar-docs
Copy link

scalar-docs bot commented Oct 21, 2025

Scalar Docs Preview

Project
guides.scalar.com

Commit
53dfe66

Status
✅ Ready

Preview
Open Preview


Updated (UTC): Oct 27, 2025, 8:11 AM

To edit notification comments on pull requests, go to your Scalar project settings

@xC0dex xC0dex force-pushed the feat/java-improvements branch 6 times, most recently from ae9b954 to e5965ac Compare October 27, 2025 08:08
@xC0dex xC0dex force-pushed the feat/java-improvements branch from e5965ac to 53dfe66 Compare October 27, 2025 08:09
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