Backend Readme: Add section on avoiding simplejson (#25116)

This commit is contained in:
Kyle Brandt 2020-05-26 14:32:00 -04:00 committed by GitHub
parent fcb9dcb0b8
commit 81e3f93677
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -71,6 +71,10 @@ Refactor HTTP handlers so that the handler methods are on the HttpServer instanc
Store newly introduced date columns in the database as epochs if they require date comparison. This permits a unified approach for comparing dates against all the supported databases instead of handling dates differently for each database. Also, by comparing epochs, we no longer need error pruning transformations to and from other time zones.
### Avoid use of the simplejson package
Use of the `simplejson` package (`pkg/components/simplejson`) in place of types (Go structs) results in code that is difficult to maintain. Instead, create types for objects and use the Go standard library's [`encoding/json`](https://golang.org/pkg/encoding/json/) package.
### Provisionable*
All new features that require state should be possible to configure using config files. For example:

View File

@ -1,3 +1,5 @@
// Package simplejson provides a wrapper for arbitrary JSON objects that adds methods to access properties.
// Use of this package in place of types and the standard library's encoding/json package is strongly discouraged.
package simplejson
import (