HomePhabricator

Support "application/json" in Blubberoid
573fcd5f7ed3Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Support "application/json" in Blubberoid

JSON seems a better option for a web service in general—other toolchains
in the Docker/Kubernetes space typically prefer YAML for human-edited
configs but convert to JSON on the wire. The "application/json" media
type is well established—unlike "application/yaml" which has no official
assignment by IANA—and is better supported by the OpenAPI (formerly
Swagger) specification.

Added content-type media type validation in the Blubberoid HTTP server
handler, and added a check for json.Valid(body) upon receiving a
"application/json" media type. Since any given valid JSON is also valid
YAML, Blubberoid simply does a shallow validation of the JSON body
before punting to config.ReadConfig for YAML unmarshalling and
thorough config validation.

Bug: T205920
Change-Id: I970acbde497ed446eb8eed568b1328f8c6f5aa55

Details

Provenance
dduvallAuthored on Oct 19 2018, 8:36 PM
Parents
rGBLBRaf9e797908c0: Remove support for `sharedvolume` configuration
Branches
Unknown
Tags
Unknown
ChangeId
I970acbde497ed446eb8eed568b1328f8c6f5aa55