HexmosTech / Lama2

Free, Lightweight & Collaborative API Client
https://hexmos.com/lama2/index.html
GNU Affero General Public License v3.0
109 stars 6 forks source link

Prettify command switch for `l2` CLI #5

Open shrsv opened 1 year ago

shrsv commented 1 year ago

The prototype version of l2 had an option to prettify/standardize .l2 files. The previous version depended entirely on regular expressions for identifying the various pieces of input (verb, url, headers, json/varjson). It is not entirely clear, what is the correct approach to implementing a prettification algorithm. Hence, the task involves two phases:

  1. Specify the approach/algorithm
  2. Implement the algorithm

Note that, in the present version, it is almost trivial to implement JSON prettification. The difficulty is in dealing with arbitrary input order (say URL comes before Verb).