utils

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixErrorParameters

func FixErrorParameters(body string) string

FixErrorParameters the error parameters come back from magento as objects rather than arrays of objects as their swagger docs specify EXPECTED:

"parameters":[{"fieldName":"max","fieldValue":"300"}]

ACTUAL:

"parameters":{"max":300}

CORRECTED:

"parameters":[{"fieldName":"max","fieldValue":"300"}]

however the

func FlattenValueArrays

func FlattenValueArrays(body string) string

FixJsonResponse one of the problems with the magento api is that it overloads the value:string fields with value:[]string and that breaks the json unmarshaller to fix this we use this function which intercepts the json string before it is json unmarshalled and alters the response flatten []string into a basic string EXPECTED:

"value":"4"

ACTUAL:

"value":["4","5","6"]

CORRECTED:

"value":"4,5,6"

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL