Skip to content

Conversation

@phempel
Copy link
Contributor

@phempel phempel commented Dec 16, 2025

  • reworked internal unmarshalling and marshalling of json
  • changed internal handling of numeric values to json.Number

see #78185

Philipp Hempel added 2 commits December 12, 2025 10:13
Comment on lines 39 to 40
commentRegex := regexp.MustCompile(`(?m)^[\t ]*#.*$`)
tmplBytes := commentRegex.ReplaceAll(input, []byte{})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

den regexp bitte mal als top level variable. ich glaube wir sehen hier gerade den grund warum das apitest tool manchmal so lahm erscheint, insbesondere beim json parsen.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

und schau mal ob es irgendwoanders noch solche fälle gibt wo ständig regexp compiliert werden (das ist sehr teuer)

// wrappers for consistency
// also to remove unnecessary imports of "encoding/json"
func Marshal(v any) (data []byte, err error) {
return json.Marshal(v)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hier kannst du mal golib.JsonBytes "klauen", json.Marshal hat komische defaults wenn es html marschallen soll.

}

func Encode(w io.Writer, v any) (err error) {
return json.NewEncoder(w).Encode(v)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auch hier, siehe golib.JsonBytes (html false oder so setzen)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants