CodeMirror Language Support Example

Set Open API specification url:


After loading OAS or changing the path and method using external widgets, codemirror (the text editor) needs some kind of text change event, to attempt another diagnostic pass. Please write some whitespeces or any character in the editor to trigger the diagnostic pass.

Example requests:


I guess you noticed the separating --- between HTTP part and JSON part, the reason is that due to HTTP syntax being defined using whitespaces.
Space between method, path and version, then newline, then headers on separate lines and then the biggest issue. The request body starts after a single empty line.
It would be simple enough to write a parser for fully compliant HTTP request.
But when writing a parser for incomplete HTTP request which is still being written, it would confuse very much.
Especially when the user is in the middle of writing another header and would put a new line between some existing headers at which point all the colors disappear and everything becomes red.
So, I decided to separate the HTTP part from the JSON part using a separator (regex: /^---+$/).


This is an example of using external widgets to specify the HTTP metadata, combined with example of key errors (please type something into the editor to trigger codemirrors diagnostic passes)



This is an example of a path, which is defined using parameters in the OAS. Like:

/{locale}/Tag/list