func validateContentType()

in code/go/internal/validator/content.go [16:34]


func validateContentType(fsys fs.FS, path string, contentType spectypes.ContentType) error {
	switch contentType.MediaType {
	case "application/x-yaml":
		v, _ := contentType.Params["require-document-dashes"]
		requireDashes := (v == "true")
		if requireDashes {
			err := validateYAMLDashes(fsys, path)
			if err != nil {
				return err
			}
		}
	case "application/json":
	case "text/markdown":
	case "text/plain":
	default:
		return fmt.Errorf("unsupported media type (%s)", contentType)
	}
	return nil
}