|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Create model to Parse YAML data in IIB |
« View previous topic :: View next topic » |
Author |
Message
|
syedh2993 |
Posted: Tue Jun 19, 2018 10:47 am Post subject: Create model to Parse YAML data in IIB |
|
|
Newbie
Joined: 19 Jun 2018 Posts: 1
|
Hi all,
I want to create message model to parse YAML data in IIB 9. How do I create YAML parser to parse the data?
Since YAML is superset of JSON I cannot use JSON parser right ?
Do I use DFDL parser to create schema then? if so how do I proceed ? |
|
Back to top |
|
 |
abhi_thri |
Posted: Wed Jun 20, 2018 12:24 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
hi...yaml support is available for mapping nodes from 10.0.0.6 onwards, see infocenter topic
Quote: |
Since YAML is superset of JSON I cannot use JSON parser right ? |
Have you tried it? if so what was the result? |
|
Back to top |
|
 |
martinb |
Posted: Wed Jun 20, 2018 3:28 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
Hi
IIB does not currently provide a YAML parser.
The IIB JSON parser does not require a message model.
Note the Graphical Data Mapper, which needs a model to visualize the data, can use a JSON schema, or Swagger document formatted in YAML - but the message data would be JSON, and the flow would use the IIB JSON parser.
While you could probably create a DFDL model to parse a specific YAML data structure, it would not be a good approach in my view.
You could consider having the YAML read into the message flow as BLOB data, then use a Java library, such as Jackson, to parse and construct a logical message tree etc.
Also you might consider opening a RFE to get YAML parser support added to IIB. |
|
Back to top |
|
 |
timber |
Posted: Wed Jun 20, 2018 3:29 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
@abhi_thri: You're correct that IIB can import a YAML file that specifies the OpenAPI/Swagger metadata for a REST API. But the OP is not trying to solve that problem. They are trying to parse a general-purpose YAML document in the same way that you might parse an XML or a JSON document.
@syedh2993: Not sure that DFDL would be the best solution for a format like YAML. IIB does not have a YAML domain but you could probably parse your YAML using the BLOB domain, then use a Java class library like Jackson to parse it. Or better, write yourself a plug-in parser for IIB and build a message tree from the parsed YAML. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|