Submit Search
Upload
Json mapping in Play framework
•
0 likes
•
540 views
AI-enhanced title
F
Fabian Gutierrez
Follow
An introduction to json mapping in play! covering reads, writes and path search
Read less
Read more
Technology
Report
Share
Report
Share
1 of 13
Download now
Download to read offline
Recommended
X-jobb Daniel och Xing
X-jobb Daniel och Xing
xing tan
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streams
Johan Andrén
Tutorial ads
Tutorial ads
John Fernando Rocha
Asynchronous stream processing with Akka Streams
Asynchronous stream processing with Akka Streams
Johan Andrén
Núncio esteve ligado ao registo de cerca de 120 novas sociedades na zona fran...
Núncio esteve ligado ao registo de cerca de 120 novas sociedades na zona fran...
Do outro lado da barricada
Akka stream
Akka stream
Masaki Toyoshima
PocketConfidant chatbot
PocketConfidant chatbot
Chatbots Paris
Extrusion molding
Extrusion molding
Habib ur Rehman
Recommended
X-jobb Daniel och Xing
X-jobb Daniel och Xing
xing tan
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streams
Johan Andrén
Tutorial ads
Tutorial ads
John Fernando Rocha
Asynchronous stream processing with Akka Streams
Asynchronous stream processing with Akka Streams
Johan Andrén
Núncio esteve ligado ao registo de cerca de 120 novas sociedades na zona fran...
Núncio esteve ligado ao registo de cerca de 120 novas sociedades na zona fran...
Do outro lado da barricada
Akka stream
Akka stream
Masaki Toyoshima
PocketConfidant chatbot
PocketConfidant chatbot
Chatbots Paris
Extrusion molding
Extrusion molding
Habib ur Rehman
Zen of Akka
Zen of Akka
Konrad Malawski
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
OpenCredo
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Lightbend
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutes
Konrad Malawski
Event-sourced architectures with Akka
Event-sourced architectures with Akka
Sander Mak (@Sander_Mak)
Chatbot Voyages SNCF
Chatbot Voyages SNCF
Chatbots Paris
Using university global connections to support entrepreneurial capacity build...
Using university global connections to support entrepreneurial capacity build...
Joshua Flannery
հուդաիզմ
հուդաիզմ
Mane Boyakhyan
բուդդա
բուդդա
Mane Boyakhyan
презентація виховного заходу
презентація виховного заходу
ltasenko
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017
Chris Simmonds
Visual Design with Data
Visual Design with Data
Seth Familian
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Miki Katsuragi
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
charlottematthew16
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
Stephanie Beckett
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
LoriGlavin3
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Kalema Edgar
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
Rizwan Syed
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Pixlogix Infotech
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Florian Wilhelm
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Slibray Presentation
More Related Content
Viewers also liked
Zen of Akka
Zen of Akka
Konrad Malawski
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
OpenCredo
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Lightbend
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutes
Konrad Malawski
Event-sourced architectures with Akka
Event-sourced architectures with Akka
Sander Mak (@Sander_Mak)
Chatbot Voyages SNCF
Chatbot Voyages SNCF
Chatbots Paris
Using university global connections to support entrepreneurial capacity build...
Using university global connections to support entrepreneurial capacity build...
Joshua Flannery
հուդաիզմ
հուդաիզմ
Mane Boyakhyan
բուդդա
բուդդա
Mane Boyakhyan
презентація виховного заходу
презентація виховного заходу
ltasenko
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017
Chris Simmonds
Visual Design with Data
Visual Design with Data
Seth Familian
Viewers also liked
(12)
Zen of Akka
Zen of Akka
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutes
Event-sourced architectures with Akka
Event-sourced architectures with Akka
Chatbot Voyages SNCF
Chatbot Voyages SNCF
Using university global connections to support entrepreneurial capacity build...
Using university global connections to support entrepreneurial capacity build...
հուդաիզմ
հուդաիզմ
բուդդա
բուդդա
презентація виховного заходу
презентація виховного заходу
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017
Visual Design with Data
Visual Design with Data
Recently uploaded
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Miki Katsuragi
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
charlottematthew16
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
Stephanie Beckett
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
LoriGlavin3
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Kalema Edgar
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
Rizwan Syed
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Pixlogix Infotech
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Florian Wilhelm
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Slibray Presentation
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
gvaughan
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Enterprise Knowledge
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
comworks
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Precisely
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
Manik S Magar
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Mark Simos
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Addepto
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Lorenzo Miniero
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
charlottematthew16
Recently uploaded
(20)
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
Json mapping in Play framework
1.
Json mapping in
pLAY! Fabian Gutierrez
2.
Mandatory verbose java
example Jonathan @JsonInclude(JsonInclude.Include.NON_NULL) @Generated("org.jsonschema2pojo") @JsonPropertyOrder({ "name", "age" }) public class Actor { @JsonProperty("nombre") private String name; @JsonProperty("age") private Integer age; … }
3.
4.
Seriously ● Building JsValues ●
Reads ● Writes ● Paths
5.
Play’s json mapper
6.
Building a JsValue Types ●
JsString ● JsNumber ● JsBoolean ● JsObject ● JsArray ● JsNull Json.parse(""" |{ | "name" : "Jennifer", | "Age": 26 |} """.stripMargin )
7.
The Reader
8.
Reading Json case class
Actor(name: String, age: Int) object Actor { // or default values implicit val actorReads = Json.reads[Actor] // functional syntax implicit val actorReads: Reads[Actor] = ( (JsPath "nombre").read[String] and (JsPath "age").read[Int] )(Actor.apply _) }
9.
The (ghost) writer
10.
Writing Json object Actor
{ //default values implicit val actorWrites = Json.writes[Actor] //or total control implicit val actorWrites = new Writes[Actor] { def writes(actor: Actor) = Json.obj( "name" -> actor.name, "age" -> actor.age ) } //or functional syntax implicit val actorWrites: Writes[Actor] = ( (JsPath "name").write[String] and (JsPath "age").write[Int] )(unlift(Actor.unapply)) }
11.
12.
Paths // direct parsing val
jsPerson: JsObject = ... (jsPerson "name").as[String] (jsPerson "age").as[Int] // as optionals val jsPersonList: JsObject = ... (jsPersonList "name").asOpt[List[String]]
13.
https://github.com/fagossa/xke_play_json
Download now