Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"cliVersion": "5.16.0",
"cliVersion": "5.18.1",
"generatorName": "fernapi/fern-java-sdk",
"generatorVersion": "4.6.1",
"generatorVersion": "4.8.3",
"generatorConfig": {
"package-prefix": "com.junction.api",
"publish-to": "central",
"base-api-exception-class-name": "ApiError",
"client-class-name": "Junction",
"enable-forward-compatible-enums": true
},
"originGitCommit": "b86a13ae347b0f20883c905a1c03aaf134912701",
"originGitCommit": "3f979ee1e4cc799ef18b1ea8d8565a2dc32c5abf",
"originGitCommitIsDirty": true,
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
"sdkVersion": "1.0.0"
"sdkVersion": "1.0.1"
}
114 changes: 114 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Contributing

Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.

## Getting Started

### Prerequisites

- Java 11+
- Gradle

### Installation

Install the project dependencies:

```bash
./gradlew build
```

### Building

Build the project:

```bash
./gradlew build
```

### Testing

Run the test suite:

```bash
./gradlew test
```

### Formatting

Check and fix code style:

```bash
./gradlew spotlessApply
```

## About Generated Code

**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.

### Generated Files

The following directories contain generated code:
- `src/` - API client classes and types
- Most Java files in the project

### How to Customize

If you need to customize the SDK, you have two options:

#### Option 1: Use `.fernignore`

For custom code that should persist across SDK regenerations:

1. Create a `.fernignore` file in the project root
2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
3. Add your custom code to those files

Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.

For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).

#### Option 2: Contribute to the Generator

If you want to change how code is generated for all users of this SDK:

1. The Java SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
2. Generator code is located at `generators/java-v2/`
3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
4. Submit a pull request with your changes to the generator

This approach is best for:
- Bug fixes in generated code
- New features that would benefit all users
- Improvements to code generation patterns

## Making Changes

### Workflow

1. Create a new branch for your changes
2. Make your modifications
3. Run tests to ensure nothing breaks: `./gradlew test`
4. Run formatting: `./gradlew spotlessApply`
5. Build the project: `./gradlew build`
6. Commit your changes with a clear commit message
7. Push your branch and create a pull request

### Commit Messages

Write clear, descriptive commit messages that explain what changed and why.

### Code Style

This project uses automated code formatting. Run `./gradlew spotlessApply` before committing to ensure your code meets the project's style guidelines.

## Questions or Issues?

If you have questions or run into issues:

