J2Code API for ReactNextJS Document
You can configure the code generation to produce source files that meet your exact requirements.
Configure and Customize
You can configure or customize the code generation process by adding the next two special fields to the JSON business record sample:
"j2codeConfig": { ... }
"j2codeConfig_<fieldName>": { ... }
For example:
{
"FirstName": "Jeremi",
"MiddleName": "Paxer",
"LastName": "Harrising",
"Gender": "Female",
"j2codeConfig_Gender": {
"selectorConfig": {
"selectorViewType": "SelectSingle",
"selectorOptionSource": "ValueArray",
"optionValueArrayName": "personGenderNames"
}
},
"j2codeConfig": {
"multiWordsName": "emergency, contact, person",
"selectorOptionArraysContainer": {
"valueArrays": {
"personGenderNames": [
"Male",
"Female",
"Unknown"
]
}
}
}
From the above, the generated root level component will be named as EmergencyContactPerson... defined in a file emergency-contact-person... And on the generated editor form, the field Gender's value will be selected from a predefined array personGenderNames.
How to give different names to the generated ReactNextJS components?
The generated application includes editor forms and grid views for both the root-level object and its nested child objects. By default: Components for the root-level object are named SampleBusinessRecord...Components and saved in files like sample-business-record...ts. Components for child objects are named after their corresponding field names in the parent object. You can customize these names by adding a j2codeConfig block with a multiWordsName field to either the root or any child object. For example:
"j2codeConfig": {
"multiWordsName": "temporary, employee, record"
}In this example, the root-level object will generate components named TemporaryEmployeeRecord... and files like temporary-employee-record.... Similarly, if you add the j2codeConfig block to a child object, This will result in ReactNextJS components named using the concatenated form TemporaryEmployeeRecord... and file names like temporary-employee-record....
Links:
- J2Code APIInput a record sample, call J2Code API to generate React NextJS application
- OpenAI APIInput a record sample to OpenAI API Tool, then call J2Code API to generate React NextJS application
- OpenAI API Tool CodesAll the code samples to call an OpenAI API Tool calling this J2Code API
- SamplesSample JSON Business Records, you can copy them to other pages to test this API
- DocumentsDocuments about how to configure and customize the code generation process
- Contact UsContact or Feedback, Please share your ideas here to help us improve it!
- HomeGo back to the home page