JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.51k stars 2.4k forks source link

feat: Adds JSON API segment #5842

Open mwiedemeyer opened 2 weeks ago

mwiedemeyer commented 2 weeks ago

Prerequisites

Description

This PR adds a segment for calling any JSON API and displays a json property from the response. As I have no real experience with go I hope this is ok and valuable for the ecosystem.

This segment can also be updated in the future with more features like authentication, etc.

JanDeDobbeleer commented 2 weeks ago

@mwiedemeyer I want to make this a little bit more generic. I would name it http rather that jsonapi, that way we can execute any http call in the future and also allow to define HTTP method etc...

mwiedemeyer commented 2 weeks ago

Hi, thanks, good idea. I've renamed jsonapi to http and also already added the http method as a property. However my go experience is not enough to make it even more generic and add a body, things like that. Hope you can enhance it even further or use it as it is for now.

JanDeDobbeleer commented 2 weeks ago

@mwiedemeyer I'll pick it up 👍