1. Check the [Fern documentation](https://buildwithfern.com)
2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
3. Open a new issue if your question hasn't been addressed

## License

By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Add the dependency in your `build.gradle` file:

```groovy
dependencies {
implementation 'com.junction:junction-java:1.0.0'
implementation 'com.junction:junction-java:1.0.1'
}
```

Expand All @@ -41,7 +41,7 @@ Add the dependency in your `pom.xml` file:
<dependency>
<groupId>com.junction</groupId>
<artifactId>junction-java</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
```

Expand Down Expand Up @@ -75,14 +75,6 @@ public class Example {
.provider(OAuthProviders.OURA)
.connections(
Arrays.asList(
ConnectionRecipe
.builder()
.userId("user_id")
.accessToken("access_token")
.refreshToken("refresh_token")
.providerId("provider_id")
.expiresAt(1)
.build(),
ConnectionRecipe
.builder()
.userId("user_id")
Expand Down Expand Up @@ -167,11 +159,19 @@ retry limit (default: 2). Before defaulting to exponential backoff, the SDK will
the `Retry-After` header (as either in seconds or as an HTTP date), and then the `X-RateLimit-Reset` header
(as a Unix timestamp in epoch seconds); failing both of those, it will fall back to exponential backoff.

A request is deemed retryable when any of the following HTTP status codes is returned:
Which status codes are retried depends on the `retry-status-codes` generator configuration:

**`legacy`** (current default): retries on
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)

**`recommended`**: retries on
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
- [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
- [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
- [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)

Use the `maxRetries` client option to configure this behavior.

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ java {

group = 'com.junction'

version = '1.0.0'
version = '1.0.1'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -78,7 +78,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.junction'
artifactId = 'junction-java'
version = '1.0.0'
version = '1.0.1'
from components.java
pom {
name = 'vital'
Expand Down
16 changes: 16 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 1.0.1 - 2026-05-07
* fix: fix request field serialization across all request types
* Previously, required fields like `start_date`, `zip_code`, `lab_id`,
* `user_id`, `collection_date`, and `lab` were annotated with `@JsonIgnore`,
* causing them to be omitted from serialized request bodies. Optional fields
* (`end_date`, `provider`, `cursor`, `next_cursor`, etc.) also lacked proper
* `@JsonProperty` bindings and `NullableNonemptyFilter` handling.
* This fix ensures all request fields are correctly serialized when making
* API calls, resolving silent data-loss bugs where required parameters were
* never sent to the server.
* Key changes:
* Replace `@JsonIgnore` with `@JsonProperty` on required fields across all request classes (activity, body, sleep, vitals, lab tests, link, meal, menstrual cycle, etc.)
* Add private `@JsonProperty`-annotated accessors with `NullableNonemptyFilter` for all optional (`Optional<T>`) fields to ensure correct conditional serialization
* Import `NullableNonemptyFilter` and `JsonProperty` in all affected request classes
* 🌿 Generated with Fern

## 1.0.0 - 2026-05-06
* Initial SDK generation
* 🌿 Generated with Fern
27 changes: 14 additions & 13 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -10656,10 +10656,10 @@ client.labTests().get(
GetLabTestsRequest
.builder()
.markerIds(
Arrays.asList(Optional.of(1))
Arrays.asList(1)
)
.providerIds(
Arrays.asList(Optional.of("provider_ids"))
Arrays.asList("provider_ids")
)
.generationMethod(LabTestGenerationMethodFilter.AUTO)
.labSlug("lab_slug")
Expand Down Expand Up @@ -11023,7 +11023,7 @@ client.labTests().getMarkers(
GetMarkersLabTestsRequest
.builder()
.labId(
Arrays.asList(Optional.of(1))
Arrays.asList(1)
)
.labSlug("lab_slug")
.name("name")
Expand Down Expand Up @@ -11407,10 +11407,10 @@ client.labTests().getPaginated(
GetPaginatedLabTestsRequest
.builder()
.markerIds(
Arrays.asList(Optional.of(1))
Arrays.asList(1)
)
.providerIds(
Arrays.asList(Optional.of("provider_ids"))
Arrays.asList("provider_ids")
)
.labTestLimit(1)
.nextCursor("next_cursor")
Expand Down Expand Up @@ -11605,16 +11605,16 @@ client.labTests().getOrders(
GetOrdersLabTestsRequest
.builder()
.status(
Arrays.asList(Optional.of(OrderLowLevelStatus.ORDERED))
Arrays.asList(OrderLowLevelStatus.ORDERED)
)
.orderType(
Arrays.asList(Optional.of(LabTestCollectionMethod.TESTKIT))
Arrays.asList(LabTestCollectionMethod.TESTKIT)
)
.orderActivationTypes(
Arrays.asList(Optional.of(OrderActivationType.CURRENT))
Arrays.asList(OrderActivationType.CURRENT)
)
.orderIds(
Arrays.asList(Optional.of("order_ids"))
Arrays.asList("order_ids")
)
.searchInput("search_input")
.startDate(OffsetDateTime.parse("2024-01-15T09:30:00Z"))
Expand Down Expand Up @@ -12329,7 +12329,7 @@ client.labTests().getAreaInfo(
.builder()
.zipCode("zip_code")
.labs(
Arrays.asList(Optional.of(ClientFacingLabs.QUEST))
Arrays.asList(ClientFacingLabs.QUEST)
)
.radius(AllowedRadius.TEN)
.lab(ClientFacingLabs.QUEST)
Expand Down Expand Up @@ -12413,7 +12413,7 @@ client.labTests().getPscInfo(
.zipCode("zip_code")
.labId(1)
.capabilities(
Arrays.asList(Optional.of(LabLocationCapability.STAT))
Arrays.asList(LabLocationCapability.STAT)
)
.radius(AllowedRadius.TEN)
.labAccountId("lab_account_id")
Expand Down Expand Up @@ -12495,7 +12495,7 @@ client.labTests().getOrderPscInfo(
GetOrderPscInfoLabTestsRequest
.builder()
.capabilities(
Arrays.asList(Optional.of(LabLocationCapability.STAT))
Arrays.asList(LabLocationCapability.STAT)
)
.radius(AllowedRadius.TEN)
.build()
Expand Down Expand Up @@ -12814,7 +12814,7 @@ client.labTests().getPscAppointmentAvailability(
.builder()
.lab(AppointmentPscLabs.QUEST)
.siteCodes(
Arrays.asList(Optional.of("site_codes"))
Arrays.asList("site_codes")
)
.startDate("start_date")
.zipCode("zip_code")
Expand Down Expand Up @@ -14941,6 +14941,7 @@ and starts the ParseLabReport. Returns a generated job_id.

```java
client.labReport().parserCreateJob(
null,
CreateLabReportParserJobBody
.builder()
.userId("user_id")
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/junction/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
put("User-Agent", "com.junction:junction-java/1.0.0");
put("User-Agent", "com.junction:junction-java/1.0.1");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.vital.fern:api-sdk");
put("X-Fern-SDK-Version", "1.0.0");
put("X-Fern-SDK-Version", "1.0.1");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.junction.api.core.Nullable;
import com.junction.api.core.NullableNonemptyFilter;
import com.junction.api.core.ObjectMappers;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -55,7 +57,7 @@ public Optional<String> getProvider() {
/**
* @return Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00
*/
@JsonIgnore
@JsonProperty("start_date")
public String getStartDate() {
return startDate;
}
Expand All @@ -71,6 +73,18 @@ public Optional<String> getEndDate() {
return endDate;
}

@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class)
@JsonProperty("provider")
private Optional<String> _getProvider() {
return provider;
}

@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class)
@JsonProperty("end_date")
private Optional<String> _getEndDate() {
return endDate;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand Down
Loading
Loading