Skip to content

Spring's JSON parser cannot convert it into a Java object #63

@youyunfong

Description

@youyunfong

Hello, I'm from the spring , and I'm having a little trouble using RESTful Web.
I got the zip folder according to your document, which is maven and java.

Then I set Value, Quote, and ConsumingRestApplication according to the document.

But it gave an error when I ran it later.
The error message I encountered showed that Spring Boot had a problem trying to get a JSON response from a RESTful API.
Specifically, the error was because it couldn't parse the returned JSON data. It may be that the data format returned by the requested API does not meet the expectations, and Spring's JSON parser cannot convert it into a Java object.

I asked copilot, and it suggested that I could add a controller class to handle the .../api/random request, and then it ran successfully. I want to know the reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions