Code Monkey home page Code Monkey logo

json2apex's Introduction

JSON2Apex

This app allows a user to paste in an instance of a json document, and have it generate strongly typed apex code that can deserialize it.

Its written in Java using the Play! framework, if you want to try it out, its running at http://json2apex.herokuapp.com

JSON2Apex is open source under the MIT license.

About integration-tests

The integration-test folder contains a modified version of beatbox that can call the compileClass API in the Apex API, there's a test runner that will post the test json's to a running instance of the app and then send them to saleforce, if salesforce reports a compilation error, that's logged in the test runner output.

the test runner requires python3 and a salesforce developer edition org.

Warning, it'll overwrite any class called JSON2ApexIntegration[_Test] you might have

run the integration tests from the integration-test folder with

python3 tests.py <sfdc_username> <sfdc_password>

you'll get output similar to

Logged in at https://na45.salesforce.com/services/Soap/u/42.0/00D300000000QSf
Compiling 2 scripts generated from basic_object.json                explicitParse:False ✔ success
Compiling 2 scripts generated from basic_object.json                explicitParse:True  ✔ success
Compiling 2 scripts generated from dot_in_fieldname.json            explicitParse:False ✔ success
Compiling 2 scripts generated from dot_in_fieldname.json            explicitParse:True  ✔ success
Compiling 2 scripts generated from dot_in_objectname.json           explicitParse:False ✔ success
Compiling 2 scripts generated from dot_in_objectname.json           explicitParse:True  ✔ success
Compiling 2 scripts generated from field_array.json                 explicitParse:False ✔ success
Compiling 2 scripts generated from field_array.json                 explicitParse:True  ✔ success
Compiling 2 scripts generated from underscore_in_fieldname.json     explicitParse:False ✔ success
Compiling 2 scripts generated from underscore_in_fieldname.json     explicitParse:True  ✔ success

Note that beatbox & xmltramp is GPL, not MIT like the rest of this project.

json2apex's People

Contributors

superfell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.