#NameFunc: excludeExcluded
-- in.cue --
#Keep: {
	// This comment is included
	excludedStruct: #ExcludedStruct
	excludedInt:    #ExcludedInt
}

// ExcludedStruct is not included in the output.
#ExcludedStruct: {
	A: int
}

// ExcludedInt is not included in the output.
#ExcludedInt: int

#Type: {
	a?: string
	#BaseType
}
#BaseType: {
	b: string
}

-- out/TestGenerateOpenAPI/out.json --
{
   "openapi": "3.0.0",
   "info": {
      "title": "Generated by cue.",
      "version": "no version"
   },
   "paths": {},
   "components": {
      "schemas": {
         "BaseType": {
            "type": "object",
            "required": [
               "b"
            ],
            "properties": {
               "b": {
                  "type": "string"
               }
            }
         },
         "Keep": {
            "type": "object",
            "required": [
               "excludedStruct",
               "excludedInt"
            ],
            "properties": {
               "excludedStruct": {
                  "description": "This comment is included",
                  "type": "object",
                  "required": [
                     "A"
                  ],
                  "properties": {
                     "A": {
                        "type": "integer"
                     }
                  }
               },
               "excludedInt": {
                  "type": "integer"
               }
            }
         },
         "Type": {
            "type": "object",
            "properties": {
               "a": {
                  "type": "string"
               }
            },
            "allOf": [
               {
                  "$ref": "#/components/schemas/BaseType"
               }
            ]
         }
      }
   }
}
