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,14 +1,14 @@
{
"cliVersion": "5.1.0",
"cliVersion": "5.28.2",
"generatorName": "fernapi/fern-java-sdk",
"generatorVersion": "4.6.4",
"generatorVersion": "4.8.10",
"generatorConfig": {
"publish-to": "central"
},
"originGitCommit": "57be6b5662276253461696b49ad9ff6448cc29f3",
"originGitCommit": "f44434d1b1da5712ce6098d90232ec46cf645a0d",
"originGitCommitIsDirty": true,
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
"sdkVersion": "2.1.1"
"sdkVersion": "3.0.0"
}
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.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Add the dependency in your `build.gradle` file:

```groovy
dependencies {
implementation 'com.newscatcherapi:newscatcher-sdk:2.1.1'
implementation 'com.newscatcherapi:newscatcher-sdk:3.0.0'
}
```

Expand All @@ -55,7 +55,7 @@ Add the dependency in your `pom.xml` file:
<dependency>
<groupId>com.newscatcherapi</groupId>
<artifactId>newscatcher-sdk</artifactId>
<version>2.1.1</version>
<version>3.0.0</version>
</dependency>
```

Expand Down Expand Up @@ -261,11 +261,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/500) (Internal Server Errors)
- [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)
- [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 Expand Up @@ -355,3 +363,4 @@ For release notes and changelog, visit our [GitHub releases page](https://github




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.newscatcherapi'

version = '2.1.1'
version = '3.0.0'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -78,7 +78,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.newscatcherapi'
artifactId = 'newscatcher-sdk'
version = '2.1.1'
version = '3.0.0'
from components.java
pom {
name = 'newscatcher'
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 3.0.0 - 2026-05-19
### Breaking Changes
* **`NlpDataEntity.getSummaryTranslated()`** — renamed to `getTranslationSummary()`; the underlying JSON field also changed from `summary_translated` to `translation_summary`. Update all call sites to use `getTranslationSummary()` and `Builder.translationSummary(...)`.
* **`To.Visitor`** — the `visit(OffsetDateTime)` and `visit(String)` method order in the `Visitor` interface is swapped; any anonymous or lambda implementations must reorder their overrides accordingly.
### Fixed
* **`GetAggregationCountRequest`**, **`GetAuthorsRequest`**, and **`GetBreakingNewsRequest`** — getter methods were annotated `@JsonIgnore` instead of `@JsonProperty`, causing all query parameters to be silently dropped from GET requests; they are now correctly annotated and transmitted.

## 2.1.1 - 2026-04-30
* fix: use field-presence checks in union deserializers to prevent misclassification
* Previously, all union response deserializers attempted blind `convertValue`
Expand Down
34 changes: 10 additions & 24 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ client.search().get(
From.of(OffsetDateTime.parse("1 day ago"))
)
.to(
To.of(OffsetDateTime.parse("1 day ago"))
To.of("now")
)
.publishedDatePrecision("full")
.byParseDate(true)
Expand Down Expand Up @@ -146,7 +146,9 @@ Multiple countries with the number of top sources can be specified as a comma-se

Word or phrase to search within the source names. To specify multiple values, use a comma-separated string.

**Note**: The search doesn't require an exact match and returns sources containing the specified terms in their names. You can use any word or phrase, like `"sport"` or `"new york times"`. For example, `"sport"` returns sources such as `"Motorsport"`, `"Dot Esport"`, and `"Tuttosport"`.
**Note**: The search doesn't require an exact match and returns sources containing the specified terms in their names. You can use any word or phrase, like `"sport"` or `"new york times"`.

For example, `"sport"` returns sources such as `"Motorsport"`, `"Dot Esport"`, and `"Tuttosport"`.

</dd>
</dl>
Expand Down Expand Up @@ -2561,7 +2563,7 @@ client.authors().get(
From.of(OffsetDateTime.parse("1 day ago"))
)
.to(
To.of(OffsetDateTime.parse("1 day ago"))
To.of("now")
)
.publishedDatePrecision("full")
.byParseDate(true)
Expand Down Expand Up @@ -3475,7 +3477,7 @@ client.searchByLink().get(
From.of(OffsetDateTime.parse("1 day ago"))
)
.to(
To.of(OffsetDateTime.parse("1 day ago"))
To.of("now")
)
.page(2)
.pageSize(50)
Expand Down Expand Up @@ -3630,15 +3632,6 @@ client.searchByLink().post(
<dd>

**from:** `Optional<From>`

The starting point in time to search from. Accepts date-time strings in ISO 8601 format and plain text strings. The default time zone is UTC.

Formats with examples:
- YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
- YYYY-MM-dd: `2024-07-01`
- YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
- YYYY/mm/dd: `2024/07/01`
- English phrases: `1 day ago`, `today`

</dd>
</dl>
Expand All @@ -3647,15 +3640,6 @@ Formats with examples:
<dd>

**to:** `Optional<To>`

The ending point in time to search up to. Accepts date-time strings in ISO 8601 format and plain text strings. The default time zone is UTC.

Formats with examples:
- YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
- YYYY-MM-dd: `2024-07-01`
- YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
- YYYY/mm/dd: `2024/07/01`
- English phrases: `1 day ago`, `now`

</dd>
</dl>
Expand Down Expand Up @@ -3790,7 +3774,9 @@ Multiple countries with the number of top sources can be specified as a comma-se

Word or phrase to search within the source names. To specify multiple values, use a comma-separated string.

**Note**: The search doesn't require an exact match and returns sources containing the specified terms in their names. You can use any word or phrase, like `"sport"` or `"new york times"`. For example, `"sport"` returns sources such as `"Motorsport"`, `"Dot Esport"`, and `"Tuttosport"`.
**Note**: The search doesn't require an exact match and returns sources containing the specified terms in their names. You can use any word or phrase, like `"sport"` or `"new york times"`.

For example, `"sport"` returns sources such as `"Motorsport"`, `"Dot Esport"`, and `"Tuttosport"`.

</dd>
</dl>
Expand Down Expand Up @@ -4053,7 +4039,7 @@ client.aggregationCount().get(
From.of(OffsetDateTime.parse("1 day ago"))
)
.to(
To.of(OffsetDateTime.parse("1 day ago"))
To.of("now")
)
.publishedDatePrecision("full")
.byParseDate(true)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/newscatcher/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.newscatcherapi:newscatcher-sdk/2.1.1");
put("User-Agent", "com.newscatcherapi:newscatcher-sdk/3.0.0");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.newscatcher.fern:api-sdk");
put("X-Fern-SDK-Version", "2.1.1");
put("X-Fern-SDK-Version", "3.0.0");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Loading
Loading