Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Latest commit

 

History

History
21 lines (18 loc) · 1.04 KB

README.md

File metadata and controls

21 lines (18 loc) · 1.04 KB

abstractmapping

A demo Java Code for Showing how to implement Jackson deserialization with abstracts.

  • Run locally the project (i.e.: ./mvnw spring-boot:run)
  • For getting instances of class B do the following request: { "x": "some value for x here", "y": "some value for y here", "type": "B" }
  • For getting instances of class C do the following request: { "x": "some value for x here", "z": "some value for z here", "type": "C" }

The previous requests can be performed using any commonly used tools with such purpose such as Postman or cURL.

Example in cURL:

curl -X POST --location "http://localhost:8080/demo" \
    -H "Content-Type: application/json" \
    -d "{ \"x\": \"some value for x here\", \"y\": \"some value for y here\", \"type\": \"B\" }"

and

curl -X POST --location "http://localhost:8080/demo" \
    -H "Content-Type: application/json" \
    -d "{ \"x\": \"some value for x here\", \"y\": \"some value for y here\", \"type\": \"C\" }"