Page:
JSON Coding Convention
Pages
API SMHI
API TimeEdit
Accessibility Testing
Api documentation
Bat/Ps
Branch Creation
C# Coding Convention
CSS Coding Convention
Coding Conventions
Creating new databases
Dapper
Documentation for service endpoints
Documentation of useTemperature and mock sensor
Energy endpoints
Environment
Evaluation react-grid-layout
Evaluation Localization
Evaluation Password hashing
Evaluation Testing framework
Evaluation of Logging Frameworks
Formatter
Frontend model
Generic Diagram for Sensor data flow
Home
How to- Creating Databases in Docker
Implementing different Styles
Implementing new Mockup sensors
Implementing new Views
Installation script documentation
Installation
Issues
JSON Coding Convention
Jest Testing
Layout endpoints
Linux
Localization
Login endpoints
Mac
Middleware model
Mock API Ceation Guidelines
Mockup models
Model Tools and Standards
Parking endpoints
React/JavaScript Coding Convention
React
Reviews
Room booking endpoints
SQL Coding Convention
Scheduled Database tasks
Scripting Coding Convention
Secrets and .env
Server Access
Server-Deployment
Service/API models
System models
System requirements
Temperature endpoints
Testing API with Bruno
Testing Architecture
Testing frontend for Mobile devices
Testing frontend with Playwright
Testing methodology
Västtrafik API
Webpage Design
Windows
pg_cron and scheduled database jobs
xUnit Testing
No results
5
JSON Coding Convention
b24hugst edited this page 2026-05-15 09:53:27 +00:00
Table of Contents
JSON Coding Convention
Naming conventions
- Variables and attributes should, for this project, be named using camelCase.
- Each name should also be descriptive. Names like "Green213123" are not valid, while names such as "carOwner" are.
Syntax
Containers and arrays
In JSON, each document must be contained within either a pair of "{" or "[" characters.
- "{}": means that whatever is inside it is an object (unordered key/value pairs).
{
"firstName": "Sven",
"sirName": "Svensson"
}
An important detail to note is the presence of the "," character at the end of all but the last item pair.
The character signals to JSON when to start the next item, or, in other words, a metaphorical line break.
- "[]": means that whatever is inside is part of a collection (an array).
[
"apple",
"banana"
]
DataTypes
Inside JSON are INTS and Strings, the two primary datatypes. From a pure syntax standpoint, the only difference between the two is the presence of quats or not.
{
"string": "value",
"int": 123
}
Important to note is that if a non-integer value is syntactically given as a string, an error will be thrown.
{
"int": This-will-make-an-error
}
JSON also has support for the less common null-value and Boolean values true and false.
{
"bolean-false": false,
"bolean-true": true,
"null-value": null
}
Nesting
One of the most important features of JSON is the ability to nest arrays and collections within one another to create complexer structures to represent some data.
{
"menu": {
"id": 1,
"value": "value",
"popup": {
"menuitem": [
{
"value": "New",
"onclick": "CreateNewDoc()"
},
{ "value": "Open", "onclick": "OpenDoc()" },
{ "value": "Close", "onclick": "CloseDoc()" }
]
}
}
}
1. Setup
2. Standards
- Coding Conventions
- Issues
- Branch creation
- Reviews
- Implementation Standards
- [WIP] Creating new databases
- Localization
3. Models and Diagrams
4. Testing
5. Documentation
- Documentation for service endpoints
- API documentation
- Webpage Design
- Secrets and .env
- Evaluations
- Installation and Rebuild script documentation
6. Guides and How-to's
7. Micro Service Mockup Api
- Guidelines Mircro Service Mockup
- Documentation of useTemperature/useTemperatureTimeSeries mockup sensor