├── .gitignore ├── LICENSE ├── README.md ├── fix2json ├── logs │ └── JsonOutput.txt ├── res │ ├── SampleMessage.txt │ ├── fields.xml │ ├── header.xml │ └── trailer.xml └── src │ └── org │ └── fixtradingcommunity │ └── fix2json.java ├── go ├── README.md └── msg_test.go ├── java ├── README.md ├── pom.xml └── src │ └── test │ └── java │ └── org │ └── fixtradingcommunity │ └── MsgTest.java ├── javascript ├── README.md └── msg_test.js ├── orchestra2json ├── Readme.md ├── pom.xml └── src │ ├── main │ └── resources │ │ └── xsl │ │ ├── AddJsonDatatypes.xslt │ │ └── OrchestraToJSONSchema.xslt │ └── test │ └── resources │ └── mit_2016.xml └── ruby ├── .ruby-version ├── README.md └── msg_test.rb /.gitignore: -------------------------------------------------------------------------------- 1 | java/target/ 2 | scratch/ 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fix-json-encoding 2 | 3 | Resources and sample code for JSON encoding of FIX. 4 | 5 | ## Specification 6 | 7 | For the normative specification, see [FIXTradingCommunity/fix-json-encoding-spec](https://github.com/FIXTradingCommunity/fix-json-encoding-spec) 8 | 9 | ## License 10 | 11 | FIX JSON Encoding is © Copyright 2016-2017 FIX Protocol Limited. 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); 14 | you may not use this file except in compliance with the License. 15 | You may obtain a copy of the License at 16 | 17 | http://www.apache.org/licenses/LICENSE-2.0 18 | 19 | Unless required by applicable law or agreed to in writing, software 20 | distributed under the License is distributed on an "AS IS" BASIS, 21 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | See the License for the specific language governing permissions and 23 | limitations under the License. 24 | 25 | ## Examples 26 | 27 | - [Go](go/) 28 | - [Java](java/) 29 | - [Javascript](javascript/) 30 | - [Ruby](ruby/) 31 | 32 | 33 | -------------------------------------------------------------------------------- /fix2json/logs/JsonOutput.txt: -------------------------------------------------------------------------------- 1 | 2 | ----------------- 3 | { 4 | "Header": { 5 | "BeginString": "FIX.4.2", 6 | "BodyLength": "132", 7 | "MsgType": "D", 8 | "MsgSeqNum": "16", 9 | "SenderCompID": "BANZAI", 10 | "SendingTime": "20160312-20:00:05.518", 11 | "TargetCompID": "EXEC" 12 | }, 13 | "Body":{ 14 | "ClOrdID": "1457812805394", 15 | "HandlInst": "1", 16 | "OrderQty": "100", 17 | "OrdType": "1", 18 | "Side": "1", 19 | "Symbol": "VOD.L", 20 | "TimeInForce": "0", 21 | "TransactTime": "20160312-20:00:05.518" 22 | }, 23 | "Trailer":{ 24 | "CheckSum": "198" 25 | } 26 | } 27 | ----------------- 28 | { 29 | "Header": { 30 | "BeginString": "FIX.4.2", 31 | "BodyLength": "74", 32 | "MsgType": "A", 33 | "MsgSeqNum": "138", 34 | "SenderCompID": "FIXIMULATOR", 35 | "SendingTime": "20080713-09:54:16.376", 36 | "TargetCompID": "BANZAI" 37 | }, 38 | "Body":{ 39 | "EncryptMethod": "0", 40 | "HeartBtInt": "30" 41 | }, 42 | "Trailer":{ 43 | "CheckSum": "129" 44 | } 45 | } 46 | ----------------- 47 | { 48 | "Header": { 49 | "BeginString": "FIX.4.2", 50 | "BodyLength": "194", 51 | "MsgType": "6", 52 | "MsgSeqNum": "141", 53 | "SenderCompID": "FIXIMULATOR", 54 | "SendingTime": "20080713-09:54:28.295", 55 | "TargetCompID": "BANZAI" 56 | }, 57 | "Body":{ 58 | "Currency": "USD", 59 | "IDSource": "5", 60 | "IOIid": "I1215942868296", 61 | "IOIShares": "61000", 62 | "IOITransType": "N", 63 | "Price": "27.7884", 64 | "SecurityID": "KPA.N", 65 | "Side": "2", 66 | "Symbol": "KPA", 67 | "ValidUntilTime": "20080713-10:24:28.294", 68 | "SecurityDesc": "INNKEEPERS USA TRUST", 69 | "IOINaturalFlag": "N" 70 | }, 71 | "Trailer":{ 72 | "CheckSum": "041" 73 | } 74 | } 75 | ----------------- 76 | { 77 | "Header": { 78 | "BeginString": "FIX.4.2", 79 | "BodyLength": "62", 80 | "MsgType": "0", 81 | "MsgSeqNum": "139", 82 | "SenderCompID": "BANZAI", 83 | "SendingTime": "20080713-09:54:46.592", 84 | "TargetCompID": "FIXIMULATOR" 85 | }, 86 | "Body":{ 87 | }, 88 | "Trailer":{ 89 | "CheckSum": "088" 90 | } 91 | } -------------------------------------------------------------------------------- /fix2json/res/SampleMessage.txt: -------------------------------------------------------------------------------- 1 | 8=FIX.4.29=13235=D34=1649=BANZAI52=20160312-20:00:05.51856=EXEC11=145781280539421=138=10040=154=155=VOD.L59=060=20160312-20:00:05.51810=198 2 | 8=FIX.4.29=7435=A34=13849=FIXIMULATOR52=20080713-09:54:16.37656=BANZAI98=0108=3010=129 3 | 8=FIX.4.29=19435=634=14149=FIXIMULATOR52=20080713-09:54:28.29556=BANZAI15=USD22=523=I121594286829627=6100028=N44=27.788448=KPA.N54=255=KPA62=20080713-10:24:28.294107=INNKEEPERS USA TRUST130=N10=041 4 | 8=FIX.4.29=6235=034=13949=BANZAI52=20080713-09:54:46.59256=FIXIMULATOR10=088 5 | -------------------------------------------------------------------------------- /fix2json/res/fields.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | -------------------------------------------------------------------------------- /fix2json/res/header.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | -------------------------------------------------------------------------------- /fix2json/res/trailer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /fix2json/src/org/fixtradingcommunity/fix2json.java: -------------------------------------------------------------------------------- 1 | package org.fixtradingcommunity; 2 | /** 3 | * The program converts raw FIX message into Json format 4 | * It is not sofesticated to handle the repeating groups 5 | * 6 | * @author Krishna Tharnoju 7 | * 8 | * @version 1.0 9 | * @since 2016-07-11 10 | */ 11 | 12 | import java.io.BufferedReader; 13 | import java.io.BufferedWriter; 14 | import java.io.File; 15 | import java.io.FileReader; 16 | import java.io.FileWriter; 17 | import java.io.IOException; 18 | import java.io.Writer; 19 | import java.util.HashMap; 20 | import java.util.List; 21 | import java.util.ArrayList; 22 | 23 | 24 | import javax.xml.parsers.DocumentBuilderFactory; 25 | import javax.xml.parsers.DocumentBuilder; 26 | import org.w3c.dom.Document; 27 | import org.w3c.dom.NodeList; 28 | import org.w3c.dom.Node; 29 | import org.w3c.dom.Element; 30 | 31 | 32 | public class fix2json { 33 | 34 | public static void main (String[] args) throws IOException{ 35 | 36 | HashMap fieldMap= new HashMap(); 37 | List headerFields = new ArrayList(); 38 | List trailerFields = new ArrayList(); 39 | 40 | try { 41 | File inputFile = new File("res/fields.xml"); 42 | DocumentBuilderFactory dbFactory 43 | = DocumentBuilderFactory.newInstance(); 44 | DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); 45 | Document doc = dBuilder.parse(inputFile); 46 | doc.getDocumentElement().normalize(); 47 | NodeList nList = doc.getElementsByTagName("field"); 48 | for (int temp = 0; temp < nList.getLength(); temp++) { 49 | Node nNode = nList.item(temp); 50 | if (nNode.getNodeType() == Node.ELEMENT_NODE) { 51 | Element eElement = (Element) nNode; 52 | fieldMap.put(eElement.getAttribute("number"), eElement.getAttribute("name")); 53 | } 54 | } 55 | } catch (Exception e) { 56 | e.printStackTrace(); 57 | } 58 | // System.out.println(fieldMap.toString()); 59 | 60 | try { 61 | File inputFile = new File("res/header.xml"); 62 | DocumentBuilderFactory dbFactory 63 | = DocumentBuilderFactory.newInstance(); 64 | DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); 65 | Document doc = dBuilder.parse(inputFile); 66 | doc.getDocumentElement().normalize(); 67 | NodeList nList = doc.getElementsByTagName("field"); 68 | for (int temp = 0; temp < nList.getLength(); temp++) { 69 | Node nNode = nList.item(temp); 70 | if (nNode.getNodeType() == Node.ELEMENT_NODE) { 71 | Element eElement = (Element) nNode; 72 | headerFields.add( eElement.getAttribute("name")); 73 | } 74 | 75 | } 76 | } catch (Exception e) { 77 | e.printStackTrace(); 78 | } 79 | 80 | // System.out.println(headerFields.toString()); 81 | try { 82 | File inputFile = new File("res/trailer.xml"); 83 | DocumentBuilderFactory dbFactory 84 | = DocumentBuilderFactory.newInstance(); 85 | DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); 86 | Document doc = dBuilder.parse(inputFile); 87 | doc.getDocumentElement().normalize(); 88 | NodeList nList = doc.getElementsByTagName("field"); 89 | for (int temp = 0; temp < nList.getLength(); temp++) { 90 | Node nNode = nList.item(temp); 91 | if (nNode.getNodeType() == Node.ELEMENT_NODE) { 92 | Element eElement = (Element) nNode; 93 | trailerFields.add( eElement.getAttribute("name")); 94 | } 95 | 96 | } 97 | } catch (Exception e) { 98 | e.printStackTrace(); 99 | } 100 | // System.out.println(trailerFields.toString()); 101 | 102 | FileReader fileReader = new FileReader("res/SampleMessage.txt"); 103 | BufferedReader messageReader= new BufferedReader(fileReader ); 104 | Writer outFile = new FileWriter("logs/JsonOutput.txt"); 105 | BufferedWriter outputWritter= new BufferedWriter(outFile); 106 | 107 | 108 | String line = null; 109 | while((line = messageReader.readLine()) != null) { 110 | 111 | String jsonString = "\n-----------------\n{"; 112 | String jsonHeader= "\n\t\"Header\": {"; 113 | String jsonBody = "\n\t\"Body\":{"; 114 | String jsonTrailer= "\n\t\"Trailer\":{"; 115 | 116 | 117 | String[] tagPairs = line.split("\001"); 118 | for (int i = 0; i < tagPairs.length; i++) { 119 | 120 | String[] tokens = tagPairs[i].split("="); 121 | 122 | String tagNumber = tokens[0]; 123 | String tagName = fieldMap.get(tagNumber); 124 | String tagValue= tokens[1]; 125 | 126 | // System.out.println(tagName); 127 | 128 | if (headerFields.contains(tagName)) 129 | { 130 | jsonHeader = jsonHeader + "\n\t\t\""+tagName+"\""+": \""+tagValue + "\","; 131 | 132 | } 133 | else if (trailerFields.contains(tagName)) 134 | { 135 | jsonTrailer= jsonTrailer+ "\n\t\t\""+tagName+"\""+": \""+tagValue + "\","; 136 | 137 | } 138 | else 139 | { 140 | jsonBody= jsonBody+ "\n\t\t\""+tagName+"\""+": \""+tagValue + "\","; 141 | 142 | } 143 | } 144 | 145 | 146 | jsonHeader = trimLastComma(jsonHeader) + "\n\t},"; 147 | jsonBody = trimLastComma(jsonBody) + "\n\t},"; 148 | jsonTrailer = trimLastComma(jsonTrailer) + "\n\t}"; 149 | 150 | jsonString = jsonString + jsonHeader+ jsonBody + jsonTrailer; 151 | 152 | jsonString = jsonString+ "\n}"; 153 | System.out.println(jsonString ); 154 | outputWritter.write(jsonString ); 155 | } 156 | outputWritter.close(); 157 | messageReader.close(); 158 | 159 | } 160 | 161 | public static String trimLastComma(String str) { 162 | if (str != null && str.length() > 0 && str.charAt(str.length()-1)==',') { 163 | str = str.substring(0, str.length()-1); 164 | } 165 | return str; 166 | } 167 | 168 | } -------------------------------------------------------------------------------- /go/README.md: -------------------------------------------------------------------------------- 1 | ## Go (golang) Reference Code 2 | 3 | Example of parsing FIX JSON Encoding in Go. Run it with: 4 | 5 | ```shell 6 | go test 7 | ``` 8 | -------------------------------------------------------------------------------- /go/msg_test.go: -------------------------------------------------------------------------------- 1 | package msgtest 2 | 3 | import ( 4 | "encoding/json" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | type NoMDEntries struct { 12 | MDEntryType string 13 | MDEntryPx string 14 | MDEntrySize string 15 | MDEntryDate string 16 | MDEntryTime string 17 | } 18 | 19 | type MarketDataSnapshotFullRefresh struct { 20 | Header struct { 21 | BeginString string 22 | MsgType string 23 | MsgSeqNum string 24 | SenderCompID string 25 | TargetCompID string 26 | SendingTime string 27 | } 28 | 29 | Body struct { 30 | SecurityIDSource string 31 | SecurityID string 32 | MDReqID string 33 | NoMDEntries []NoMDEntries 34 | } 35 | 36 | Trailer struct { 37 | } 38 | } 39 | 40 | var ( 41 | data = []byte(`{ 42 | "Header": { 43 | "BeginString": "FIXT.1.1", 44 | "MsgType": "W", 45 | "MsgSeqNum": "4567", 46 | "SenderCompID": "SENDER", 47 | "TargetCompID": "TARGET", 48 | "SendingTime": "20160802-21:14:38.717" 49 | }, 50 | "Body": { 51 | "SecurityIDSource": "8", 52 | "SecurityID": "ESU6", 53 | "MDReqID": "789", 54 | "NoMDEntries": [ 55 | { "MDEntryType": "0", "MDEntryPx": "2179.75", "MDEntrySize": "175", "MDEntryDate": "20160812", "MDEntryTime": "21:14:38.688"}, 56 | { "MDEntryType": "1", "MDEntryPx": "2180.25", "MDEntrySize": "125", "MDEntryDate": "20160812", "MDEntryTime": "21:14:38.688"} 57 | ] 58 | }, 59 | "Trailer": { 60 | } 61 | }`) 62 | ) 63 | 64 | func TestJSON(t *testing.T) { 65 | // When the JSON is parsed 66 | var msg MarketDataSnapshotFullRefresh 67 | err := json.Unmarshal(data, &msg) 68 | require.Nil(t, err) 69 | 70 | // Then the header fields should be 71 | assert.Equal(t, "FIXT.1.1", msg.Header.BeginString) 72 | assert.Equal(t, "W", msg.Header.MsgType) 73 | assert.Equal(t, "4567", msg.Header.MsgSeqNum) 74 | assert.Equal(t, "SENDER", msg.Header.SenderCompID) 75 | assert.Equal(t, "TARGET", msg.Header.TargetCompID) 76 | assert.Equal(t, "20160802-21:14:38.717", msg.Header.SendingTime) 77 | 78 | // And the body fields should be 79 | assert.Equal(t, "8", msg.Body.SecurityIDSource) 80 | assert.Equal(t, "ESU6", msg.Body.SecurityID) 81 | assert.Equal(t, "789", msg.Body.MDReqID) 82 | 83 | // And the NoMDEntries repeating group should contain two entries 84 | assert.Len(t, msg.Body.NoMDEntries, 2) 85 | 86 | // And the first entry should be 87 | assert.Equal(t, "0", msg.Body.NoMDEntries[0].MDEntryType) 88 | assert.Equal(t, "2179.75", msg.Body.NoMDEntries[0].MDEntryPx) 89 | assert.Equal(t, "175", msg.Body.NoMDEntries[0].MDEntrySize) 90 | assert.Equal(t, "20160812", msg.Body.NoMDEntries[0].MDEntryDate) 91 | assert.Equal(t, "21:14:38.688", msg.Body.NoMDEntries[0].MDEntryTime) 92 | 93 | // And the second entry should be 94 | assert.Equal(t, "1", msg.Body.NoMDEntries[1].MDEntryType) 95 | assert.Equal(t, "2180.25", msg.Body.NoMDEntries[1].MDEntryPx) 96 | assert.Equal(t, "125", msg.Body.NoMDEntries[1].MDEntrySize) 97 | assert.Equal(t, "20160812", msg.Body.NoMDEntries[1].MDEntryDate) 98 | assert.Equal(t, "21:14:38.688", msg.Body.NoMDEntries[1].MDEntryTime) 99 | } 100 | -------------------------------------------------------------------------------- /java/README.md: -------------------------------------------------------------------------------- 1 | ## Java Reference Code 2 | 3 | Example of parsing FIX JSON Encoding in Java. Run it with: 4 | 5 | ```shell 6 | mvn test 7 | ``` 8 | -------------------------------------------------------------------------------- /java/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.fixtradingcommunity.fix-examples 5 | json-msg-test 6 | 0.0.1-SNAPSHOT 7 | jar 8 | ${project.groupId}:${project.artifactId} 9 | FIX/JSON encoding spike 10 | 2016 11 | 12 | 13 | FIX Trading Community 14 | http://http://www.fixtradingcommunity.org/ 15 | 16 | 17 | 18 | The Apache License, Version 2.0 19 | http://www.apache.org/licenses/LICENSE-2.0.txt 20 | 21 | 22 | 23 | 24 | UTF-8 25 | 4.13.1 26 | 1.8 27 | 2.8.9 28 | 29 | 30 | 31 | 32 | com.google.code.gson 33 | gson 34 | ${gson.version} 35 | 36 | 37 | junit 38 | junit 39 | test 40 | ${junit.version} 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.apache.maven.plugins 48 | maven-compiler-plugin 49 | 3.3 50 | 51 | ${java.version} 52 | ${java.version} 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /java/src/test/java/org/fixtradingcommunity/MsgTest.java: -------------------------------------------------------------------------------- 1 | package org.fixtradingcommunity; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | import org.junit.Test; 5 | import org.junit.Before; 6 | import com.google.gson.*; 7 | 8 | public class MsgTest { 9 | static class Header { 10 | String BeginString; 11 | String MsgType; 12 | String MsgSeqNum; 13 | String SenderCompID; 14 | String TargetCompID; 15 | String SendingTime; 16 | } 17 | 18 | static class Trailer { 19 | } 20 | 21 | static class NoMDEntries { 22 | String MDEntryType; 23 | String MDEntryPx; 24 | String MDEntrySize; 25 | String MDEntryDate; 26 | String MDEntryTime; 27 | } 28 | 29 | static class MarketDataSnapshotFullRefresh { 30 | static class Body { 31 | String SecurityIDSource; 32 | String SecurityID; 33 | String MDReqID; 34 | NoMDEntries[] NoMDEntries; 35 | } 36 | 37 | Header Header; 38 | Body Body; 39 | Trailer Trailer; 40 | } 41 | 42 | private final static String data = String.join("\n", 43 | "{", 44 | "\"Header\": {", 45 | "\"BeginString\": \"FIXT.1.1\",", 46 | "\"MsgType\": \"W\",", 47 | "\"MsgSeqNum\": \"4567\",", 48 | "\"SenderCompID\": \"SENDER\",", 49 | "\"TargetCompID\": \"TARGET\",", 50 | "\"SendingTime\": \"20160802-21:14:38.717\"", 51 | "},", 52 | "\"Body\": {", 53 | "\"SecurityIDSource\": \"8\",", 54 | "\"SecurityID\": \"ESU6\",", 55 | "\"MDReqID\": \"789\",", 56 | "\"NoMDEntries\": [", 57 | "{ \"MDEntryType\": \"0\", \"MDEntryPx\": \"2179.75\", \"MDEntrySize\": \"175\", \"MDEntryDate\": \"20160812\", \"MDEntryTime\": \"21:14:38.688\"},", 58 | "{ \"MDEntryType\": \"1\", \"MDEntryPx\": \"2180.25\", \"MDEntrySize\": \"125\", \"MDEntryDate\": \"20160812\", \"MDEntryTime\": \"21:14:38.688\"}", 59 | "]", 60 | "},", 61 | "\"Trailer\": {", 62 | "}", 63 | "}" 64 | ); 65 | 66 | @Test 67 | public void testJson() { 68 | // When the JSON is parsed 69 | MarketDataSnapshotFullRefresh msg = new Gson().fromJson(data, MarketDataSnapshotFullRefresh.class); 70 | 71 | // Then the header fields should be 72 | assertEquals("FIXT.1.1", msg.Header.BeginString); 73 | assertEquals("W", msg.Header.MsgType); 74 | assertEquals("4567", msg.Header.MsgSeqNum); 75 | assertEquals("SENDER", msg.Header.SenderCompID); 76 | assertEquals("TARGET", msg.Header.TargetCompID); 77 | assertEquals("20160802-21:14:38.717", msg.Header.SendingTime); 78 | 79 | // And the body fields should be 80 | assertEquals("8", msg.Body.SecurityIDSource); 81 | assertEquals("ESU6", msg.Body.SecurityID); 82 | assertEquals("789", msg.Body.MDReqID); 83 | 84 | // And the NoMDEntries repeating group should contain two entries 85 | assertEquals(2, msg.Body.NoMDEntries.length); 86 | 87 | // And the first entry should be 88 | assertEquals("0", msg.Body.NoMDEntries[0].MDEntryType); 89 | assertEquals("2179.75", msg.Body.NoMDEntries[0].MDEntryPx); 90 | assertEquals("175", msg.Body.NoMDEntries[0].MDEntrySize); 91 | assertEquals("20160812", msg.Body.NoMDEntries[0].MDEntryDate); 92 | assertEquals("21:14:38.688", msg.Body.NoMDEntries[0].MDEntryTime); 93 | 94 | // And the second entry should be 95 | assertEquals("1", msg.Body.NoMDEntries[1].MDEntryType); 96 | assertEquals("2180.25", msg.Body.NoMDEntries[1].MDEntryPx); 97 | assertEquals("125", msg.Body.NoMDEntries[1].MDEntrySize); 98 | assertEquals("20160812", msg.Body.NoMDEntries[1].MDEntryDate); 99 | assertEquals("21:14:38.688", msg.Body.NoMDEntries[1].MDEntryTime); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /javascript/README.md: -------------------------------------------------------------------------------- 1 | ## Javascript Reference Code 2 | 3 | Example of parsing FIX JSON Encoding in Javascript. Run it with: 4 | 5 | ```shell 6 | node msg_test.js 7 | ``` 8 | -------------------------------------------------------------------------------- /javascript/msg_test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | 3 | const data = '{' + 4 | ' "Header": {' + 5 | ' "BeginString": "FIXT.1.1",' + 6 | ' "MsgType": "W",' + 7 | ' "MsgSeqNum": "4567",' + 8 | ' "SenderCompID": "SENDER",' + 9 | ' "TargetCompID": "TARGET",' + 10 | ' "SendingTime": "20160802-21:14:38.717"' + 11 | ' },' + 12 | ' "Body": {' + 13 | ' "SecurityIDSource": "8",' + 14 | ' "SecurityID": "ESU6",' + 15 | ' "MDReqID": "789",' + 16 | ' "NoMDEntries": [' + 17 | ' { "MDEntryType": "0", "MDEntryPx": "2179.75", "MDEntrySize": "175", "MDEntryDate": "20160812", "MDEntryTime": "21:14:38.688"},' + 18 | ' { "MDEntryType": "1", "MDEntryPx": "2180.25", "MDEntrySize": "125", "MDEntryDate": "20160812", "MDEntryTime": "21:14:38.688"}' + 19 | ' ]' + 20 | ' },' + 21 | ' "Trailer": {' + 22 | ' }' + 23 | '}'; 24 | 25 | // When the JSON is parsed 26 | var msg = JSON.parse(data); 27 | 28 | // Then the header fields should be 29 | assert.equal(msg.Header.BeginString, "FIXT.1.1"); 30 | assert.equal(msg.Header.MsgType, "W"); 31 | assert.equal(msg.Header.MsgSeqNum, "4567"); 32 | assert.equal(msg.Header.SenderCompID, "SENDER"); 33 | assert.equal(msg.Header.TargetCompID, "TARGET"); 34 | assert.equal(msg.Header.SendingTime, "20160802-21:14:38.717"); 35 | 36 | // And the body fields should be 37 | assert.equal(msg.Body.SecurityIDSource, "8"); 38 | assert.equal(msg.Body.SecurityID, "ESU6"); 39 | assert.equal(msg.Body.MDReqID, "789"); 40 | 41 | // And the NoMDEntries repeating group should contain two entries 42 | assert.equal(msg.Body.NoMDEntries.length, 2); 43 | 44 | // And the first entry should be 45 | assert.equal(msg.Body.NoMDEntries[0].MDEntryType, "0"); 46 | assert.equal(msg.Body.NoMDEntries[0].MDEntryPx, "2179.75"); 47 | assert.equal(msg.Body.NoMDEntries[0].MDEntrySize, "175"); 48 | assert.equal(msg.Body.NoMDEntries[0].MDEntryDate, "20160812"); 49 | assert.equal(msg.Body.NoMDEntries[0].MDEntryTime, "21:14:38.688"); 50 | 51 | // And the second entry should be 52 | assert.equal(msg.Body.NoMDEntries[1].MDEntryType, "1"); 53 | assert.equal(msg.Body.NoMDEntries[1].MDEntryPx, "2180.25"); 54 | assert.equal(msg.Body.NoMDEntries[1].MDEntrySize, "125"); 55 | assert.equal(msg.Body.NoMDEntries[1].MDEntryDate, "20160812"); 56 | assert.equal(msg.Body.NoMDEntries[1].MDEntryTime, "21:14:38.688"); 57 | -------------------------------------------------------------------------------- /orchestra2json/Readme.md: -------------------------------------------------------------------------------- 1 | # orchestra2json 2 | 3 | Process to generate JSON schemas for message structures defined in a FIX Orchestra file. 4 | 5 | 6 | ## XSL Transforms 7 | 8 | ### AddJsonDatatypes.xslt 9 | Adds JSON mappings for FIX datatypes to an Orchestra file. The mappings are used in schema generation. 10 | 11 | ### orchestra2json.xslt 12 | Generates JSON schema files for messages, components, and repeating groups defined in an Orchestra file. 13 | 14 | ## References 15 | 16 | The Orchestra XML schema is in project [fix-orchestra/repository2016](https://github.com/FIXTradingCommunity/fix-orchestra/tree/master/repository2016) 17 | 18 | [JSON Schema](http://json-schema.org/documentation.html) 19 | -------------------------------------------------------------------------------- /orchestra2json/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | io.fixprotocol.json 5 | orchestra2json 6 | 0.0.1-SNAPSHOT 7 | pom 8 | ${project.groupId}:${project.artifactId} 9 | 2017 10 | 11 | FIX Trading Community 12 | http://http://www.fixtradingcommunity.org/ 13 | 14 | 15 | 16 | 17 | 18 | org.codehaus.mojo 19 | xml-maven-plugin 20 | 21 | 22 | 23 | transform 24 | 25 | 26 | 27 | 28 | 29 | 30 | src/test/resources 31 | src/main/resources/xsl/OrchestraToJSONSchema.xslt 32 | 33 | 34 | 35 | 36 | 37 | net.sf.saxon 38 | Saxon-HE 39 | 9.8.0-2 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /orchestra2json/src/main/resources/xsl/AddJsonDatatypes.xslt: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | ISO 3166-1:2013 Codes for the representation of names of countries and their subdivisions -- Part 1: Country codes 85 | 86 | 87 | 88 | 89 | 90 | ISO 4217:2015 Codes for the representation of currencies 91 | 92 | 93 | 94 | 95 | 96 | ISO 10383:2012 Codes for exchanges and market identification (MIC) 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | ISO 639-1:2002 Codes for the representation of names of languages -- Part 1: Alpha-2 code 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /orchestra2json/src/main/resources/xsl/OrchestraToJSONSchema.xslt: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | { 24 | "title" : "", 25 | "description" : "JSON Schema for component ", 26 | "type" : "object", 27 | "properties" : { 28 | 29 | }, 30 | "required" : [ 31 | 32 | ] 33 | } 34 | 35 | 36 | 37 | 38 | { 39 | "title" : "", 40 | "description" : "JSON Schema for repeating group ", 41 | "type" : "array", 42 | "items" : { 43 | "type": "object", 44 | 45 | "properties": { 46 | 47 | }, 48 | "required" : [ 49 | 50 | ] 51 | } 52 | } 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | { 62 | "$schema" : "http://json-schema.org/draft-04/schema#", 63 | "title" : "", 64 | "description" : "JSON Schema for message ", 65 | "type" : "object", 66 | "properties" : { 67 | 68 | }, 69 | "required" : [ 70 | 71 | ] 72 | } 73 | 74 | 75 | 76 | "": { 77 | 78 | 79 | }, 80 | 81 | 82 | "", 83 | 84 | 85 | "" : {"$ref": "#/definitions/"}, 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | "type": "" 96 | 97 | , 98 | 99 | 100 | , 101 | "minimum": 102 | 103 | , 104 | "maximum": 105 | 106 | , 107 | "minLength": 108 | 109 | , 110 | "maxLength": 111 | 112 | 113 | "minItems": , 114 | 115 | 116 | "maxItems": , 117 | 118 | 119 | 120 | 121 | 122 | , 123 | "enum": [ 124 | 125 | 126 | 127 | "" 128 | 129 | , 130 | 131 | ] 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /ruby/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.2.2 2 | -------------------------------------------------------------------------------- /ruby/README.md: -------------------------------------------------------------------------------- 1 | ## Ruby Reference Code 2 | 3 | Example of parsing FIX JSON Encoding in Ruby. Run it with: 4 | 5 | ```shell 6 | ruby msg_test.rb 7 | ``` 8 | -------------------------------------------------------------------------------- /ruby/msg_test.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'json' 3 | 4 | class TestJson < MiniTest::Unit::TestCase 5 | def setup 6 | @data = <