JSON

JSON VS XML

XML

  • extensible Markup Language much like HTML but designed to carry data, not to display data.
  • requires XML parser to parse the data.
  • difficult to read and interpret.

JSON

  • (similar to XML) Data sent from server to a web page
  • Stands for Java Script Object Notation.
  • light weight format and easy to parse.

JSON Schema VS XSD

XSD

  • XML has the concept of schema, that permits user-defined types, predefined tags, and formal structure, allowing for formal validation of an XML

JSON Schema

  • Like XSD for XML, JSON Schema is for JSON .

JSON sample

(1 to 1, 1 to many relation + nested relations)

{
"tenderId": 3576236,
"tenderNotificationNumber": "2019_Assam_67020_1",
"tenderTitle": "medical equipment",
"tenderDescription": "Procurement of equipments for multidisciplinary research unit",
"EMDDetails": {
"Amount": 50000,
"FeeType": "FIXED",
"PayableTo": "IIWAI Fund",
"payableAt": "New Delhi, Noida"
}
"publishedDate": "2019-12-23",
"submissionDate": "2019-12-30",
"tenderStatus": 0,
"createdOn": "2019-12-23T12:00:00",
"createdBy": 123,
"lastUpdatedOn": null,
"lastUpdatedBy": null,
"ProcurementMap": [{
"procurementCategoryCode": "GOODS",
"procSubCategoryCode": "PHARMA"
}, {
"procurementCategoryCode": "GOODS",
"procSubCategoryCode": "MEDICAL_EQUIPMENTS"
}]
"tenderDocuments": [{
"tenderDocumentId": 1,
"fileName": "TenderNotice",
"fileExtension": ".pdf",
"description": "tender notice",
"diskPath": "\\SharedDrive\ASSAM\2019\12\23\",
"docHostPath": "/BidDocuments/api/ASSAM/2019/12/23",
"docOrder": 1,
"status": 1
},
{
"tenderDocumentId": 2,
"fileName": "BOQ",
"fileExtension": ".xls",
"description": "price bid",
"diskPath": "\\SharedDrive\ASSAM\2019\12\23\",
"docHostPath": "/BidDocuments/api/ASSAM/2019/12/23",
"docOrder": 1,
"status": 1
}
]
}

YAML

  • YAML also is a superset (human-readable) of JSON.
  • replaces JSON'S nested delimiters like {}, [], and " marks with indentation.
tenderId: 3576236,
EMDDetails:
Amount: 50000
FeeType: FIXED