Skip to content

(Http-Client) Support Jsonb SubTypes in request body #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2023

Conversation

SentryMan
Copy link
Collaborator

@SentryMan SentryMan commented Mar 12, 2023

The use of .getClass() means that jsonb subtypes cannot work.

@Client
public interface Client {

  @Post("/resource")
  public Response createResource(ExtendableObject object);

}

Providing an ExtendingObject that extends ExtendableObject means that the JsonAdapter for ExtendableObject is not used, so the @type field is lost. This PR fixes that.

  • Adds new body methods to HttpClientRequest to take the type parameter
  • now generated clients will provide the type parameters

@SentryMan SentryMan changed the title Support Jsonb SubTypes (Http-Client) Support Jsonb SubTypes Mar 12, 2023
@SentryMan SentryMan changed the title (Http-Client) Support Jsonb SubTypes (Http-Client) Support Jsonb SubTypes in request body Mar 12, 2023
@rbygrave rbygrave added this to the 1.31 milestone Mar 12, 2023
@rbygrave rbygrave merged commit 1452cae into avaje:master Mar 12, 2023
@SentryMan SentryMan deleted the subtype branch March 12, 2023 22:16
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.

2 participants