Data workflow guides

Build a Row Schema From an Order CSV

·

A CSV record contains text. Before importing it as JSON, decide which columns will become typed values and which carry codes whose digits belong to the original spelling.

CSV Header Mapper to JSON Schema

Choose types for the order columns

Select Load example and Read columns. Keep order_id as string. Set quantity in column 2 to integer and paid in column 3 to boolean. Enable Null for empty column 4.

Select Build and validate. Two data records are mapped. The quantities are 2 and 4, the paid values are true and false, and the first note is null. The two identifiers preserve the strings 0012 and 9007199254740993.

RFC 4180, CSV records and quotingJSON Schema Draft 2020-12 validation vocabularyRFC 8259, interoperable JSON numbers

Use a type warning to choose between numbers and text

Change order_id to integer and build again. The report identifies column 1 in records 2 and 3. The first ID has leading zeros and the second ID exceeds the safe integer range. Restore string to preserve both values.

Required controls whether the JSON key must be present. An empty required string stays empty unless null is selected. An optional blank field is omitted unless null is selected, in which case the key is present with a null value.

JSON Schema Draft 2020-12 validation vocabularyRFC 8259, interoperable JSON numbers

Open the schema and mapped records together

Download the schema and mapped rows. The schema declares Draft 2020-12 and describes one object. Validate each object in the mapped array against it. Check that note permits string or null and paid is Boolean.

The schema stays available when a row has a type issue. Fix the reported record or change its mapping before downloading the converted rows. CSV record numbers include the header and count a quoted multiline value as part of one record.

JSON Schema Draft 2020-12 validation vocabularyRFC 4180, CSV records and quoting

Common questions

Can I rename a JSON property without editing the CSV?

Yes. Change the property name for its column. The source header stays visible and the mapping continues to read that original column position.

What does Allow additional properties do?

It controls whether a future JSON row can contain keys absent from the mapped property list. The CSV export itself uses the selected mapping.

Sources

Put it into practice.

Related guides