-- in.cue --
import "strings"

#MyType: {
	myString: strings.MinRunes(1) & strings.MaxRunes(5)

	myPattern: =~"foo.*bar"

	myAntiPattern: !~"foo.*bar"
}

-- out/TestGenerateOpenAPI/out.json --
{
   "openapi": "3.0.0",
   "info": {
      "title": "Generated by cue.",
      "version": "no version"
   },
   "paths": {},
   "components": {
      "schemas": {
         "MyType": {
            "type": "object",
            "required": [
               "myString",
               "myPattern",
               "myAntiPattern"
            ],
            "properties": {
               "myString": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 5
               },
               "myPattern": {
                  "type": "string",
                  "pattern": "foo.*bar"
               },
               "myAntiPattern": {
                  "type": "string",
                  "not": {
                     "pattern": "foo.*bar"
                  }
               }
            }
         }
      }
   }
}