@himenon/openapi-parameter-formatter
A library that serializes OpenAPI parameter objects.
It is implemented according to the following style definition.
Usage
import { PathParameter } from "@himenon/openapi-parameter-formatter";
PathParameter.generate("color", {
value: {
R: 100,
G: 200,
B: 150,
},
style: "label",
explode: true,
});
import { QueryParameter } from "@himenon/openapi-parameter-formatter";
QueryParameter.generate("color", {
value: {
R: "#100",
G: "#200",
B: "#150",
},
style: "form",
explode: true,
});
import { QueryParameter } from "@himenon/openapi-parameter-formatter";
QueryParameter.generate("color", {
value: ["#blue", "#black", "#brown"],
style: "spaceDelimited",
explode: false,
});
import { QueryParameter } from "@himenon/openapi-parameter-formatter";
QueryParameter.generate("color", {
value: ["#blue", "#black", "#brown"],
style: "pipeDelimited",
explode: false,
});
import { QueryParameter } from "@himenon/openapi-parameter-formatter";
QueryParameter.generate("color", {
value: {
R: 100,
G: 200,
B: 150,
},
style: "deepObject",
explode: true,
});
import { HeaderParameter } from "@himenon/openapi-parameter-formatter";
HeaderParameter.generate("color", {
value: ["blue", "black", "brown"],
style: "simple",
explode: false,
});
import { CookieParameter } from "@himenon/openapi-parameter-formatter";
CookieParameter.generate("color", {
value: ["blue", "black", "brown"],
style: "form",
explode: false,
});
LICENCE
@himenon/openapi-parameter-formatter・MIT